You are here

public function EntityTraversal::traverse 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::traverse()
  2. 3.0.x modules/gdpr_fields/src/EntityTraversal.php \Drupal\gdpr_fields\EntityTraversal::traverse()

Traverses the entity relationship tree if not done before.

Return value

bool Whether or not the traversal was successful.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides EntityTraversalInterface::traverse

2 calls to EntityTraversal::traverse()
EntityTraversal::getEntities in modules/gdpr_fields/src/EntityTraversal.php
Get the calculated actual calling points.
EntityTraversal::getResults in modules/gdpr_fields/src/EntityTraversal.php
Get the traversal results.

File

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

Class

EntityTraversal
Base class for traversing entities.

Namespace

Drupal\gdpr_fields

Code

public function traverse() {
  if (is_null($this->success)) {
    try {
      $this
        ->traverseEntity($this->baseEntity);
      $this->success = TRUE;
    } catch (\Exception $e) {
      $this->success = FALSE;
    }
  }
  return $this->success;
}