public function MaestroTemplateListBuilder::buildRow in Maestro 8.2
Same name and namespace in other branches
- 3.x src/Controller/MaestroTemplateListBuilder.php \Drupal\maestro\Controller\MaestroTemplateListBuilder::buildRow()
Builds a row for an entity in the entity listing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for which to build the row.
Return value
array A render array of the table row for displaying the entity.
Overrides EntityListBuilder::buildRow
See also
Drupal\Core\Entity\EntityListController::render()
File
- src/
Controller/ MaestroTemplateListBuilder.php, line 43
Class
- MaestroTemplateListBuilder
- Provides a listing of Maestro Template entities.
Namespace
Drupal\maestro\ControllerCode
public function buildRow(EntityInterface $entity) {
$valid = FALSE;
$validity_message = '<span class="maestro-template-validation-failed">(*' . $this
->t('Needs Validation') . ')</span>';
if (isset($entity->validated) && $entity->validated == TRUE) {
$validity_message = '';
}
$row['label'] = [
'data' => [
'#markup' => $entity
->label() . $validity_message,
],
];
$row['machine_name'] = $entity
->id();
$row = $row + parent::buildRow($entity);
return $row;
}