lithium\data\source\http\adapter\CouchDb::calculation()

public method

Executes calculation-related queries, such as those required for count.

Parameters

  • string $type

    Only accepts count.

  • mixed $query

    The query to be executed.

  • array $options

    Optional arguments for the read() query that will be executed to obtain the calculation result.

Returns

integer

Result of the calculation.

Source

	public function calculation($type, $query, array $options = []) {
		switch ($type) {
			case 'count':
				return (integer) $this->read($query, $options)->stats('total_rows');
			default:
				return null;
		}
	}