You are here

protected function FieldOverviewController::getEncryptedFieldValueCount in Field Encryption 8.2

Get the number of encrypted field values for a given field on entity type.

Parameters

string $entity_type: The entity type to check.

string $field_name: The field name to check.

Return value

int The number of encrypted field values.

1 call to FieldOverviewController::getEncryptedFieldValueCount()
FieldOverviewController::overview in src/Controller/FieldOverviewController.php
Renders overview page of encrypted fields.

File

src/Controller/FieldOverviewController.php, line 123

Class

FieldOverviewController
Renders encrypted fields overview.

Namespace

Drupal\field_encrypt\Controller

Code

protected function getEncryptedFieldValueCount($entity_type, $field_name) {
  $query = $this->entityTypeManager
    ->getStorage('encrypted_field_value')
    ->getQuery()
    ->condition('entity_type', $entity_type)
    ->condition('field_name', $field_name);
  $values = $query
    ->execute();
  return count($values);
}