File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ protected function _getEntityModels()
3030 $ entityModels = [];
3131
3232 foreach ($ entityModelsConfigArray as $ entityModelsConfig ) {
33- if (Mage::getModel ($ entityModelsConfig ['class ' ])) {
33+ $ entityModel = Mage::getModel ($ entityModelsConfig ['class ' ]);
34+ if ($ entityModel instanceof IntegerNet_Anonymizer_Model_Bridge_Entity_Abstract
35+ && $ entityModel ->entityExists ()) {
3436 $ entityModels [] = $ entityModelsConfig ['class ' ];
3537 }
3638 }
@@ -39,12 +41,12 @@ protected function _getEntityModels()
3941 }
4042 protected function _sortEntityModelsConfig ($ entityModelsConfig )
4143 {
42- function sortEntityModels ( $ entityModel1 , $ entityModel2 )
43- {
44- return strcmp ($ entityModel1[ ' sort ' ] , $ entityModel2[ ' sort ' ]);
45- }
46-
47- usort ( $ entityModelsConfig , ' sortEntityModels ' );
44+ usort (
45+ $ entityModelsConfig ,
46+ function ($ entityModel1 , $ entityModel2) {
47+ return strcmp ( $ entityModel1 [ ' sort ' ], $ entityModel2 [ ' sort ' ]);
48+ }
49+ );
4850 return $ entityModelsConfig ;
4951 }
5052 /**
Original file line number Diff line number Diff line change @@ -174,4 +174,12 @@ public function getCollectionIterator()
174174 return $ iterator ;
175175 }
176176
177+ /**
178+ * Check if the entity exists
179+ * @return bool
180+ */
181+ public function entityExists ()
182+ {
183+ return (bool )$ this ->_entity ;
184+ }
177185}
You can’t perform that action at this time.
0 commit comments