You are here

public function UserConsent::label in Data Policy 8

Override of the default label() function to return a human-friendly name.

Return value

\Drupal\Component\Render\MarkupInterface|mixed|string|null

Overrides ContentEntityBase::label

File

src/Entity/UserConsent.php, line 196

Class

UserConsent
Defines the User consent entity.

Namespace

Drupal\data_policy\Entity

Code

public function label() {
  $user = $this
    ->getOwner();
  if ($user && $user
    ->getDisplayName()) {
    return $user
      ->getDisplayName();
  }
  return '';
}