You are here

public function ProfileResolver::resolve in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_consent/src/Plugin/Gdpr/ConsentUserResolver/ProfileResolver.php \Drupal\gdpr_consent\Plugin\Gdpr\ConsentUserResolver\ProfileResolver::resolve()
  2. 3.0.x modules/gdpr_consent/src/Plugin/Gdpr/ConsentUserResolver/ProfileResolver.php \Drupal\gdpr_consent\Plugin\Gdpr\ConsentUserResolver\ProfileResolver::resolve()

Gets the user reference from the specified entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to use when finding the user.

Return value

\Drupal\user\Entity\User The user

Overrides GdprConsentUserResolverInterface::resolve

File

modules/gdpr_consent/src/Plugin/Gdpr/ConsentUserResolver/ProfileResolver.php, line 23

Class

ProfileResolver
Resolves user reference for a Profile entity.

Namespace

Drupal\gdpr_consent\Plugin\Gdpr\ConsentUserResolver

Code

public function resolve(EntityInterface $entity) {
  return $entity->uid->entity;
}