Пример #1
0
 public function execute($params)
 {
     $parser = new YAMLParser();
     $yaml_configuration = $parser->parse($params[0]);
     print_r($yaml_configuration);
     if (!isset($yaml_configuration['crud'])) {
         Makiavelo::info("**** ERROR ****");
         Makiavelo::info("CRUD key not found on yaml file, cancelling generation...");
     } else {
         $crud_info = $yaml_configuration['crud'];
         $this->en_name = $crud_info['entity']['name'];
         if (isset($crud_info['entity']['validations'])) {
             $this->generateValidations($crud_info['entity']['validations']);
         }
         $this->generateEntity($crud_info['entity']);
         $this->generateViews($crud_info['entity']);
         $this->generateSQL();
         $this->generateRoutes();
         $contGen = new ControllerGenerator();
         $contGen->execute(array($this->en_name, "no-views"));
     }
 }