| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function getAllOptions() |
||
| 15 | { |
||
| 16 | $attributes = Mage::getModel('eav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getAttributeCollection(); |
||
| 17 | $attributes->setOrder('frontend_label', 'ASC'); |
||
| 18 | |||
| 19 | $_options = []; |
||
| 20 | $_options[] = [ |
||
| 21 | 'label' => Mage::helper('yandexdelivery')->__('No usage'), |
||
| 22 | 'value' => 0 |
||
| 23 | ]; |
||
| 24 | |||
| 25 | foreach ($attributes as $attr) { |
||
| 26 | $label = $attr->getStoreLabel() ? $attr->getStoreLabel() : $attr->getFrontendLabel(); |
||
| 27 | if ('' != $label) { |
||
| 28 | $_options[] = ['label' => $label, 'value' => $attr->getAttributeCode()]; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | return $_options; |
||
| 32 | } |
||
| 33 | |||
| 39 |
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.