public function OrganigramsListBuilder::buildRow in Organigrams 8
Same name and namespace in other branches
- 8.2 src/OrganigramsListBuilder.php \Drupal\organigrams\OrganigramsListBuilder::buildRow()
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 VocabularyListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
OrganigramsListBuilder.php, line 18
Class
- OrganigramsListBuilder
- Defines a class to highlight organigram vocabularies.
Namespace
Drupal\organigramsCode
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
// Add a prefix if the taxonomy has organigrams settings.
if (!empty($entity
->getThirdPartySettings('organigrams'))) {
$row['label'] = $this
->t('Organigram:') . ' ' . $row['label'];
}
$row['description']['data'] = [
'#markup' => $entity
->getDescription(),
];
return $row + parent::buildRow($entity);
}