original_string: public static function count(/* ... */)
  	{
  		$args = func_get_args();
  		$options = static::extractAndValidateOptions($args);
  		$options['select'] = 'COUNT(*)';
  
  		if (!empty($args) && !is_null($args[0]) && !empty($args[0]))
  		{
  			if (is_hash($args[0]))
  				$options['conditions'] = $args[0];
  			else
  				$options['conditions'] = call_user_func_array('static::pk_conditions',$args);
  		}
  
  		$table = static::table();
  		$sql = $table->options_to_sql($options);
  		$values = $sql->get_where_values();
  		return static::connection()->query_and_fetch_one($sql->to_s(),$values);
  	}
code: public static function count(/* ... */)
  	{
  		$args = func_get_args();
  		$options = static::extractAndValidateOptions($args);
  		$options['select'] = 'COUNT(*)';
  
  		if (!empty($args) && !is_null($args[0]) && !empty($args[0]))
  		{
  			if (is_hash($args[0]))
  				$options['conditions'] = $args[0];
  			else
  				$options['conditions'] = call_user_func_array('static::pk_conditions',$args);
  		}
  
  		$table = static::table();
  		$sql = $table->options_to_sql($options);
  		$values = $sql->get_where_values();
  		return static::connection()->query_and_fetch_one($sql->to_s(),$values);
  	}
code_tokens: public static function count ( /* ... */ ) { $ args = func_get_args ( ) ; $ options = static :: extractAndValidateOptions ( $ args ) ; $ options [ 'select' ] = 'COUNT(*)' ; if ( ! empty ( $ args ) && ! is_null ( $ args [ 0 ] ) && ! empty ( $ args [ 0 ] ) ) { if ( is_hash ( $ args [ 0 ] ) ) $ options [ 'conditions' ] = $ args [ 0 ] ; else $ options [ 'conditions' ] = call_user_func_array ( 'static::pk_conditions' , $ args ) ; } $ table = static :: table ( ) ; $ sql = $ table -> options_to_sql ( $ options ) ; $ values = $ sql -> get_where_values ( ) ; return static :: connection ( ) -> query_and_fetch_one ( $ sql -> to_s ( ) , $ values ) ; }
docstring: Get a count of qualifying records.
  
  <code>
  YourModel::count(array('conditions' => 'amount > 3.14159265'));
  </code>
  
  @see find
  @return int Number of records that matched the query
docstring_tokens: Get a count of qualifying records .