@@ -64,8 +64,7 @@ discard block |
||
| 64 | 64 | * @class EntityQuery |
| 65 | 65 | * @package Platine\Orm\Query |
| 66 | 66 | */ |
| 67 | -class EntityQuery extends Query |
|
| 68 | -{ |
|
| 67 | +class EntityQuery extends Query { |
|
| 69 | 68 | /** |
| 70 | 69 | * |
| 71 | 70 | * @var EntityManager |
@@ -330,8 +329,7 @@ discard block |
||
| 330 | 329 | * @param string|Expression|Closure $column |
| 331 | 330 | * @return mixed |
| 332 | 331 | */ |
| 333 | - public function column($column) |
|
| 334 | - { |
|
| 332 | + public function column($column) { |
|
| 335 | 333 | (new ColumnExpression($this->queryStatement))->column($column); |
| 336 | 334 | |
| 337 | 335 | return $this->executeAggregate(); |
@@ -343,8 +341,7 @@ discard block |
||
| 343 | 341 | * @param bool $distinct |
| 344 | 342 | * @return mixed |
| 345 | 343 | */ |
| 346 | - public function count($column = '*', bool $distinct = false) |
|
| 347 | - { |
|
| 344 | + public function count($column = '*', bool $distinct = false) { |
|
| 348 | 345 | (new ColumnExpression($this->queryStatement))->count($column, null, $distinct); |
| 349 | 346 | |
| 350 | 347 | return $this->executeAggregate(); |
@@ -356,8 +353,7 @@ discard block |
||
| 356 | 353 | * @param bool $distinct |
| 357 | 354 | * @return mixed |
| 358 | 355 | */ |
| 359 | - public function avg($column, bool $distinct = false) |
|
| 360 | - { |
|
| 356 | + public function avg($column, bool $distinct = false) { |
|
| 361 | 357 | (new ColumnExpression($this->queryStatement))->avg($column, null, $distinct); |
| 362 | 358 | |
| 363 | 359 | return $this->executeAggregate(); |
@@ -369,8 +365,7 @@ discard block |
||
| 369 | 365 | * @param bool $distinct |
| 370 | 366 | * @return mixed |
| 371 | 367 | */ |
| 372 | - public function sum($column, bool $distinct = false) |
|
| 373 | - { |
|
| 368 | + public function sum($column, bool $distinct = false) { |
|
| 374 | 369 | (new ColumnExpression($this->queryStatement))->sum($column, null, $distinct); |
| 375 | 370 | |
| 376 | 371 | return $this->executeAggregate(); |
@@ -382,8 +377,7 @@ discard block |
||
| 382 | 377 | * @param bool $distinct |
| 383 | 378 | * @return mixed |
| 384 | 379 | */ |
| 385 | - public function min($column, bool $distinct = false) |
|
| 386 | - { |
|
| 380 | + public function min($column, bool $distinct = false) { |
|
| 387 | 381 | (new ColumnExpression($this->queryStatement))->min($column, null, $distinct); |
| 388 | 382 | |
| 389 | 383 | return $this->executeAggregate(); |
@@ -395,8 +389,7 @@ discard block |
||
| 395 | 389 | * @param bool $distinct |
| 396 | 390 | * @return mixed |
| 397 | 391 | */ |
| 398 | - public function max($column, bool $distinct = false) |
|
| 399 | - { |
|
| 392 | + public function max($column, bool $distinct = false) { |
|
| 400 | 393 | (new ColumnExpression($this->queryStatement))->max($column, null, $distinct); |
| 401 | 394 | |
| 402 | 395 | return $this->executeAggregate(); |
@@ -405,8 +398,7 @@ discard block |
||
| 405 | 398 | /** |
| 406 | 399 | * Clone of object |
| 407 | 400 | */ |
| 408 | - public function __clone() |
|
| 409 | - { |
|
| 401 | + public function __clone() { |
|
| 410 | 402 | parent::__clone(); |
| 411 | 403 | $this->havingStatement = new HavingStatement($this->queryStatement); |
| 412 | 404 | } |
@@ -495,8 +487,7 @@ discard block |
||
| 495 | 487 | * Execute the aggregate |
| 496 | 488 | * @return mixed |
| 497 | 489 | */ |
| 498 | - protected function executeAggregate() |
|
| 499 | - { |
|
| 490 | + protected function executeAggregate() { |
|
| 500 | 491 | $this->queryStatement->addTables([$this->mapper->getTable()]); |
| 501 | 492 | |
| 502 | 493 | if ($this->mapper->hasSoftDelete()) { |
@@ -531,8 +522,7 @@ discard block |
||
| 531 | 522 | * |
| 532 | 523 | * @return mixed |
| 533 | 524 | */ |
| 534 | - protected function transaction(Closure $callback) |
|
| 535 | - { |
|
| 525 | + protected function transaction(Closure $callback) { |
|
| 536 | 526 | return $this->manager->getConnection() |
| 537 | 527 | ->transaction($callback); |
| 538 | 528 | } |