You are here

protected function Registration::defaultLabel in Entity Registration 8.2

Same name in this branch
  1. 8.2 lib/registration.entity.inc \Registration::defaultLabel()
  2. 8.2 src/Registration.php \Drupal\registration\Registration::defaultLabel()
Same name and namespace in other branches
  1. 7.2 lib/registration.entity.inc \Registration::defaultLabel()
  2. 7 lib/registration.entity.inc \Registration::defaultLabel()

Specifies the default label, which is picked up by label() by default.

File

lib/registration.entity.inc, line 29
Entity hooks and callbacks for registrations.

Class

Registration
Main class for Registration entities.

Code

protected function defaultLabel() {
  $wrapper = entity_metadata_wrapper('registration', $this);
  $host = $wrapper->entity
    ->value();
  if ($host) {
    return t('Registration for !title', array(
      '!title' => $host
        ->label(),
    ));
  }
  return '';
}