Projection for counting the raw number of resulting rows (using the primary key).
Example:
// SELECT COUNT(entity_id) FROM ... $query = new EntityQuery(Entity::orm()); $query->get(new RowCountProjection()); echo $query->getCell();
Hint: there is a shorthand for counting rows: EntityQuery::getCount()
Definition at line 34 of file RowCountProjection.class.php.

Public Member Functions | |
| __construct ($alias=null) | |
| fill (SelectQuery $selectQuery, EntityQueryBuilder $entityQueryBuilder) | |
| Fills the SelectQuery in context of the specified ORM-related entity. | |
| getFunc () | |
| Gets the name of the aggregates. | |
Protected Member Functions | |
| getSqlFunction (EntityQueryBuilder $entityQueryBuilder) | |
| Create a SQLFunction with the expression as the argument. | |
Protected Attributes | |
| $alias | |
| $expression | |
| RowCountProjection::__construct | ( | $ | alias = null |
) |
| string | $alias optional label for the result of the aggregator |
Definition at line 39 of file RowCountProjection.class.php.
References AggrProjection::$alias.
| CountProjection::fill | ( | SelectQuery $ | selectQuery, | |
| EntityQueryBuilder $ | entityQueryBuilder | |||
| ) | [inherited] |
Fills the SelectQuery in context of the specified ORM-related entity.
Reimplemented from AggrProjection.
Definition at line 45 of file CountProjection.class.php.
References EntityQueryBuilder::getEntity().
| AggrProjection::getFunc | ( | ) | [inherited] |
Gets the name of the aggregates.
Definition at line 50 of file AggrProjection.class.php.
Referenced by DistinctCountProjection::getSqlFunction(), and AggrProjection::getSqlFunction().
| AggrProjection::getSqlFunction | ( | EntityQueryBuilder $ | entityQueryBuilder | ) | [protected, inherited] |
Create a SQLFunction with the expression as the argument.
| EntityQuery | $entityQuery |
Reimplemented in DistinctCountProjection.
Definition at line 66 of file AggrProjection.class.php.
References AggrProjection::getFunc(), and EntityQueryBuilder::subject().
Referenced by AggrProjection::fill().
AggrProjection::$alias [protected, inherited] |
Definition at line 29 of file AggrProjection.class.php.
Referenced by __construct(), CountProjection::__construct(), and AggrProjection::__construct().
AggrProjection::$expression [protected, inherited] |
Definition at line 28 of file AggrProjection.class.php.
Referenced by AggrProjection::__construct().