protected function TaxonomyVocabularyController::buildQuery

7.x taxonomy.module protected TaxonomyVocabularyController::buildQuery($ids, $conditions = array(), $revision_id = FALSE)

Builds the query to load the entity.

This has full revision support. For entities requiring special queries, the class can be extended, and the default query can be constructed by calling parent::buildQuery(). This is usually necessary when the object being loaded needs to be augmented with additional data from another table, such as loading node type into comments or vocabulary machine name into terms, however it can also support $conditions on different tables. See CommentController::buildQuery() or TaxonomyTermController::buildQuery() for examples.

Parameters

$ids: An array of entity IDs, or FALSE to load all entities.

$conditions: An array of conditions in the form 'field' => $value.

$revision_id: The ID of the revision to load, or FALSE if this query is asking for the most current revision(s).

Return value

SelectQuery A SelectQuery object for loading the entity.

Overrides DrupalDefaultEntityController::buildQuery

File

drupal-7.x/modules/taxonomy/taxonomy.module, line 1280
Enables the organization of content into categories.

Class

TaxonomyVocabularyController
Controller class for taxonomy vocabularies.

Code

protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
  $query = parent::buildQuery($ids, $conditions, $revision_id);
  $query->addTag('translatable');
  $query->orderBy('base.weight');
  $query->orderBy('base.name');
  return $query;
}