@@ -177,9 +177,8 @@ |
||
| 177 | 177 | * Takes an ID parameter, deletes from the table where the unique ID |
| 178 | 178 | * matches the ID parameter |
| 179 | 179 | * |
| 180 | - * @param integer $id a unique ID from the table |
|
| 181 | 180 | * |
| 182 | - * @return boolean should return true or false based on |
|
| 181 | + * @return boolean|string should return true or false based on |
|
| 183 | 182 | * whether it was deleted or not |
| 184 | 183 | */ |
| 185 | 184 | public static function destroy($fieldId) |
@@ -29,11 +29,11 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | protected static $uniqueId; |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Contains the unique ID value |
|
| 34 | - * |
|
| 35 | - * @var null |
|
| 36 | - */ |
|
| 32 | + /** |
|
| 33 | + * Contains the unique ID value |
|
| 34 | + * |
|
| 35 | + * @var null |
|
| 36 | + */ |
|
| 37 | 37 | protected static $uniqueIdValue = null; |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $result = $getAll->fetchAll(PDO::FETCH_ASSOC); |
| 103 | 103 | |
| 104 | - self::$connection = DatabaseConnection::close(); |
|
| 104 | + self::$connection = DatabaseConnection::close(); |
|
| 105 | 105 | |
| 106 | 106 | return $result; |
| 107 | 107 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (self::$update === false) { |
| 127 | 127 | |
| 128 | 128 | $sqlQuery = "INSERT INTO " . self::getTableName(); |
| 129 | - $sqlQuery .= " (" . implode(", ", array_keys(self::$data)). ")"; |
|
| 129 | + $sqlQuery .= " (" . implode(", ", array_keys(self::$data)) . ")"; |
|
| 130 | 130 | $sqlQuery .= " VALUES (" . self::getDataFieldValues(self::$data) . ") "; |
| 131 | 131 | } else { |
| 132 | 132 | $sqlQuery = "UPDATE " . self::getTableName(); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public static function find($fieldId) |
| 151 | 151 | { |
| 152 | 152 | $sqlQuery = "SELECT * FROM " . self::getTableName(); |
| 153 | - $sqlQuery .= " WHERE " . self::getUniqueId(). " = ". $fieldId; |
|
| 153 | + $sqlQuery .= " WHERE " . self::getUniqueId() . " = " . $fieldId; |
|
| 154 | 154 | |
| 155 | 155 | try { |
| 156 | 156 | $preparedStatement = self::$connection->prepare($sqlQuery); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public static function getTableName() |
| 211 | 211 | { |
| 212 | - if (! isset(static::$table)) { |
|
| 212 | + if (!isset(static::$table)) { |
|
| 213 | 213 | |
| 214 | 214 | $className = new ReflectionClass(new static); |
| 215 | 215 | return strtolower($className->getShortName() . 's'); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public static function getUniqueId() |
| 231 | 231 | { |
| 232 | - if (! isset(static::$uniqueId)) { |
|
| 232 | + if (!isset(static::$uniqueId)) { |
|
| 233 | 233 | return 'id'; |
| 234 | 234 | } |
| 235 | 235 | |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | |
| 115 | 115 | case "pgsql": |
| 116 | 116 | $dsn = "pgsql:host=" . self::$dbConfig['host']; |
| 117 | - $dsn .= ";port=". self::$dbConfig['port'] .";dbname=" . self::$dbConfig['database']; |
|
| 117 | + $dsn .= ";port=" . self::$dbConfig['port'] . ";dbname=" . self::$dbConfig['database']; |
|
| 118 | 118 | break; |
| 119 | 119 | case "sqlite": |
| 120 | 120 | $dsn = "sqlite:" . self::$dbConfig["database"]; |