Subversion Repositories cheapmusic

Rev

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

Rev 10 Rev 20
Line 2... Line 2...
2
class Vendors
2
class Vendors
3
{
3
{
4
    private static $instance = null;
4
    private static $instance = null;
5
    private static $ebay = [];
5
    private static $ebay = [];
6
    private static $discogs = [];
6
    private static $discogs = [];
-
 
7
    private static $linkshare = [];
-
 
8
    private static $cjaffiliate = [];
-
 
9
    private static $walmart = [];
7
 
10
 
8
    const EBAY = 0;
11
    const EBAY = 0;
9
    const DISCOGS = 1;
12
    const DISCOGS = 1;
-
 
13
    const LINKSHARE = 2;
-
 
14
    const CJAFFILIATE = 3;
-
 
15
    const WALMART = 4;
10
 
16
 
11
    public static function getInstance()
17
    public static function getInstance()
12
    {
18
    {
13
        if (is_null(self::$instance)){
19
        if (is_null(self::$instance)){
14
            self::$instance = new self();
20
            self::$instance = new self();
Line 21... Line 27...
21
    {
27
    {
22
        if ($type == self::EBAY) {
28
        if ($type == self::EBAY) {
23
            self::$ebay = $vendorArray;
29
            self::$ebay = $vendorArray;
24
        } else if ($type == self::DISCOGS) {
30
        } else if ($type == self::DISCOGS) {
25
            self::$discogs = $vendorArray;
31
            self::$discogs = $vendorArray;
-
 
32
        } else if ($type == self::LINKSHARE) {
-
 
33
            self::$linkshare = $vendorArray;
-
 
34
        } else if ($type == self::CJAFFILIATE) {
-
 
35
            self::$cjaffiliate = $vendorArray;
-
 
36
        } else if ($type == self::WALMART) {
-
 
37
            self::$walmart = $vendorArray;
26
        }
38
        }
27
    }
39
    }
28
 
40
 
29
    public function getVendor($type)
41
    public function getVendor($type)
30
    {
42
    {
31
        if ($type == self::EBAY) {
43
        if ($type == self::EBAY) {
32
            return self::$ebay;
44
            return self::$ebay;
33
        } else if ($type == self::DISCOGS) {
45
        } else if ($type == self::DISCOGS) {
34
            return self::$discogs;
46
            return self::$discogs;
-
 
47
        } else if ($type == self::LINKSHARE) {
-
 
48
            return self::$linkshare;
-
 
49
        } else if ($type == self::CJAFFILIATE) {
-
 
50
            return self::$cjaffiliate;
-
 
51
        } else if ($type == self::WALMART) {
-
 
52
            return self::$walmart;
35
        }
53
        }
36
 
54
 
37
        return null;
55
        return null;
38
    }
56
    }
39
}
57
}