Moved everything relating to cases into opencase_cases module

This commit is contained in:
2021-02-08 17:27:18 +00:00
parent 2895dcdab8
commit 5afbeb956b
38 changed files with 107 additions and 103 deletions

View File

@ -0,0 +1,40 @@
<?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 Case entities.
*
* @ingroup opencase_entities
*/
class OCCaseListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Case ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\opencase_entities\Entity\OCCase */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.oc_case.edit_form',
['oc_case' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}