ILTResultViewBuilder.php in Opigno Instructor-led Trainings 8
File
src/ILTResultViewBuilder.php
View source
<?php
namespace Drupal\opigno_ilt;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityViewBuilder;
class ILTResultViewBuilder extends EntityViewBuilder {
protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
$build[] = [
'#markup' => $this
->t('Instructor-Led Training: @ilt', [
'@ilt' => $entity
->getILT()
->toLink(),
]),
];
$build[] = [
'#markup' => $this
->t('User: @user', [
'@user' => $entity
->getUser()
->toLink(),
]),
];
$build[] = [
'#markup' => $this
->t('Status: @status', [
'@status' => $entity
->getStatusString(),
]),
];
$build[] = [
'#markup' => $this
->t('Score: @score', [
'@score' => $entity
->getScore(),
]),
];
}
}