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()
  2. 4.0.x modules/content_entity_example/src/Entity/Controller/ContactListBuilder.php \Drupal\content_entity_example\Entity\Controller\ContactListBuilder::buildRow()

File

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 $entity \Drupal\content_entity_example\Entity\Contact */
    $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);
}