Ejemplo n.º 1
0
 public function fill(array $atributos)
 {
     foreach ($atributos as $key => $atributo) {
         if ($atributo == '' && !$this->isBooleanField($key)) {
             $atributos[$key] = null;
         } else {
             if ($atributo == '' || is_null($atributo)) {
                 $atributos[$key] = false;
             } else {
                 if ($atributo != '' && $this->isDecimalField($key)) {
                     $atributos[$key] = Helper::tf($atributo);
                 }
             }
         }
     }
     return parent::fill($atributos);
 }
Ejemplo n.º 2
0
 public function getModelName()
 {
     if (is_null($this->modelName)) {
         $className = class_basename(get_class($this));
         $className = str_replace('Controller', '', $className);
         if (App::getLocale() == 'es') {
             $className = Helper::strSingularSpanish($className);
         } elseif (App::getLocale() == 'en') {
             $className = Inflect::singularize($className);
         }
         $this->modelName = ucfirst($className);
     }
     return $this->modelName;
 }
Ejemplo n.º 3
0
 private function generarVistasModel($modelName)
 {
     if ($modelName != 'BaseModel') {
         $class = '\\App\\Scaffold\\Generated_Models\\' . $modelName;
         $modelInstance = new $class();
         $collectionName = lcfirst(Helper::strPluralSpanish($modelName));
         $this->generarViewForm($modelName, $modelInstance, $collectionName, 'view');
         $this->generarViewForm($modelName, $modelInstance, $collectionName, 'form');
     }
     return;
 }