Esempio n. 1
0
 public function invoke(Scaffolding $scaffolding)
 {
     $name = ucFirst($this->in->getArgument('entityName'));
     $file = $scaffolding->createRepository($name);
     $this->writeCreatedFilesHeader();
     $this->writeCreatedFile($file);
     $file = $scaffolding->createMapper($name);
     $this->writeCreatedFile($file);
     $params = [];
     foreach ($this->in->getVariadics() as $arg) {
         list($param, $type) = explode(':', $arg) + [NULL, 'mixed'];
         $params[$param] = $type;
     }
     $file = $scaffolding->createEntity($name, $params);
     $this->writeCreatedFile($file);
     $this->out->writeln("\n<comment>Don't forget to add repository to your Model class</comment>");
     $plural = Inflect::pluralize($name);
     $repoClass = 'Rme\\' . ucFirst($plural) . 'Repository';
     $param = lcFirst($plural);
     $this->out->writeln(" * @property-read {$repoClass} \${$param}");
 }