- ⌂ query
- Methods
query::from()
Add one or more content types to the query FROM clause. The from method takes any number of content type parameters. Each parameter may be a string that represents the content type identifier, or a content type object, or an array of either.
Prototype
from(mixed $content_types): query
Parameters
- content_types - The identifier followed by an optional '+' of one or more content types to query, in one of the following forms. If a '+' appears immediately after the last character of the content type identifier, the content type and all content types that extend it will be queried.
- String - a full or partial comma-separated cQL FROM clause.
- Array - an array of individual content type identifiers to query.
- Multiple Parameters - Instead of passing a single array of content types, each content type can be passed as a separate parameter.
Return
The updated query object is returned. This is handy for chaining additional methods.
Example
// simple query with FROM clause
$query = $repo->query();
$query->from('Contact');
// similar to query above, except with two content types
$query = $repo->query();
$query->from('Contact', 'Employees');
// similar to query above, except for content type and all that extend it
$query = $repo->query();
$query->from('Contact+');