@@ -337,7 +337,7 @@ |
||
| 337 | 337 | * |
| 338 | 338 | * Without $primaryKey it creates an entityFetcher and returns this. |
| 339 | 339 | * |
| 340 | - * @param string|Entity $class The entity class you want to fetch |
|
| 340 | + * @param string $class The entity class you want to fetch |
|
| 341 | 341 | * @param mixed $primaryKey The primary key of the entity you want to fetch |
| 342 | 342 | * @return Entity|EntityFetcher |
| 343 | 343 | * @throws IncompletePrimaryKey |
@@ -7,8 +7,6 @@ |
||
| 7 | 7 | use ORM\Exceptions\InvalidConfiguration; |
| 8 | 8 | use ORM\Exceptions\NoConnection; |
| 9 | 9 | use ORM\Exceptions\NoEntity; |
| 10 | -use ORM\Exceptions\NotScalar; |
|
| 11 | -use ORM\Exceptions\UnsupportedDriver; |
|
| 12 | 10 | |
| 13 | 11 | /** |
| 14 | 12 | * The EntityManager that manages the instances of Entities. |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $statement = 'UPDATE ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 192 | - 'SET ' . implode(',', $set) . ' ' . |
|
| 193 | - 'WHERE ' . implode(' AND ', $where); |
|
| 192 | + 'SET ' . implode(',', $set) . ' ' . |
|
| 193 | + 'WHERE ' . implode(' AND ', $where); |
|
| 194 | 194 | $this->em->getConnection()->query($statement); |
| 195 | 195 | |
| 196 | 196 | return true; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $statement = 'DELETE FROM ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 217 | - 'WHERE ' . implode(' AND ', $where); |
|
| 217 | + 'WHERE ' . implode(' AND ', $where); |
|
| 218 | 218 | $this->em->getConnection()->query($statement); |
| 219 | 219 | |
| 220 | 220 | return true; |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | }, array_values($data)); |
| 240 | 240 | |
| 241 | 241 | $statement = 'INSERT INTO ' . $this->escapeIdentifier($entity::getTableName()) . ' ' . |
| 242 | - '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')'; |
|
| 242 | + '(' . implode(',', $cols) . ') VALUES (' . implode(',', $values) . ')'; |
|
| 243 | 243 | |
| 244 | 244 | return $statement; |
| 245 | 245 | } |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | $definition['data_type'] = $this->normalizeType($rawColumn['Type']); |
| 75 | 75 | $definition['column_name'] = $rawColumn['Field']; |
| 76 | 76 | $definition['is_nullable'] = $rawColumn['Null'] === 'YES'; |
| 77 | - $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] : |
|
| 78 | - ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null); |
|
| 77 | + $definition['column_default'] = $rawColumn['Default'] !== null ? $rawColumn['Default'] : ($rawColumn['Extra'] === 'auto_increment' ? 'sequence(AUTO_INCREMENT)' : null); |
|
| 79 | 78 | $definition['character_maximum_length'] = null; |
| 80 | 79 | $definition['datetime_precision'] = null; |
| 81 | 80 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $rawColumns = $result->fetchAll(\PDO::FETCH_ASSOC); |
| 58 | 58 | |
| 59 | 59 | if (count($rawColumns) === 0) { |
| 60 | - throw new Exception('Unknown table ' . $table); |
|
| 60 | + throw new Exception('Unknown table ' . $table); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $hasMultiplePrimaryKey = $this->hasMultiplePrimaryKey($rawColumns); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct($precision = null) |
| 24 | 24 | { |
| 25 | - $this->precision = (int)$precision; |
|
| 25 | + $this->precision = (int) $precision; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function factory($columnDefinition) |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct($maxLength = null) |
| 26 | 26 | { |
| 27 | - $this->maxLength = (int)$maxLength; |
|
| 27 | + $this->maxLength = (int) $maxLength; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public static function factory($columnDefinition) |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $result = $this->em->getConnection()->query($query->getQuery()); |
| 72 | 72 | $rawColumns = $result->fetchAll(PDO::FETCH_ASSOC); |
| 73 | 73 | if (count($rawColumns) === 0) { |
| 74 | - throw new Exception('Unknown table ' . $schemaTable); |
|
| 74 | + throw new Exception('Unknown table ' . $schemaTable); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $cols = array_map(function ($columnDefinition) { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct($precision = null) |
| 24 | 24 | { |
| 25 | - $this->precision = (int)$precision; |
|
| 25 | + $this->precision = (int) $precision; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function factory($columnDefinition) |