Subversion Repositories cheapmusic

Rev

Rev 10 | Go to most recent revision | Details | 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
 
11
    public function getInstance()
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
    {
22
        if ($type == EBAY) {
23
            self::$ebay = $vendorArray;
24
        } else if ($type == DISCOGS) {
25
            self::$discogs = $vendorArray;
26
        }
27
    }
28
 
29
    public function getVendor($type)
30
    {
31
        if ($type == EBAY) {
32
            return self::$ebay;
33
        } else if ($type == DISCOGS) {
34
            return self::$discogs;
35
        }
36
 
37
        return null;
38
    }
39
}