示例#1
0
 /**
  * Handle the command.
  *
  * @param StreamRepositoryInterface $streams
  */
 public function handle(StreamRepositoryInterface $streams)
 {
     if (!$this->type->isForceDeleting()) {
         return;
     }
     $streams->delete($streams->findBySlugAndNamespace($this->type->getSlug() . '_pages', 'pages'));
 }
示例#2
0
 /**
  * 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()));
     }
 }
示例#3
0
 /**
  * Handle the command.
  *
  * @param StreamRepositoryInterface $streams
  * @param TypeRepositoryInterface   $types
  * @param Repository                $config
  */
 public function handle(StreamRepositoryInterface $streams, TypeRepositoryInterface $types, Repository $config)
 {
     /* @var TypeInterface $type */
     $type = $types->find($this->type->getId());
     /* @var StreamInterface $stream */
     $stream = $type->getEntryStream();
     $stream->fill([$config->get('app.fallback_locale') => ['name' => $this->type->getName(), 'description' => $this->type->getDescription()], 'slug' => $this->type->getSlug() . '_pages']);
     $streams->save($stream);
 }
示例#4
0
 /**
  * Handle the command.
  *
  * @param StreamRepositoryInterface $streams
  * @return \Anomaly\Streams\Platform\Stream\Contract\StreamInterface|null
  */
 public function handle(StreamRepositoryInterface $streams)
 {
     return $streams->findBySlugAndNamespace($this->type->getSlug() . '_pages', 'pages');
 }
示例#5
0
 /**
  * Handle the command.
  *
  * @param StreamRepositoryInterface $streams
  * @param Repository                $config
  */
 public function handle(StreamRepositoryInterface $streams, Repository $config)
 {
     $streams->create([$config->get('app.fallback_locale') => ['name' => $this->type->getName(), 'description' => $this->type->getDescription()], 'namespace' => 'pages', 'slug' => $this->type->getSlug() . '_pages', 'translatable' => true, 'locked' => false]);
 }
示例#6
0
 /**
  * Handle the command.
  *
  * @param PageRepositoryInterface $pages
  */
 public function handle(PageRepositoryInterface $pages)
 {
     foreach ($this->type->pages()->onlyTrashed()->get() as $page) {
         $pages->restore($page);
     }
 }
示例#7
0
 /**
  * Handle the command.
  *
  * @param PageRepositoryInterface $pages
  */
 public function handle(PageRepositoryInterface $pages)
 {
     foreach ($this->type->getPages() as $page) {
         $pages->delete($page);
     }
 }