/** * 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; }
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; }
/** * 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; }