Example #1
0
 public function getInstance()
 {
     if (self::$instance === NULL) {
         $argv = func_get_args();
         $class = __CLASS__;
         self::$instance = new $class($argv[0]);
     }
     return self::$instance;
 }
Example #2
0
 /**
  * @access  public
  * @param   array  structure defines correlatio between catalog & source fields
  * @param   string could be 'CSV' or (not implemented so far) 'DB'
  */
 public static function createCatalogProvider($structure, $source_type)
 {
     try {
         switch ($source_type) {
             case 'CSV':
                 return CatalogCSV::getInstance($structure);
                 break;
             default:
                 return new NullCatalog();
         }
     } catch (Exception $e) {
         self::log($e->getMessage(), 'err');
     }
 }