1.20.x taxonomy.entity.inc protected TaxonomyTermController::buildQuery($ids, $conditions = array(), $revision_id = FALSE)

Overrides EntityDatabaseStorageController::buildQuery().

Overrides DefaultEntityController::buildQuery

File

modules/taxonomy/taxonomy.entity.inc, line 196
Entity classes and controllers for Taxonomy module.

Class

TaxonomyTermController
Controller class for taxonomy terms.

Code

protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
  $query = parent::buildQuery($ids, $conditions, $revision_id);
  $query->addTag('translatable');
  $query->addTag('taxonomy_term_access');
  // When name is passed as a condition use LIKE.
  if (isset($conditions['name'])) {
    $query_conditions = &$query->conditions();
    foreach ($query_conditions as $key => $condition) {
      if (is_array($condition) && $condition['field'] == 'base.name') {
        $query_conditions[$key]['operator'] = 'LIKE';
        $query_conditions[$key]['value'] = db_like($query_conditions[$key]['value']);
      }
    }
  }
  return $query;
}