Skip to content

Commit

Permalink
count condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mvkasatkin committed Oct 2, 2017
1 parent 320b57f commit 06cc05e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/entity/AbstractEntityRepositoryDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public function findAll(Condition $condition = null): array
}

/**
* @param Condition $condition
* @param Condition|null $condition
* @return int
*/
public function count(Condition $condition): int
public function count(Condition $condition = null): int
{
$select = $this->selectQuery($condition);
return $select->select(['t1.id'])->execute()->rowCount();
Expand Down
4 changes: 2 additions & 2 deletions src/entity/AbstractEntityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public function findAll(Condition $condition = null): array

/**
* Proxy method
* @param Condition $condition
* @param Condition|null $condition
* @return int
*/
public function count(Condition $condition): int
public function count(Condition $condition = null): int
{
return $this->repository->count($condition);
}
Expand Down
4 changes: 2 additions & 2 deletions src/entity/EntityRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function findOne(Condition $condition);
public function findAll(Condition $condition = null): array;

/**
* @param Condition $condition
* @param Condition|null $condition
* @return int
*/
public function count(Condition $condition): int;
public function count(Condition $condition = null): int;

/**
* @param AbstractEntity $item
Expand Down

0 comments on commit 06cc05e

Please sign in to comment.