diff options
Diffstat (limited to 'src/SemanticScuttle/Service/SearchHistory.php')
| -rw-r--r-- | src/SemanticScuttle/Service/SearchHistory.php | 24 | 
1 files changed, 17 insertions, 7 deletions
diff --git a/src/SemanticScuttle/Service/SearchHistory.php b/src/SemanticScuttle/Service/SearchHistory.php index 91457e8..7cffa83 100644 --- a/src/SemanticScuttle/Service/SearchHistory.php +++ b/src/SemanticScuttle/Service/SearchHistory.php @@ -1,18 +1,28 @@  <?php -class SearchHistoryService { -	var $db; +class SemanticScuttle_Service_SearchHistory extends SemanticScuttle_Service +{  	var $tablename;  	var $sizeSearchHistory; -	function &getInstance(&$db) { +    /** +     * Returns the single service instance +     * +     * @param DB $db Database object +     * +     * @return SemanticScuttle_Service +     */ +	public static function getInstance($db) +    {  		static $instance; -		if (!isset($instance)) -		$instance =& new SearchHistoryService($db); +		if (!isset($instance)) { +            $instance = new self($db); +        }  		return $instance;  	} -	function SearchHistoryService(& $db) { -		$this->db =& $db; +	public function __construct($db) +    { +		$this->db = $db;  		$this->tablename = $GLOBALS['tableprefix'] .'searchhistory';  		if(isset($GLOBALS['sizeSearchHistory'])) {  			$this->sizeSearchHistory = $GLOBALS['sizeSearchHistory'];  | 
