You are here

public function OgMenuInstance::label in Organic Groups Menu (OG Menu) 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/OgMenuInstance.php, line 130
Contains \Drupal\og_menu\Entity\OgMenuInstance.

Class

OgMenuInstance
Defines the OG Menu instance entity.

Namespace

Drupal\og_menu\Entity

Code

public function label() {
  $target_label = $this
    ->getFieldTargetTypeLabel();

  // Use the label of the menu as the instance name.
  return $target_label ? $target_label : OgMenu::load($this
    ->getType())
    ->label();
}