/**
  * Overrides modElement::remove to add custom error logging and fire
  * modX-specific events.
  *
  * {@inheritDoc}
  */
 public function remove(array $ancestors = array())
 {
     if ($this->xpdo instanceof modX) {
         $this->xpdo->invokeEvent('OnSnippetBeforeRemove', array('snippet' => &$this, 'ancestors' => $ancestors));
     }
     $removed = parent::remove($ancestors);
     if ($removed && $this->xpdo instanceof modX) {
         $this->xpdo->invokeEvent('OnSnippetRemove', array('snippet' => &$this, 'ancestors' => $ancestors));
     } else {
         if (!$removed && !empty($this->xpdo->lexicon)) {
             $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $this->xpdo->lexicon('snippet_err_remove') . $this->toArray());
         }
     }
     return $removed;
 }
Beispiel #2
0
 /**
  * Overrides modElement::getPropertySet to handle separate plugin event
  * property set calls.
  *
  * {@inheritdoc}
  */
 public function getPropertySet($setName = null)
 {
     if (empty($setName) && !empty($this->xpdo->event->propertySet)) {
         $setName = $this->xpdo->event->propertySet;
     }
     return parent::getPropertySet($setName);
 }