You are here

public function EntityReference_SelectionHandler_EntityQueue::buildEntityFieldQuery in Entityqueue 7

Overrides EntityReference_SelectionHandler_Generic::buildEntityFieldQuery().

Overrides EntityReference_SelectionHandler_Generic::buildEntityFieldQuery

File

plugins/entityreference/selection/EntityReference_SelectionHandler_EntityQueue.class.php, line 80
Definition of EntityReference_SelectionHandler_EntityQueue.

Class

EntityReference_SelectionHandler_EntityQueue
Defines a Entityreference selection handler for Entityqueue.

Code

public function buildEntityFieldQuery($match = NULL, $match_operator = 'CONTAINS') {

  // Ensure that the 'target_bundles' setting from the field is not used.
  $this->field['settings']['handler_settings']['target_bundles'] = NULL;
  $handler = EntityReference_SelectionHandler_Generic::getInstance($this->field, $this->instance, $this->entity_type, $this->entity);
  $query = $handler
    ->buildEntityFieldQuery($match, $match_operator);
  if (!empty($this->queue->settings['target_bundles'])) {
    $query
      ->entityCondition('bundle', $this->queue->settings['target_bundles'], 'IN');
  }
  return $query;
}