Commit 28a730e569cc38680d1b671fb1f86e88c77c0eaa
1 parent
a61763eb
Exists in
2.9
and in
7 other branches
Modifica implementação a fim de evitar falta de performance
A falta de performance ocorre devido a inumeras Exceções lançadas e ao uso extremo dos métodos mágicos do PHP.
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
ieducar/lib/CoreExt/DataMapper.php
... | ... | @@ -799,13 +799,13 @@ abstract class CoreExt_DataMapper |
799 | 799 | { |
800 | 800 | foreach ($data as $key => $value) { |
801 | 801 | try { |
802 | - $instance->$key = $value; | |
803 | - } catch (CoreExt_Exception_InvalidArgumentException $e) { | |
804 | - // Caso o campo não tenha um atributo correspondente, procura no | |
805 | - // mapa de atributos pelo equivalente e atribue. | |
806 | 802 | if (false !== ($index = array_search($key, $this->_attributeMap))) { |
807 | 803 | $instance->$index = $value; |
804 | + } else { | |
805 | + $instance->$key = $value; | |
808 | 806 | } |
807 | + } catch (CoreExt_Exception_InvalidArgumentException $e) { | |
808 | + // | |
809 | 809 | } |
810 | 810 | } |
811 | 811 | ... | ... |