. */ /* */ /*************************************************************************************/ namespace Thelia\Model; use Thelia\Model\Base\Config as BaseConfig; use Propel\Runtime\Connection\ConnectionInterface; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\Config\ConfigEvent; class Config extends BaseConfig { use \Thelia\Model\Tools\ModelEventDispatcherTrait; /** * {@inheritDoc} */ public function preInsert(ConnectionInterface $con = null) { parent::preInsert($con); $this->dispatchEvent(TheliaEvents::BEFORE_CREATECONFIG, new ConfigEvent($this)); return true; } /** * {@inheritDoc} */ public function postInsert(ConnectionInterface $con = null) { parent::postInsert($con); $this->dispatchEvent(TheliaEvents::AFTER_CREATECONFIG, new ConfigEvent($this)); } /** * {@inheritDoc} */ public function preUpdate(ConnectionInterface $con = null) { parent::preUpdate($con); $this->dispatchEvent(TheliaEvents::BEFORE_UPDATECONFIG, new ConfigEvent($this)); return true; } /** * {@inheritDoc} */ public function postUpdate(ConnectionInterface $con = null) { parent::postUpdate($con); $this->resetQueryCache(); $this->dispatchEvent(TheliaEvents::AFTER_UPDATECONFIG, new ConfigEvent($this)); } /** * {@inheritDoc} */ public function preDelete(ConnectionInterface $con = null) { parent::preDelete($con); $this->dispatchEvent(TheliaEvents::BEFORE_DELETECONFIG, new ConfigEvent($this)); return true; } /** * {@inheritDoc} */ public function postDelete(ConnectionInterface $con = null) { parent::postDelete($con); $this->resetQueryCache(); $this->dispatchEvent(TheliaEvents::AFTER_DELETECONFIG, new ConfigEvent($this)); } public function resetQueryCache() { ConfigQuery::resetCache($this->getName()); } }