Esempio n. 1
0
 /**
  * Determines whether we need to call a getInstance() Alias or just let it through
  *
  * @version 1.0
  * @since   1.0.0
  * @author  Dan Aldridge
  *
  * @param   string $method
  * @param   array $args
  *
  * @return  mixed
  */
 public static function __callStatic($method, $args)
 {
     // check to see if we have called a get*() method
     if (substr($method, 0, 3) === 'get') {
         $className = str_replace('get', '', $method);
         $className = ucwords($className);
         $className = 'Core_Classes_' . $className;
         if (!isset(self::$coreMethods)) {
             $objCore = new Core_Classes_coreObj();
             self::$coreMethods = get_class_methods($objCore);
         }
         if (class_exists($className) && !in_array($className, self::$coreMethods)) {
             if (!isset(Core_Classes_coreObj::$_classes[$className])) {
                 //$className::getInstance($className, (is_array($args) && isset($args[1]) ? $args[1] : array()));
                 $className::getInstance($className, $args[1]);
             }
             return Core_Classes_coreObj::$_classes[$className];
         }
     }
     // Method name didnt match what we expected so just output an error now.
     $debug = array('Class Name' => self::getStaticClassName(), 'Method Called' => $method, 'Method Args' => $args);
     trigger_error('Error: Static Method dosen\'t exist.' . dump($debug));
     return null;
 }