예제 #1
0
 /**
  * Catch calls to fields on
  * the page's related entry.
  *
  * @param string $key
  * @return mixed
  */
 public function __get($key)
 {
     $entry = $this->object->getEntry();
     if ($entry->hasField($key)) {
         return (new Decorator())->decorate($entry)->{$key};
     }
     return parent::__get($key);
 }
예제 #2
0
 /**
  * Handle the command.
  *
  * @param PageRepositoryInterface $pages
  */
 public function handle(EloquentRepositoryInterface $repository)
 {
     if ($entry = $this->page->getEntry()) {
         $repository->delete($entry);
     }
 }