src/DB/PDO/TableReader.php
public function count( $conditions = array() )
	{
		$conditions	= $this->getConditionQuery( $conditions, FALSE, TRUE, TRUE );					//  render WHERE clause if needed, foreign cursored, allow functions
		$conditions	= $conditions ? ' WHERE '.$conditions : '';
		$query	= 'SELECT COUNT(`%s`) as count FROM %s%s';
		$query	= sprintf( $query, $this->primaryKey, $this->getTableName(), $conditions );
		return (int) $this->dbc->query( $query )->fetch( \PDO::FETCH_OBJ )->count;
	}
public function count( $conditions = array() )
	{
		$conditions	= $this->getConditionQuery( $conditions, FALSE, TRUE, TRUE );					//  render WHERE clause if needed, foreign cursored, allow functions
		$conditions	= $conditions ? ' WHERE '.$conditions : '';
		$query	= 'SELECT COUNT(`%s`) as count FROM %s%s';
		$query	= sprintf( $query, $this->primaryKey, $this->getTableName(), $conditions );
		return (int) $this->dbc->query( $query )->fetch( \PDO::FETCH_OBJ )->count;
	}
public function count ( $ conditions = array ( ) ) { $ conditions = $ this -> getConditionQuery ( $ conditions , FALSE , TRUE , TRUE ) ; //  render WHERE clause if needed, foreign cursored, allow functions $ conditions = $ conditions ? ' WHERE ' . $ conditions : '' ; $ query = 'SELECT COUNT(`%s`) as count FROM %s%s' ; $ query = sprintf ( $ query , $ this -> primaryKey , $ this -> getTableName ( ) , $ conditions ) ; return ( int ) $ this -> dbc -> query ( $ query ) -> fetch ( \ PDO :: FETCH_OBJ ) -> count ; }
Returns count of all entries of this table covered by conditions.
@access		public
@param		array		$conditions		Map of columns and values to filter by
@return		integer
Returns count of all entries of this table covered by conditions .