webCOMAND

repo::query()

Creates a query object to execute a cQL query based on an optional query, options and subsequent query method calls.

New to COMAND queries?  Check out the COMAND API Queries Tutorial.

Prototype

query query(mixed $query, array $options = [])

Parameters

Return

A query object that can be further modified before being executed with one of the get() methods.

For information about query performance and object caching, see Repository Object Cache.

Example

$query = $repo->query("FROM Contact WHERE Name='John'");
$query->select('Name', 'Phone');
$contacts = $query->get();
foreach($contacts as $contact) {
	echo($contact->Name . " - " . $contact->Phone . "\n");
}

Related

get(), execute()