Skip to content

Commit 25d6883

Browse files
author
Zsolt Gál
committed
Improve code readability/understandability by separating flush event cache cleans to separate method
1 parent 8eb58b6 commit 25d6883

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/code/community/Inviqa/SymfonyContainer/Model/Observer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ class Inviqa_SymfonyContainer_Model_Observer
1212

1313
public function onCacheRefresh(Varien_Event_Observer $event)
1414
{
15-
$eventType = $event->getType();
16-
if ($eventType === ConfigurationBuilder::MODEL_ALIAS || is_null($eventType)) {
15+
if ($event->getType() === ConfigurationBuilder::MODEL_ALIAS) {
1716
$this->clearCache();
1817
}
1918
}
2019

20+
public function onCacheFlush()
21+
{
22+
$this->clearCache();
23+
}
24+
2125
public function onPreDispatch(Varien_Event_Observer $event)
2226
{
2327
$controller = $event->getControllerAction();

app/code/community/Inviqa/SymfonyContainer/etc/config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<inviqa_symfonyContainer>
2828
<class>Inviqa_SymfonyContainer_Model_Observer</class>
2929
<type>singleton</type>
30-
<method>onCacheRefresh</method>
30+
<method>onCacheFlush</method>
3131
</inviqa_symfonyContainer>
3232
</observers>
3333
</adminhtml_cache_flush_all>
@@ -36,7 +36,7 @@
3636
<inviqa_symfonyContainer>
3737
<class>Inviqa_SymfonyContainer_Model_Observer</class>
3838
<type>singleton</type>
39-
<method>onCacheRefresh</method>
39+
<method>onCacheFlush</method>
4040
</inviqa_symfonyContainer>
4141
</observers>
4242
</adminhtml_cache_flush_system>

0 commit comments

Comments
 (0)