Exemplo n.º 1
0
 /**
  * Fired just before saving the entry.
  *
  * @param EntryInterface|PostInterface $entry
  */
 public function creating(EntryInterface $entry)
 {
     if (!$entry->getStrId()) {
         $entry->setAttribute('str_id', str_random());
     }
     parent::creating($entry);
 }
Exemplo n.º 2
0
 /**
  * Fired before saving the file.
  *
  * @param EntryInterface|FileInterface $entry
  * @return bool
  */
 public function saving(EntryInterface $entry)
 {
     /**
      * Make sure the resource exists.
      */
     if (!($resource = $entry->resource())) {
         return false;
     }
     return parent::saving($entry);
 }
Exemplo n.º 3
0
 /**
  * Fired after deleting the file.
  *
  * @param EntryInterface|FileInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     /**
      * Make sure the resource exists
      * and is deleted successfully.
      */
     if ($entry->isForceDeleting() && ($resource = $entry->resource())) {
         $resource->delete();
     }
     parent::deleted($entry);
 }
Exemplo n.º 4
0
 /**
  * Fire just before saving a folder.
  *
  * @param EntryInterface|FolderInterface $entry
  * @return bool
  */
 public function saving(EntryInterface $entry)
 {
     $disk = $entry->getDisk();
     /**
      * If the folder already exists then
      * skip it because even if it does not
      * exist on the server it'll be written
      * automatically soon.
      */
     if ($this->folders->findByName($entry->getName(), $disk, $entry->getParent())) {
         return false;
     }
     return parent::saving($entry);
 }
Exemplo n.º 5
0
 /**
  * Fired after a page type is restored.
  *
  * @param EntryInterface|TypeInterface $entry
  */
 public function restored(EntryInterface $entry)
 {
     $this->commands->dispatch(new RestorePages($entry));
     parent::restored($entry);
 }
Exemplo n.º 6
0
 /**
  * Fired after a page type is deleted.
  *
  * @param EntryInterface|TypeInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->commands->dispatch(new DeletePages($entry));
     $this->commands->dispatch(new DeleteStream($entry));
     parent::deleted($entry);
 }
Exemplo n.º 7
0
 /**
  * Fired after an entry is deleted.
  *
  * @param EntryInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->dispatch(new UnsetChildLinks($entry));
     parent::deleted($entry);
 }
Exemplo n.º 8
0
 /**
  * Fired after a page is deleted.
  *
  * @param EntryInterface|PageInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->dispatch(new DeleteChildren($entry));
     $this->dispatch(new DeleteEntry($entry));
     parent::deleted($entry);
 }
Exemplo n.º 9
0
 /**
  * Fired after an entry is deleted.
  *
  * @param EntryInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->dispatch(new DeleteMenuLinks($entry));
     parent::deleted($entry);
 }
Exemplo n.º 10
0
 /**
  * Fire just before deleting an entry.
  *
  * @param EntryInterface|DiskInterface $entry
  * @return bool
  */
 public function deleting(EntryInterface $entry)
 {
     $this->dispatch(new DeleteFolders($entry));
     return parent::deleting($entry);
 }
Exemplo n.º 11
0
 /**
  * Fired after a redirect is deleted.
  *
  * @param EntryInterface|RedirectInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->commands->dispatch(new GenerateRoutesFile());
     parent::deleted($entry);
 }
Exemplo n.º 12
0
 /**
  * Fired after a user is deleted.
  *
  * @param EntryInterface $entry
  */
 public function deleted(EntryInterface $entry)
 {
     $this->events->fire(new UserWasDeleted($entry));
     parent::deleted($entry);
 }