You are here

public function UserConsentDataPolicyRevision::getValue in Data Policy 8

Gets the value that's supposed to be rendered.

This api exists so that other modules can easy set the values of the field without having the need to change the render method as well.

Parameters

\Drupal\views\ResultRow $values: An object containing all retrieved values.

string $field: Optional name of the field where the value is stored.

Overrides FieldPluginBase::getValue

File

src/Plugin/views/field/UserConsentDataPolicyRevision.php, line 67

Class

UserConsentDataPolicyRevision
A handler to provide proper displays for dates.

Namespace

Drupal\data_policy\Plugin\views\field

Code

public function getValue(ResultRow $values, $field = NULL) {
  $value = parent::getValue($values, $field);
  if (!empty($value)) {
    return $this->entityTypeManager
      ->getStorage('data_policy')
      ->loadRevision($value)
      ->getRevisionCreationTime();
  }
}