Conditions | 9 |
Paths | 20 |
Total Lines | 29 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
14 | protected function _prepareCollection() |
||
15 | { |
||
16 | parent::_prepareCollection(); |
||
17 | $collection = $this->getCollection(); |
||
18 | $turpentineEnabled = false; |
||
19 | $fullPageEnabled = false; |
||
20 | foreach ($collection as $key=>$item) |
||
21 | { |
||
22 | if ($item->getStatus() == 1 && ($item->getId() == 'turpentine_pages' || $item->getId() == 'turpentine_esi_blocks')) |
||
23 | { |
||
24 | $turpentineEnabled = true; |
||
25 | } |
||
26 | if ($item->getStatus() == 1 && $item->getId() == 'full_page') |
||
27 | { |
||
28 | $fullPageEnabled = true; |
||
29 | } |
||
30 | } |
||
31 | if ($turpentineEnabled) |
||
32 | { |
||
33 | $collection->removeItemByKey('full_page'); |
||
34 | } |
||
35 | if ($fullPageEnabled) |
||
36 | { |
||
37 | $collection->removeItemByKey('turpentine_pages'); |
||
38 | $collection->removeItemByKey('turpentine_esi_blocks'); |
||
39 | } |
||
40 | $this->setCollection($collection); |
||
41 | return $this; |
||
42 | } |
||
43 | |||
45 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.