Example #1
0
 /**
  * 获得该模块所有模型的名字
  *
  * @return array of model name
  */
 function modelsName()
 {
     if (is_null($this->_models_name)) {
         $dir = rtrim($this->_module_dir, '/\\') . DS . 'model';
         $files = Helper_FileSys::recursionGlob($dir, '*.php');
         $this->_models_name = array();
         foreach ($files as $file) {
             $info = QReflection_Model::testModelFile($file);
             if ($info == false) {
                 continue;
             }
             $this->_models_name[$file] = $info['class'];
         }
         asort($this->_models_name, SORT_STRING);
     }
     return $this->_models_name;
 }
Example #2
0
 /**
  * 获得该模块所有模型的名字
  *
  * @return array of model name
  */
 function reflectionModelsName()
 {
     if (is_null($this->_reflection_models_name)) {
         $dir = rtrim($this->_reflection_module_dir, '/\\') . '/model';
         $this->_reflection_models_name = array();
         foreach ((array) glob($dir . '/*.php') as $path) {
             if (is_dir($path)) {
                 continue;
             }
             $model_name = basename($path);
             if (QReflection_Model::isModelFile($path)) {
                 $this->_reflection_models_name[] = substr($model_name, 0, -4);
             }
         }
         sort($this->_reflection_models_name, SORT_STRING);
     }
     return $this->_reflection_models_name;
 }