public Entity::label()
Gets the label of the entity.
Return value
string|null The label of the entity, or NULL if there is no label defined.
Overrides EntityInterface::label
File
- core/lib/Drupal/Core/Entity/Entity.php, line 155
Class
- Entity
- Defines a base entity class.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 | public function label() { $label = NULL; $entity_type = $this ->getEntityType(); if (( $label_callback = $entity_type ->getLabelCallback()) && is_callable ( $label_callback )) { $label = call_user_func( $label_callback , $this ); } elseif (( $label_key = $entity_type ->getKey( 'label' )) && isset( $this ->{ $label_key })) { $label = $this ->{ $label_key }; } return $label ; } |
Please login to continue.