You are here

class ApigeeActionsEntityTypeHelper in Apigee Edge 8

Defines the apigee_edge_actions.edge_entity_type_manager service.

Hierarchy

Expanded class hierarchy of ApigeeActionsEntityTypeHelper

1 string reference to 'ApigeeActionsEntityTypeHelper'
apigee_edge_actions.services.yml in modules/apigee_edge_actions/apigee_edge_actions.services.yml
modules/apigee_edge_actions/apigee_edge_actions.services.yml
1 service uses ApigeeActionsEntityTypeHelper
apigee_edge_actions.edge_entity_type_manager in modules/apigee_edge_actions/apigee_edge_actions.services.yml
Drupal\apigee_edge_actions\ApigeeActionsEntityTypeHelper

File

modules/apigee_edge_actions/src/ApigeeActionsEntityTypeHelper.php, line 30

Namespace

Drupal\apigee_edge_actions
View source
class ApigeeActionsEntityTypeHelper implements ApigeeActionsEntityTypeHelperInterface {

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * ApigeeAppEntityTypeManager constructor.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function getEntityTypes() : array {
    return array_filter($this->entityTypeManager
      ->getDefinitions(), function (EntityTypeInterface $entity_type) {
      return $this
        ->isFieldableEdgeEntityType($entity_type);
    });
  }

  /**
   * {@inheritdoc}
   */
  public function isFieldableEdgeEntityType(EntityTypeInterface $entity_type) : bool {
    return $entity_type
      ->entityClassImplements(FieldableEdgeEntityInterface::class);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ApigeeActionsEntityTypeHelper::$entityTypeManager protected property The entity type manager.
ApigeeActionsEntityTypeHelper::getEntityTypes public function Returns an array of Apigee Edge entity types. Overrides ApigeeActionsEntityTypeHelperInterface::getEntityTypes
ApigeeActionsEntityTypeHelper::isFieldableEdgeEntityType public function Determines if the given entity type is a fieldable Edge entity type. Overrides ApigeeActionsEntityTypeHelperInterface::isFieldableEdgeEntityType
ApigeeActionsEntityTypeHelper::__construct public function ApigeeAppEntityTypeManager constructor.