Code Duplication    Length = 3-3 lines in 5 locations

Alpha/Model/ActiveRecordProviderSQLite.php 5 locations

@@ 912-914 (lines=3) @@
909
                } catch (Exception $e) {
910
                    if (self::getConnection()->lastErrorCode() == 19) {
911
                        throw new ValidationException('Unique key violation while trying to save object, SQLite error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
912
                    } else {
913
                        throw new FailedSaveException('Failed to save object, exception ['.$e->getMessage().'], DB error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
914
                    }
915
                }
916
            } else {
917
                throw new FailedSaveException('Failed to save object, exception ['.$e->getMessage().'], DB error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
@@ 916-918 (lines=3) @@
913
                        throw new FailedSaveException('Failed to save object, exception ['.$e->getMessage().'], DB error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
914
                    }
915
                }
916
            } else {
917
                throw new FailedSaveException('Failed to save object, exception ['.$e->getMessage().'], DB error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
918
            }
919
        } else {
920
            // assume that it is a persistent object that needs to be updated
921
            $savedFields = array();
@@ 1087-1089 (lines=3) @@
1084
            $stmt->bindValue(':OID', $this->BO->getOID(), SQLITE3_INTEGER);
1085
1086
            $stmt->execute();
1087
        } else {
1088
            throw new FailedSaveException('Failed to save attribute, error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
1089
        }
1090
1091
        $stmt->close();
1092
@@ 1169-1171 (lines=3) @@
1166
            }
1167
1168
            $stmt->execute();
1169
        } else {
1170
            throw new FailedSaveException('Failed to save object history, error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
1171
        }
1172
    }
1173
1174
    /**
@@ 1193-1195 (lines=3) @@
1190
            $stmt->bindValue(':OID', $this->BO->getOID(), SQLITE3_INTEGER);
1191
            $stmt->execute();
1192
            self::$logger->debug('Deleted the object ['.$this->BO->getOID().'] of class ['.get_class($this->BO).']');
1193
        } else {
1194
            throw new FailedDeleteException('Failed to delete object ['.$this->BO->getOID().'], error is ['.self::getLastDatabaseError().'], query ['.$this->BO->getLastQuery().']');
1195
        }
1196
1197
        $stmt->close();
1198