public function CountryListBuilder::buildRow in Country, State and City Fields 8
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.
Return value
array A render array structure of fields for this entity.
Overrides EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
Entity/ Controller/ CountryListBuilder.php, line 88
Class
- CountryListBuilder
- Provides a list controller for countrylist entity.
Namespace
Drupal\country_state_city\Entity\ControllerCode
public function buildRow(EntityInterface $entity) {
$row['id'] = $entity
->id();
$row['name'] = $entity
->label();
$row['iso3'] = $entity->iso3->value;
$row['iso2'] = $entity->iso2->value;
$row['currency'] = $entity->currency->value;
return $row + parent::buildRow($entity);
}