src/Database/QueryBuilder.php
/**
	 * Runs the query and returns the number of rows.
	 *
	 * @return int
	 */
Runs the query and returns the number of rows.
@return int
Runs the query and returns the number of rows . @return int
public function count() {
		if (!($this->command instanceof Select)) {
			return null;
		}
		$this->columns('COUNT(*)');
		$this->setModel(null);
		$results = $this->database->query($this->compile(), $this->getParameters());
		$row = array_shift($results);
		return $row->{'COUNT(*)'};
	}
public function count ( ) { if ( ! ( $ this -> command instanceof Select ) ) { return null ; } $ this -> columns ( 'COUNT(*)' ) ; $ this -> setModel ( null ) ; $ results = $ this -> database -> query ( $ this -> compile ( ) , $ this -> getParameters ( ) ) ; $ row = array_shift ( $ results ) ; return $ row -> { 'COUNT(*)' } ; }
Runs the query and returns the number of rows.
Runs the query and returns the number of rows .