You are here

public function ConsentAgreement::getOwnerId in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_consent/src/Entity/ConsentAgreement.php \Drupal\gdpr_consent\Entity\ConsentAgreement::getOwnerId()
  2. 3.0.x modules/gdpr_consent/src/Entity/ConsentAgreement.php \Drupal\gdpr_consent\Entity\ConsentAgreement::getOwnerId()

Returns the entity owner's user ID.

Return value

int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.

Overrides EntityOwnerInterface::getOwnerId

1 call to ConsentAgreement::getOwnerId()
ConsentAgreement::preSave in modules/gdpr_consent/src/Entity/ConsentAgreement.php
Acts on an entity before the presave hook is invoked.

File

modules/gdpr_consent/src/Entity/ConsentAgreement.php, line 168

Class

ConsentAgreement
Defines the ConsentAgreement entity.

Namespace

Drupal\gdpr_consent\Entity

Code

public function getOwnerId() {
  return $this
    ->get('user_id')->target_id;
}