-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #652 from nextras/join-aggregations-any
Fallback to a simple WHERE filter in simple ANY aggregations
- Loading branch information
Showing
35 changed files
with
266 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Orm\Collection\Aggregations; | ||
|
||
|
||
use Nextras\Dbal\QueryBuilder\QueryBuilder; | ||
use Nextras\Orm\Collection\Expression\ExpressionContext; | ||
use Nextras\Orm\Collection\Functions\Result\DbalExpressionResult; | ||
|
||
|
||
/** | ||
* @template T The type of the aggregation result value. | ||
*/ | ||
interface Aggregator | ||
{ | ||
/** | ||
* Returns a grouping "key" used to join multiple conditions/joins together. | ||
* | ||
* In SQL, it is used as table alias suffix. | ||
* | ||
* @return literal-string | ||
*/ | ||
public function getAggregateKey(): string; | ||
|
||
|
||
/** | ||
* @param array<T> $values | ||
* @return T|null | ||
*/ | ||
public function aggregateValues(array $values); | ||
|
||
|
||
public function aggregateExpression( | ||
QueryBuilder $queryBuilder, | ||
DbalExpressionResult $expression, | ||
ExpressionContext $context, | ||
): DbalExpressionResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Nextras\Orm\Collection\Expression; | ||
|
||
|
||
/** | ||
* @internal | ||
* | ||
* Determines if the expression is processed for AND subtree, OR subtree or pure expression, e.g., a sorting expression. | ||
* OR subtree requires more complex SQL construction, in other modes we may optimize the resulting SQL. | ||
*/ | ||
enum ExpressionContext | ||
{ | ||
case FilterAnd; | ||
case FilterOr; | ||
case ValueExpression; | ||
} |
Oops, something went wrong.