function ContactListBuilder::buildRow

Same name in other branches
  1. 3.x modules/content_entity_example/src/Entity/Controller/ContactListBuilder.php \Drupal\content_entity_example\Entity\Controller\ContactListBuilder::buildRow()

Overrides EntityListBuilder::buildRow

File

modules/content_entity_example/src/Entity/Controller/ContactListBuilder.php, line 88

Class

ContactListBuilder
Provides a list controller for content_entity_example entity.

Namespace

Drupal\content_entity_example\Entity\Controller

Code

public function buildRow(EntityInterface $entity) {
    
    /** @var \Drupal\content_entity_example\Entity\Contact $entity */
    $row['id'] = $entity->id();
    $row['name'] = $entity->toLink()
        ->toString();
    $row['first_name'] = $entity->first_name->value;
    $row['role'] = $entity->role->value;
    return $row + parent::buildRow($entity);
}