Esempio n. 1
0
 /**
  * Crear los archivos de clases para el modelo de datos
  * 
  * @param type $entityName
  * @param type $prefijo
  * @return array
  */
 static function appCreateEntity($entityName, $prefijo = '')
 {
     self::getConection();
     $entityBuilder = new EntityBuilder(self::$conectionDB, $entityName, $prefijo);
     $entityFile = ucfirst(str_replace($prefijo, "", $entityName));
     $model = $entityBuilder->GetModel();
     $fileModel = "../../entities/models/{$entityFile}Entity.class.php";
     $method = $entityBuilder->GetMethod();
     $fileMethod = "../../entities/methods/{$entityFile}.class.php";
     $okModel = self::createArchive($fileModel, $model);
     $okMethod = self::createArchive($fileMethod, $method);
     $result = array();
     $okModel ? array_push($result, "Ok, {$fileModel} created") : array_push($result, "ERROR creating {$fileModel}");
     $okMethod ? array_push($result, "Ok, {$fileMethod} created") : array_push($result, "ERROR creating {$fileMethod}");
     return $result;
 }