samples/PhotoAlbum/lib/rb.php
public function count($type,$addSQL='',$params=array()) {
		try {
			return (int) $this->writer->count($type,$addSQL,$params);
		}catch(RedBean_Exception_SQL $e) {
			if (!$this->writer->sqlStateIn($e->getSQLState(),
			array(RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_TABLE)
			)) throw $e;
		}
		return 0;
	}
public function count($type,$addSQL='',$params=array()) {
		try {
			return (int) $this->writer->count($type,$addSQL,$params);
		}catch(RedBean_Exception_SQL $e) {
			if (!$this->writer->sqlStateIn($e->getSQLState(),
			array(RedBean_QueryWriter::C_SQLSTATE_NO_SUCH_TABLE)
			)) throw $e;
		}
		return 0;
	}
public function count ( $ type , $ addSQL = '' , $ params = array ( ) ) { try { return ( int ) $ this -> writer -> count ( $ type , $ addSQL , $ params ) ; } catch ( RedBean_Exception_SQL $ e ) { if ( ! $ this -> writer -> sqlStateIn ( $ e -> getSQLState ( ) , array ( RedBean_QueryWriter :: C_SQLSTATE_NO_SUCH_TABLE ) ) ) throw $ e ; } return 0 ; }
Returns the number of beans we have in DB of a given type.

@param string $type   type of bean we are looking for
@param string $addSQL additional SQL snippet
@param array  $params parameters to bind to SQL

@return integer $num number of beans found
Returns the number of beans we have in DB of a given type .