You are here

class EntityReference_SelectionHandler_Generic_redhen_contact in RedHen CRM 7

RedHenContact selection handler.

Hierarchy

Expanded class hierarchy of EntityReference_SelectionHandler_Generic_redhen_contact

File

modules/redhen_contact/plugins/selection/RedhenContactSelectionHandler.class.php, line 10
EntityReference extensions for Redhen Contacts.

View source
class EntityReference_SelectionHandler_Generic_redhen_contact extends EntityReference_SelectionHandler_Generic {

  /**
   * Build an EntityFieldQuery to get referencable entities.
   */
  protected function buildEntityFieldQuery($match = NULL, $match_operator = 'CONTAINS') {
    $query = parent::buildEntityFieldQuery($match, $match_operator);

    // Filtering by first and last name. EFQs do not support OR conditions, so
    // a tag is added, which allows the resulting query to be altered. In that
    // query_alter, all of the conditions are added, so they are not set here.
    // See http://drupal.stackexchange.com/questions/14499/using-or-with-entityfieldquery
    // and https://api.drupal.org/api/drupal/includes!database!database.inc/function/db_or/7
    // and http://www.phase2technology.com/blog/or-queries-with-entityfieldquery/.
    $query
      ->addTag('redhen_contact_generic_selection');

    // Add a 'search_string' metadata so the query_alter can easily find the
    // search text.
    $query
      ->addMetaData('search_string', $match);
    return $query;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityReference_SelectionHandler_Generic::countReferencableEntities public function Implements EntityReferenceHandler::countReferencableEntities(). Overrides EntityReference_SelectionHandler::countReferencableEntities
EntityReference_SelectionHandler_Generic::ensureBaseTable public function Ensure a base table exists for the query.
EntityReference_SelectionHandler_Generic::entityFieldQueryAlter public function Implements EntityReferenceHandler::entityFieldQueryAlter(). Overrides EntityReference_SelectionHandler::entityFieldQueryAlter 5
EntityReference_SelectionHandler_Generic::getInstance public static function Implements EntityReferenceHandler::getInstance(). Overrides EntityReference_SelectionHandler::getInstance
EntityReference_SelectionHandler_Generic::getLabel public function Implements EntityReferenceHandler::getLabel(). Overrides EntityReference_SelectionHandler::getLabel 1
EntityReference_SelectionHandler_Generic::getReferencableEntities public function Implements EntityReferenceHandler::getReferencableEntities(). Overrides EntityReference_SelectionHandler::getReferencableEntities 1
EntityReference_SelectionHandler_Generic::reAlterQuery protected function Helper method: pass a query to the alteration system again.
EntityReference_SelectionHandler_Generic::settingsForm public static function Implements EntityReferenceHandler::settingsForm(). Overrides EntityReference_SelectionHandler::settingsForm
EntityReference_SelectionHandler_Generic::validateAutocompleteInput public function Implements EntityReferenceHandler::validateAutocompleteInput(). Overrides EntityReference_SelectionHandler::validateAutocompleteInput
EntityReference_SelectionHandler_Generic::validateReferencableEntities public function Implements EntityReferenceHandler::validateReferencableEntities(). Overrides EntityReference_SelectionHandler::validateReferencableEntities
EntityReference_SelectionHandler_Generic::__construct protected function
EntityReference_SelectionHandler_Generic_redhen_contact::buildEntityFieldQuery protected function Build an EntityFieldQuery to get referencable entities. Overrides EntityReference_SelectionHandler_Generic::buildEntityFieldQuery