Conditions | 4 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function getManagedModels() |
||
14 | { |
||
15 | $models = EcommerceConfig::get($this->class, 'managed_models'); |
||
16 | foreach ($models as $key => $model) { |
||
17 | if (is_array($model)) { |
||
18 | $model = $key; |
||
19 | } |
||
20 | if (!class_exists($model)) { |
||
21 | unset($models[$key]); |
||
22 | } |
||
23 | } |
||
24 | Config::inst()->update('ModelAdminEcommerceBaseClass', 'managed_models', $models); |
||
25 | |||
26 | return parent::getManagedModels(); |
||
27 | } |
||
28 | |||
53 |
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.