@@ -331,14 +331,14 @@ |
||
| 331 | 331 | public function getQuery() |
| 332 | 332 | { |
| 333 | 333 | return 'SELECT ' |
| 334 | - . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '') |
|
| 335 | - . ($this->columns ? implode(',', $this->columns) : '*') |
|
| 336 | - . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '') |
|
| 337 | - . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '') |
|
| 338 | - . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '') |
|
| 339 | - . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '') |
|
| 340 | - . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '') |
|
| 341 | - . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : ''); |
|
| 334 | + . (!empty($this->modifier) ? implode(' ', $this->modifier) . ' ' : '') |
|
| 335 | + . ($this->columns ? implode(',', $this->columns) : '*') |
|
| 336 | + . ' FROM ' . $this->tableName . ($this->alias ? ' AS ' . $this->alias : '') |
|
| 337 | + . (!empty($this->joins) ? ' ' . implode(' ', $this->joins) : '') |
|
| 338 | + . (!empty($this->where) ? ' WHERE ' . implode(' ', $this->where) : '') |
|
| 339 | + . (!empty($this->groupBy) ? ' GROUP BY ' . implode(',', $this->groupBy) : '') |
|
| 340 | + . (!empty($this->orderBy) ? ' ORDER BY ' . implode(',', $this->orderBy) : '') |
|
| 341 | + . ($this->limit ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : ''); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | /** {@inheritdoc} */ |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | $statement = 'INSERT INTO ' . $table . ' (' . implode(',', $cols) . ') ' . |
| 143 | - 'VALUES (' . implode('),(', $associations) . ')'; |
|
| 143 | + 'VALUES (' . implode('),(', $associations) . ')'; |
|
| 144 | 144 | $entityManager->getConnection()->query($statement); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $where[] = $entityManager->escapeIdentifier($fkCol) . ' = ' . |
| 165 | - $entityManager->escapeValue($value); |
|
| 165 | + $entityManager->escapeValue($value); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | foreach ($entities as $entity) { |
@@ -179,13 +179,13 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $condition[] = $entityManager->escapeIdentifier($fkCol) . ' = ' . |
| 182 | - $entityManager->escapeValue($value); |
|
| 182 | + $entityManager->escapeValue($value); |
|
| 183 | 183 | } |
| 184 | 184 | $where[] = implode(' AND ', $condition); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | $statement = 'DELETE FROM ' . $table . ' WHERE ' . array_shift($where) . ' ' . |
| 188 | - 'AND (' . implode(' OR ', $where) . ')'; |
|
| 188 | + 'AND (' . implode(' OR ', $where) . ')'; |
|
| 189 | 189 | $entityManager->getConnection()->query($statement); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -297,7 +297,7 @@ |
||
| 297 | 297 | $this->columns = ['t0.*']; |
| 298 | 298 | $this->modifier = ['DISTINCT']; |
| 299 | 299 | |
| 300 | - return (int)$this->entityManager->getConnection()->query($query)->fetchColumn(); |
|
| 300 | + return (int) $this->entityManager->getConnection()->query($query)->fetchColumn(); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -601,7 +601,7 @@ |
||
| 601 | 601 | if (!empty($var)) { |
| 602 | 602 | $col = static::getColumnName($var); |
| 603 | 603 | return (isset($this->data[$col]) ? $this->data[$col] : null) !== |
| 604 | - (isset($this->originalData[$col]) ? $this->originalData[$col] : null); |
|
| 604 | + (isset($this->originalData[$col]) ? $this->originalData[$col] : null); |
|
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | ksort($this->data); |
@@ -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. |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | * |
| 389 | 389 | * @param Entity $entity |
| 390 | 390 | * @param bool $useAutoIncrement |
| 391 | - * @return mixed |
|
| 391 | + * @return boolean |
|
| 392 | 392 | * @internal |
| 393 | 393 | */ |
| 394 | 394 | public function insert(Entity $entity, $useAutoIncrement = true) |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | * |
| 462 | 462 | * Without $primaryKey it creates an entityFetcher and returns this. |
| 463 | 463 | * |
| 464 | - * @param string|Entity $class The entity class you want to fetch |
|
| 464 | + * @param string $class The entity class you want to fetch |
|
| 465 | 465 | * @param mixed $primaryKey The primary key of the entity you want to fetch |
| 466 | 466 | * @return Entity|EntityFetcher |
| 467 | 467 | * @throws IncompletePrimaryKey |
@@ -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); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | - * @return \string[] |
|
| 49 | + * @return string[] |
|
| 50 | 50 | */ |
| 51 | 51 | public function getAllowedValues() |
| 52 | 52 | { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($maxLength = null) |
| 27 | 27 | { |
| 28 | - $this->maxLength = (int)$maxLength; |
|
| 28 | + $this->maxLength = (int) $maxLength; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function factory(Dbal $dbal, array $columnDefinition) |
@@ -31,10 +31,9 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct($precision = null, $dateOnly = false) |
| 33 | 33 | { |
| 34 | - $this->precision = (int)$precision; |
|
| 34 | + $this->precision = (int) $precision; |
|
| 35 | 35 | $this->regex = $dateOnly ? |
| 36 | - '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : |
|
| 37 | - '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 36 | + '/^' . self::DATE_REGEX . '([ T]' . self::TIME_REGEX . self::ZONE_REGEX . ')?$/' : '/^' . self::DATE_REGEX . '[ T]' . self::TIME_REGEX . self::ZONE_REGEX . '$/'; |
|
| 38 | 37 | } |
| 39 | 38 | |
| 40 | 39 | public static function factory(Dbal $dbal, array $columnDefinition) |