Skip to content

Commit d0f7031

Browse files
committed
Use alias of read when performing aggregate
1 parent 556ccc5 commit d0f7031

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Resource/ModelAggregation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Simples\Model\Resource;
44

55
use Simples\Data\Record;
6-
use Simples\Model\Error\SimplesActionError;
76
use Simples\Model\ModelAbstract;
87
use Simples\Persistence\Field;
98

@@ -53,7 +52,6 @@ public function max(Record $filter, string $field = null, string $aggregator = n
5352
* @param string $field (null)
5453
* @param array $group (null)
5554
* @return mixed
56-
* @throws SimplesActionError
5755
*/
5856
public function aggregate(Record $filter, string $alias, string $type, string $field = null, array $group = null)
5957
{
@@ -74,7 +72,7 @@ public function aggregate(Record $filter, string $alias, string $type, string $f
7472
->fields($fields)
7573
->limit(null)
7674
->group($group)
77-
->read($filter, $alias, false)
75+
->read($filter, null, false)
7876
->current();
7977

8078
$this->reset();

0 commit comments

Comments
 (0)