예제 #1
0
 public function save($arguments)
 {
     $this->facade->name = $arguments['name'];
     $composer = new ComposerFacade('composer.json');
     $this->facade->namespace = $composer->getNamespace() . 'Controller';
     foreach ($arguments['actions'] as $action => $data) {
         if (isset($data['_remove'])) {
             $this->facade->removeAction($action);
         } else {
             if ($this->facade->hasAction($action)) {
                 if ($action !== $data['name']) {
                     $this->facade->renameAction($action, $data['name']);
                 }
             } else {
                 $this->facade->addAction($data['name']);
             }
         }
     }
     $this->facade->save();
 }
예제 #2
0
파일: Model.php 프로젝트: jmverges/soup
 public function save($arguments)
 {
     $this->facade->name = $arguments['name'];
     $composer = new ComposerFacade('composer.json');
     $this->facade->namespace = $composer->getNamespace() . '\\Domain\\Model';
     foreach ($arguments['properties'] as $property => $data) {
         if (isset($data['_remove'])) {
             $this->facade->removeProperty($property);
         } else {
             if (isset($existingProperties[$property])) {
                 if ($property !== $data['name']) {
                     $this->facade->renameProperty($property, $data['name']);
                 }
             } else {
                 $this->facade->addProperty($data['name'], NULL, array('propertyType' => $data['type']));
             }
         }
     }
     $this->facade->save();
 }