You are here

public function CourseEnrollment::label in Course 3.x

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/CourseEnrollment.php, line 384

Class

CourseEnrollment
Defines the profile entity class.

Namespace

Drupal\course\Entity

Code

public function label() {
  return "{$this->getUser()->getDisplayName()}'s enrollment in {$this->getCourse()->getTitle()}";
}