private function _getStructureFromBaseRepoFile($fileName)
 {
     $objBaseRepositoryName = str_replace('.php', '', $fileName);
     $objBaseRepositoryName = NamingConvention::snakeCaseToCamelCaseFirstUpper($objBaseRepositoryName) . 'sitory';
     load_file($this->_baseRepoDir . $fileName);
     $objRepository = new $objBaseRepositoryName();
     return $objRepository->getStructure();
 }
 private function _invoke($query)
 {
     $invokeFunction = 'invoke' . NamingConvention::snakeCaseToCamelCaseFirstUpper($query['action']);
     $classNameSnakeCase = $query['module'] . '_' . $query['app'] . '_controller';
     $rc = new ReflectionClass(NamingConvention::snakeCaseToCamelCaseFirstUpper($classNameSnakeCase));
     $controller = $rc->newInstance();
     $hasFunction = false;
     $methods = get_class_methods($controller);
     foreach ($methods as $method) {
         if ($method == $invokeFunction) {
             $controller->{$invokeFunction}();
             return true;
         }
     }
     return false;
 }
 private function _updateModels($argv)
 {
     $baseRepoFiles = $this->_getBaseRepoFileNames();
     foreach ($baseRepoFiles as $baseRepoFile) {
         $objName = str_replace('_base_repo.php', '', $baseRepoFile);
         $objName = NamingConvention::snakeCaseToCamelCaseFirstUpper($objName);
         $objBaseRepositoryName = $objName . 'BaseRepository';
         $objBaseRepositoryFileName = NamingConvention::camelCaseToSnakeCase($objName) . '_base_repo.php';
         load_file($this->_baseRepoDir . $objBaseRepositoryFileName);
         $objRepository = new $objBaseRepositoryName();
         $structure = $objRepository->getStructure();
         $modelFileCreator = new ModelFileCreator();
         $modelFileCreator->updateModelBaseFile($objName, $structure);
     }
 }
Example #4
0
 private function _getActiveRecordClassName($activeRecordFileName)
 {
     $classNameSnakeCase = substr($activeRecordFileName, 15, strlen($activeRecordFileName) - (16 + 3));
     $classNameCamelCase = NamingConvention::snakeCaseToCamelCaseFirstUpper($classNameSnakeCase);
     return $classNameCamelCase . 'Migration';
 }