aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service.php
blob: a5372622f7802353fe3d89b7b2e2e997de5a5ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
class SemanticScuttle_Service
{
    /**
     * SQL database object
     *
     * @var sql_db
     */
    protected $db;



    /**
     * Returns the single service instance
     *
     * @internal
     * This function can be used once PHP 5.3 is minimum, because only
     * 5.3 supports late static binding. For all lower php versions,
     * we still need a copy of this method in each service class.
     *
     * @param DB $db Database object
     *
     * @return SemanticScuttle_Service
     */
	public static function getInstance($db)
    {
		static $instance;
		if (!isset($instance)) {
            $instance = new self($db);
        }
		return $instance;
	}

}
?>