StateSelection.php in Booking and Availability Management Tools for Drupal 8
File
modules/bat_event/src/Plugin/EntityReferenceSelection/StateSelection.php
View source
<?php
namespace Drupal\bat_event\Plugin\EntityReferenceSelection;
use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection;
class StateSelection extends DefaultSelection {
protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
$config = $this->configuration;
$query = parent::buildEntityQuery($match, $match_operator);
if ($event_type_bundle = $config['handler_settings']['event_type_bundle']) {
$query
->condition('event_type', $event_type_bundle, '=');
}
return $query;
}
}