/** * Handle the command. * * @param PageRepositoryInterface $pages */ public function handle(PageRepositoryInterface $pages) { foreach ($this->page->getChildren() as $page) { if ($page instanceof PageInterface && $page->isEnabled()) { $pages->save($page->setAttribute('path', $this->page->getPath() . '/' . $page->getSlug())); } } }
/** * Handle the command. * * @param PageRepositoryInterface $pages */ public function handle(PageRepositoryInterface $pages) { /* @var PageInterface $page */ foreach ($this->page->getChildren() as $page) { if ($page->isEnabled()) { $pages->save($page->setPath($this->page->getPath() . '/' . $page->getSlug())); } } }
/** * Handle the command. * * @param TypeRepositoryInterface $types * @param PageRepositoryInterface $pages */ public function handle(TypeRepositoryInterface $types, PageRepositoryInterface $pages) { /* @var TypeInterface $type */ $type = $types->find($this->type->getId()); /* @var PageInterface $page */ foreach ($type->getPages() as $page) { $pages->save($page->setAttribute('entry_type', $this->type->getEntryModelName())); } }