Code Duplication    Length = 20-20 lines in 2 locations

Alpha/Model/ActiveRecordProviderMySQL.php 1 location

@@ 254-273 (lines=20) @@
251
        $properties = $reflection->getProperties();
252
253
        try {
254
            foreach ($properties as $propObj) {
255
                $propName = $propObj->name;
256
257
                // filter transient attributes
258
                if (!in_array($propName, $this->BO->getTransientAttributes())) {
259
                    $this->BO->set($propName, $row[$propName]);
260
                } elseif (!$propObj->isPrivate() && $this->BO->getPropObject($propName) instanceof Relation) {
261
                    $prop = $this->BO->getPropObject($propName);
262
263
                    // handle the setting of ONE-TO-MANY relation values
264
                    if ($prop->getRelationType() == 'ONE-TO-MANY') {
265
                        $this->BO->set($propObj->name, $this->BO->getOID());
266
                    }
267
268
                    // handle the setting of MANY-TO-ONE relation values
269
                    if ($prop->getRelationType() == 'MANY-TO-ONE' && isset($row[$propName])) {
270
                        $this->BO->set($propObj->name, $row[$propName]);
271
                    }
272
                }
273
            }
274
        } catch (IllegalArguementException $e) {
275
            self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']');
276
        } catch (PHPException $e) {

Alpha/Model/ActiveRecordProviderSQLite.php 1 location

@@ 248-267 (lines=20) @@
245
        $properties = $reflection->getProperties();
246
247
        try {
248
            foreach ($properties as $propObj) {
249
                $propName = $propObj->name;
250
251
                // filter transient attributes
252
                if (!in_array($propName, $this->BO->getTransientAttributes())) {
253
                    $this->BO->set($propName, $row[$propName]);
254
                } elseif (!$propObj->isPrivate() && $this->BO->getPropObject($propName) instanceof Relation) {
255
                    $prop = $this->BO->getPropObject($propName);
256
257
                    // handle the setting of ONE-TO-MANY relation values
258
                    if ($prop->getRelationType() == 'ONE-TO-MANY') {
259
                        $this->BO->set($propObj->name, $this->BO->getOID());
260
                    }
261
262
                    // handle the setting of MANY-TO-ONE relation values
263
                    if ($prop->getRelationType() == 'MANY-TO-ONE' && isset($row[$propName])) {
264
                        $this->BO->set($propObj->name, $row[$propName]);
265
                    }
266
                }
267
            }
268
        } catch (IllegalArguementException $e) {
269
            self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']');
270
        } catch (PHPException $e) {