create cache for config entity

This commit is contained in:
Manuel Raynaud
2013-09-16 08:56:44 +02:00
parent 7f4a69fcfb
commit 0d0d542d8b
7 changed files with 166 additions and 26 deletions

View File

@@ -65,6 +65,7 @@ class Config extends BaseConfig {
*/
public function postUpdate(ConnectionInterface $con = null)
{
$this->resetQueryCache();
$this->dispatchEvent(TheliaEvents::AFTER_UPDATECONFIG, new ConfigEvent($this));
}
@@ -83,6 +84,12 @@ class Config extends BaseConfig {
*/
public function postDelete(ConnectionInterface $con = null)
{
$this->resetQueryCache();
$this->dispatchEvent(TheliaEvents::AFTER_DELETECONFIG, new ConfigEvent($this));
}
public function resetQueryCache()
{
ConfigQuery::resetCache($this->getName());
}
}