Subversion Repositories cheapmusic

Rev

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

<?php
class Vendors
{
    private static $instance = null;
    private static $ebay = [];
    private static $discogs = [];

    const EBAY = 0;
    const DISCOGS = 1;

    public static function getInstance()
    {
        if (is_null(self::$instance)){
            self::$instance = new self();
        }

        return self::$instance;
    }

    public function setVendor($vendorArray, $type)
    {
        if ($type == self::EBAY) {
            self::$ebay = $vendorArray;
        } else if ($type == self::DISCOGS) {
            self::$discogs = $vendorArray;
        }
    }

    public function getVendor($type)
    {
        if ($type == self::EBAY) {
            return self::$ebay;
        } else if ($type == self::DISCOGS) {
            return self::$discogs;
        }

        return null;
    }
}