You are here

public function DataPolicyConsentManager::getExistingUserConsents in Data Policy 8

Get existing user consents.

Parameters

int $user_id: The user ID.

Return value

array The array of existing consents.

Overrides DataPolicyConsentManagerInterface::getExistingUserConsents

File

src/DataPolicyConsentManager.php, line 333

Class

DataPolicyConsentManager
Defines the Data Policy Consent Manager service.

Namespace

Drupal\data_policy

Code

public function getExistingUserConsents($user_id) {
  return $this->entityTypeManager
    ->getStorage('user_consent')
    ->getQuery()
    ->condition('status', 1)
    ->condition('user_id', $user_id)
    ->execute();
}