Commit 9395f44c3f549833d5ef1944870db9bf0270793a
1 parent
28a730e5
Exists in
2.8
and in
6 other branches
Extrai a busca do índice do bloco try
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
ieducar/lib/CoreExt/DataMapper.php
... | ... | @@ -798,8 +798,10 @@ abstract class CoreExt_DataMapper |
798 | 798 | protected function _mapData($data, CoreExt_Entity $instance) |
799 | 799 | { |
800 | 800 | foreach ($data as $key => $value) { |
801 | + $index = array_search($key, $this->_attributeMap); | |
802 | + | |
801 | 803 | try { |
802 | - if (false !== ($index = array_search($key, $this->_attributeMap))) { | |
804 | + if ($index !== false) { | |
803 | 805 | $instance->$index = $value; |
804 | 806 | } else { |
805 | 807 | $instance->$key = $value; | ... | ... |