ConnectionRoleSelection.php in RedHen CRM 8
File
modules/redhen_connection/src/Plugin/EntityReferenceSelection/ConnectionRoleSelection.php
View source
<?php
namespace Drupal\redhen_connection\Plugin\EntityReferenceSelection;
use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection;
class ConnectionRoleSelection extends DefaultSelection {
protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
$query = parent::buildEntityQuery($match, $match_operator);
if (isset($this->configuration['handler_settings']['connection_type'])) {
$connection_type = $this->configuration['handler_settings']['connection_type'];
$query
->condition('connection_type', $connection_type, '=');
}
return $query;
}
}