You are here

protected function EntityField::getEntityFieldCompareType in Entity Field Condition 2.0.x

Get entity field compare type instance.

Return value

\Drupal\entity_field_condition\Contracts\EntityFieldCompareTypeInterface|null The entity field compare type instance.

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to EntityField::getEntityFieldCompareType()
EntityField::evaluate in src/Plugin/Condition/EntityField.php
Evaluates the condition and returns TRUE or FALSE accordingly.

File

src/Plugin/Condition/EntityField.php, line 605

Class

EntityField
Define the entity field condition base class.

Namespace

Drupal\entity_field_condition\Plugin\Condition

Code

protected function getEntityFieldCompareType() : ?EntityFieldCompareTypeInterface {
  $compare_type_id = $this
    ->getConfigurationEntity()['compare_type'] ?? NULL;
  if (!isset($compare_type_id)) {
    return NULL;
  }
  return $this->entityFieldCompareTypeManager
    ->createInstance($compare_type_id, $this
    ->getCompareTypeConfigurations());
}