Open Data Catalog v2.0.0
Drupal\common\Storage\Query Class Reference
Inheritance diagram for Drupal\common\Storage\Query:

Public Member Functions

 setCollectionToRetrieve ($id)
 filterByProperty ($property)
 conditionByIsEqualTo (string $property, string $value)
 limitTo (int $number_of_items)
 offsetBy (int $offset)
 sortByAscending (string $property)
 sortByDescending (string $property)
 count ()

Public Attributes

 $properties = []
 $conditions = []
 $sorts = []
 $joins = []
 $limit = 500
 $offset = 0
 $count = FALSE
 $showDbColumns = FALSE

Detailed Description

Query class.

Definition at line 13 of file Query.php.

Member Function Documentation

◆ conditionByIsEqualTo()

Drupal\common\Storage\Query::conditionByIsEqualTo ( string  $property,
string  $value 

Retrieve only objects with properties of certain values.

string$propertyProperty to filter on.
string$valueProperty value to filter against.

Definition at line 123 of file Query.php.

◆ count()

Drupal\common\Storage\Query::count ( )

Mark query as a count query.

Note - for now, leaves limit/offset alone.

Definition at line 182 of file Query.php.

◆ filterByProperty()

Drupal\common\Storage\Query::filterByProperty (   $property)

Add a single property to the properties being retrieved.

string$propertyThe name of a property, such as a column from a db table.

Definition at line 111 of file Query.php.

◆ limitTo()

Drupal\common\Storage\Query::limitTo ( int  $number_of_items)

Set the maximum number of records to return.

int$number_of_itemsNumber of items.

Definition at line 137 of file Query.php.

◆ offsetBy()

Drupal\common\Storage\Query::offsetBy ( int  $offset)

Offset where we start getting records.

int$offsetNumber of records to offset by before retrieving.

Definition at line 147 of file Query.php.

◆ setCollectionToRetrieve()

Drupal\common\Storage\Query::setCollectionToRetrieve (   $id)

Set the identifier of what is being retrieved.

string$idIdentifier of collection. When working with an SQL database, this would be the table name.

Definition at line 101 of file Query.php.

◆ sortByAscending()

Drupal\common\Storage\Query::sortByAscending ( string  $property)

Sort records by the given property in ascending order.

string$propertyProperty to sort by in ascending order.

Definition at line 157 of file Query.php.

◆ sortByDescending()

Drupal\common\Storage\Query::sortByDescending ( string  $property)

Sort records by the given property in descending order.

string$propertyProperty to sort by in descending order.

Definition at line 170 of file Query.php.

Member Data Documentation

◆ $collection


Definition at line 24 of file Query.php.

◆ $conditions

Drupal\common\Storage\Query::$conditions = []

Definition at line 44 of file Query.php.

◆ $count

Drupal\common\Storage\Query::$count = FALSE

Definition at line 85 of file Query.php.

◆ $joins

Drupal\common\Storage\Query::$joins = []

Definition at line 64 of file Query.php.

◆ $limit

Drupal\common\Storage\Query::$limit = 500

Definition at line 71 of file Query.php.

◆ $offset

Drupal\common\Storage\Query::$offset = 0

Definition at line 78 of file Query.php.

◆ $properties

Drupal\common\Storage\Query::$properties = []

Definition at line 31 of file Query.php.

◆ $showDbColumns

Drupal\common\Storage\Query::$showDbColumns = FALSE

Definition at line 92 of file Query.php.

◆ $sorts

Drupal\common\Storage\Query::$sorts = []

Definition at line 53 of file Query.php.