Added equal opps entity

This commit is contained in:
2021-02-18 15:32:10 +00:00
parent 34a2d9e23b
commit fbdc64de3c
16 changed files with 629 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<?php
namespace Drupal\opencase_entities;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Link;
/**
* Defines a class to build a listing of Equal Opps entities.
*
* @ingroup opencase_entities
*/
class OCEqualOppsListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Equal Opps ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var \Drupal\opencase_entities\Entity\OCEqualOpps $entity */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.oc_equal_opps.edit_form',
['oc_equal_opps' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}