Rev 20 | Rev 81 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?phpclass Vendors{private static $instance = null;private static $ebay = [];private static $discogs = [];private static $linkshare = [];private static $cjaffiliate = [];private static $walmart = [];private static $itunes = [];const EBAY = 0;const DISCOGS = 1;const LINKSHARE = 2;const CJAFFILIATE = 3;const WALMART = 4;const ITUNES = 5;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;} else if ($type == self::LINKSHARE) {self::$linkshare = $vendorArray;} else if ($type == self::CJAFFILIATE) {self::$cjaffiliate = $vendorArray;} else if ($type == self::WALMART) {self::$walmart = $vendorArray;} else if ($type == self::ITUNES) {self::$itunes = $vendorArray;}}public function getVendor($type){if ($type == self::EBAY) {return self::$ebay;} else if ($type == self::DISCOGS) {return self::$discogs;} else if ($type == self::LINKSHARE) {return self::$linkshare;} else if ($type == self::CJAFFILIATE) {return self::$cjaffiliate;} else if ($type == self::WALMART) {return self::$walmart;} else if ($type == self::ITUNES) {return self::$itunes;}return null;}}