Code Duplication    Length = 14-14 lines in 4 locations

Alpha/Model/ActiveRecordProviderMySQL.php 2 locations

@@ 278-291 (lines=14) @@
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) {
277
            // it is possible that the load failed due to the table not being up-to-date
278
            if ($this->BO->checkTableNeedsUpdate()) {
279
                $missingFields = $this->BO->findMissingFields();
280
281
                $count = count($missingFields);
282
283
                for ($i = 0; $i < $count; ++$i) {
284
                    $this->BO->addProperty($missingFields[$i]);
285
                }
286
287
                throw new RecordNotFoundException('Failed to load object of OID ['.$OID.'], table ['.$this->BO->getTableName().'] was out of sync with the database so had to be updated!');
288
                self::$logger->warn('<<load');
289
290
                return;
291
            }
292
        }
293
294
        self::$logger->debug('<<load ['.$OID.']');
@@ 449-462 (lines=14) @@
446
            self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']');
447
        } catch (PHPException $e) {
448
            // it is possible that the load failed due to the table not being up-to-date
449
            if ($this->BO->checkTableNeedsUpdate()) {
450
                $missingFields = $this->BO->findMissingFields();
451
452
                $count = count($missingFields);
453
454
                for ($i = 0; $i < $count; ++$i) {
455
                    $this->BO->addProperty($missingFields[$i]);
456
                }
457
458
                throw new RecordNotFoundException('Failed to load object by attribute ['.$attribute.'] and value ['.$value.'], table ['.$this->BO->getTableName().'] was out of sync with the database so had to be updated!');
459
                self::$logger->debug('<<loadByAttribute');
460
461
                return;
462
            }
463
        }
464
465
        self::$logger->debug('<<loadByAttribute');

Alpha/Model/ActiveRecordProviderSQLite.php 2 locations

@@ 278-291 (lines=14) @@
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) {
277
            // it is possible that the load failed due to the table not being up-to-date
278
            if ($this->BO->checkTableNeedsUpdate()) {
279
                $missingFields = $this->BO->findMissingFields();
280
281
                $count = count($missingFields);
282
283
                for ($i = 0; $i < $count; ++$i) {
284
                    $this->BO->addProperty($missingFields[$i]);
285
                }
286
287
                throw new RecordFoundException('Failed to load object of OID ['.$OID.'], table ['.$this->BO->getTableName().'] was out of sync with the database so had to be updated!');
288
                self::$logger->debug('<<load');
289
290
                return;
291
            }
292
        }
293
294
        self::$logger->debug('<<load');
@@ 448-461 (lines=14) @@
445
            self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']');
446
        } catch (PHPException $e) {
447
            // it is possible that the load failed due to the table not being up-to-date
448
            if ($this->BO->checkTableNeedsUpdate()) {
449
                $missingFields = $this->BO->findMissingFields();
450
451
                $count = count($missingFields);
452
453
                for ($i = 0; $i < $count; ++$i) {
454
                    $this->BO->addProperty($missingFields[$i]);
455
                }
456
457
                throw new RecordNotFoundException('Failed to load object by attribute ['.$attribute.'] and value ['.$value.'], table ['.$this->BO->getTableName().'] was out of sync with the database so had to be updated!');
458
                self::$logger->debug('<<loadByAttribute');
459
460
                return;
461
            }
462
        }
463
464
        self::$logger->debug('<<loadByAttribute');