Code Duplication    Length = 5-5 lines in 2 locations

bundles/lib/Form/Container.php 2 locations

@@ 142-146 (lines=5) @@
139
140
            call_user_func_array(array(&$oEntity, $sMethodName), array($this->_oForm->getIdEntity()));
141
142
            foreach ($this->_oForm->getElement() as $sKey => $sValue) {
143
144
                $sMethodName = 'set_'.$sValue->getName().'';
145
                call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
146
            }
147
148
            $oEntity->save();
149
        } else if ($this->_oForm->getSynchronizeEntity() !== null && isset($aRequest) && count($aRequest) > 0) {
@@ 153-157 (lines=5) @@
150
151
            $oEntity = new $this->_oForm->_sSynchronizeEntity;
152
153
            foreach ($this->_oForm->getElement() as $sKey => $sValue) {
154
155
                $sMethodName = 'set_'.$sValue->getName().'';
156
                call_user_func_array(array(&$oEntity, $sMethodName), array($aRequest[$sValue->getName()]));
157
            }
158
159
            $this->_oForm->setIdEntityCreated($oEntity->save());
160
        }