classes/database/orm.php
/**
	 * Count the number of objects in the database optionally limiting by
	 * certain column values.
	 *
	 * @param array $columns an array of column conditions
	 * @return int
	 */
Count the number of objects in the database optionally limiting by
certain column values.

@param array $columns an array of column conditions
@return int
Count the number of objects in the database optionally limiting by certain column values . @param array $columns an array of column conditions @return int
public function count(array $where = NULL)
	{
		$sql = 'SELECT COUNT(*) FROM "'. $this->name(). '"';
		if($where)
		{
			$sql .= ' WHERE '. implode(' = ? AND ', array_keys($where)). ' = ? ';
		}
		return $this->_db->count($sql, ($where ? array_values($where) : array()));
	}
public function count ( array $ where = NULL ) { $ sql = 'SELECT COUNT(*) FROM "' . $ this -> name ( ) . '"' ; if ( $ where ) { $ sql .= ' WHERE ' . implode ( ' = ? AND ' , array_keys ( $ where ) ) . ' = ? ' ; } return $ this -> _db -> count ( $ sql , ( $ where ? array_values ( $ where ) : array ( ) ) ) ; }
Count the number of objects in the database optionally limiting by
 certain column values.
Count the number of objects in the database optionally limiting by certain column values .
// Add column clauses // Return the objects