You are here

public function PriceListItemInlineForm::getEntityLabel in Commerce Pricelist 8

Gets the label of the given entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The given entity.

Return value

string The entity label.

Overrides EntityInlineForm::getEntityLabel

File

src/Form/PriceListItemInlineForm.php, line 294

Class

PriceListItemInlineForm
Defines the inline form for product variations.

Namespace

Drupal\commerce_pricelist\Form

Code

public function getEntityLabel(EntityInterface $entity) {
  return is_null($entity
    ->label()) ? empty($entity
    ->getPurchasedEntity()) ? NULL : $entity
    ->getPurchasedEntity()
    ->label() : $entity
    ->label();
}