- ⌂ collection
- Methods
collection::get()
Return all objects in the collection that match the specified query. This is useful to refine a collection of objects down based on a query.
New to COMAND queries? Check out the COMAND API Queries Tutorial.
Prototype
collection get(mixed $query, array $options = [])
Parameters
- query - cPath string, cQL string, Query Object or cQL Array.
- options - Associative array of options with the following keys.
- bind - Array of variables to bind to the query. If the binding is a question mark (?), the array index is an index to the question mark (first question mark is represented by index zero, etc.). If the binding is a named binding (ie. :Name), the array index is the binding name.
Example
$objects = $collection->get("WHERE Identifier LIKE '%System%'");
foreach($objects as $object) {
echo("$object\n");
}