Subversion Repositories cheapmusic

Rev

Rev 9 | Rev 20 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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