Subversion Repositories cheapmusic

Rev

Rev 9 | Rev 20 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 10
Line 6... Line 6...
6
    private static $discogs = [];
6
    private static $discogs = [];
7
 
7
 
8
    const EBAY = 0;
8
    const EBAY = 0;
9
    const DISCOGS = 1;
9
    const DISCOGS = 1;
10
 
10
 
11
    public function getInstance()
11
    public static function getInstance()
12
    {
12
    {
13
        if (is_null(self::$instance)){
13
        if (is_null(self::$instance)){
14
            self::$instance = new self();
14
            self::$instance = new self();
15
        }
15
        }
16
 
16
 
17
        return self::$instance;
17
        return self::$instance;
18
    }
18
    }
19
 
19
 
20
    public function setVendor($vendorArray, $type)
20
    public function setVendor($vendorArray, $type)
21
    {
21
    {
22
        if ($type == EBAY) {
22
        if ($type == self::EBAY) {
23
            self::$ebay = $vendorArray;
23
            self::$ebay = $vendorArray;
24
        } else if ($type == DISCOGS) {
24
        } else if ($type == self::DISCOGS) {
25
            self::$discogs = $vendorArray;
25
            self::$discogs = $vendorArray;
26
        }
26
        }
27
    }
27
    }
28
 
28
 
29
    public function getVendor($type)
29
    public function getVendor($type)
30
    {
30
    {
31
        if ($type == EBAY) {
31
        if ($type == self::EBAY) {
32
            return self::$ebay;
32
            return self::$ebay;
33
        } else if ($type == DISCOGS) {
33
        } else if ($type == self::DISCOGS) {
34
            return self::$discogs;
34
            return self::$discogs;
35
        }
35
        }
36
 
36
 
37
        return null;
37
        return null;
38
    }
38
    }