class AllExceptHostEntity
Same name in other branches
- 10 core/modules/system/tests/modules/entity_reference_test/src/Plugin/EntityReferenceSelection/AllExceptHostEntity.php \Drupal\entity_reference_test\Plugin\EntityReferenceSelection\AllExceptHostEntity
Allows access to all entities except for the host entity.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface, \Drupal\Component\Plugin\ConfigurableInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection extends \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface
- class \Drupal\entity_reference_test\Plugin\EntityReferenceSelection\AllExceptHostEntity extends \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection
- class \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection extends \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface
- class \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface, \Drupal\Component\Plugin\ConfigurableInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of AllExceptHostEntity
File
-
core/
modules/ system/ tests/ modules/ entity_reference_test/ src/ Plugin/ EntityReferenceSelection/ AllExceptHostEntity.php, line 14
Namespace
Drupal\entity_reference_test\Plugin\EntityReferenceSelectionView source
class AllExceptHostEntity extends DefaultSelection {
/**
* {@inheritdoc}
*/
protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
$query = parent::buildEntityQuery($match, $match_operator);
/** @var \Drupal\Core\Entity\EntityInterface $entity */
if ($entity = $this->configuration['entity']) {
$target_type = $this->configuration['target_type'];
$entity_type = $this->entityTypeManager
->getDefinition($target_type);
$query->condition($entity_type->getKey('id'), $entity->id(), '<>');
}
return $query;
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.