public function LtiToolProviderConsumerListBuilder::buildRow in LTI Tool Provider 2.x
Same name and namespace in other branches
- 8 src/LtiToolProviderConsumerListBuilder.php \Drupal\lti_tool_provider\LtiToolProviderConsumerListBuilder::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 EntityListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
LtiToolProviderConsumerListBuilder.php, line 57
Class
Namespace
Drupal\lti_tool_providerCode
public function buildRow(EntityInterface $entity) : array {
$row = [];
if ($entity instanceof LtiToolProviderConsumer) {
$row = [
'id' => $entity
->id(),
'consumer' => $link = Link::fromTextAndUrl($entity
->label(), Url::fromRoute('entity.lti_tool_provider_consumer.canonical', [
'lti_tool_provider_consumer' => $entity
->id(),
])),
'consumer_key' => $entity
->get('consumer_key')->value,
'consumer_secret' => $entity
->get('consumer_secret')->value,
'created' => Drupal::service('date.formatter')
->format($entity
->get('created')->value, 'short'),
];
}
return $row + parent::buildRow($entity);
}