Ejemplo n.º 1
0
 /**
  * Overrides xPDOObject::save to cache the menus.
  *
  * {@inheritdoc}
  */
 public function save($cacheFlag = null) {
     $saved = parent::save($cacheFlag);
     if ($saved && empty($this->xpdo->config[xPDO::OPT_SETUP])) {
         $this->rebuildCache();
     }
     return $saved;
 }
Ejemplo n.º 2
0
 public function save($cacheFlag = null)
 {
     $saved = parent::save();
     if ($saved && !$this->getOption(xPDO::OPT_SETUP)) {
         $this->xpdo->call('modNamespace', 'clearCache', array(&$this->xpdo));
     }
     return $saved;
 }
Ejemplo n.º 3
0
    /**
     * Overrides xPDOObject::save to fire modX-specific events.
     *
     * {@inheritDoc}
     */
    public function save($cacheFlag= null) {
        $isNew = $this->isNew();

        if ($this->xpdo instanceof modX) {
            $this->xpdo->invokeEvent('OnContextBeforeSave',array(
                'context' => &$this,
                'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
                'cacheFlag' => $cacheFlag,
            ));
        }

        $saved = parent :: save($cacheFlag);

        if ($saved && $this->xpdo instanceof modX) {
            $this->xpdo->invokeEvent('OnContextSave',array(
                'context' => &$this,
                'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
                'cacheFlag' => $cacheFlag,
            ));
        }
        return $saved;
    }