You are here

public function GdprField::includeRelatedEntities in General Data Protection Regulation 8

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

Whether to recurse to entities included in this property.

File

modules/gdpr_fields/src/Entity/GdprField.php, line 219

Class

GdprField
Metadata for a GDPR field.

Namespace

Drupal\gdpr_fields\Entity

Code

public function includeRelatedEntities() {

  // If not explicitly a GDPR field, don't recurse.
  if (!$this->enabled) {
    return FALSE;
  }

  // If the field is an owner, don't recurse.
  if ($this
    ->isOwner()) {
    return FALSE;
  }

  // Only follow the relationship if it's been explicitly enabled.
  if ($this
    ->followRelationship()) {
    return TRUE;
  }
  return FALSE;
}