You are here

public function Profile::label in Profile 2 8

Gets the label of the entity.

Return value

string|null The label of the entity, or NULL if there is no label defined.

Overrides ContentEntityBase::label

File

src/Entity/Profile.php, line 133
Contains \Drupal\profile\Entity\Profile.

Class

Profile
Defines the profile entity class.

Namespace

Drupal\profile\Entity

Code

public function label() {
  $profile_type = ProfileType::load($this
    ->bundle());
  return t('@type profile of @username (uid: @uid)', array(
    '@type' => $profile_type
      ->label(),
    '@username' => $this
      ->getOwner()
      ->getUsername(),
    '@uid' => $this
      ->getOwnerId(),
  ));
}