You are here

public static function EntityTraversal::create in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_fields/src/EntityTraversal.php \Drupal\gdpr_fields\EntityTraversal::create()
  2. 3.0.x modules/gdpr_fields/src/EntityTraversal.php \Drupal\gdpr_fields\EntityTraversal::create()

Creates an instance of the traversal for this specific entity.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

\Drupal\Core\Entity\EntityInterface $base_entity: The entity to be traversed.

Overrides EntityTraversalContainerInjectionInterface::create

1 method overrides EntityTraversal::create()
RightToBeForgottenEntityTraversal::create in modules/gdpr_tasks/src/Traversal/RightToBeForgottenEntityTraversal.php
Creates an instance of the traversal for this specific entity.

File

modules/gdpr_fields/src/EntityTraversal.php, line 98

Class

EntityTraversal
Base class for traversing entities.

Namespace

Drupal\gdpr_fields

Code

public static function create(ContainerInterface $container, EntityInterface $base_entity) {
  return new static($container
    ->get('entity_type.manager'), $container
    ->get('entity_field.manager'), $base_entity);
}