generated Organisation entity

This commit is contained in:
Naomi
2020-11-12 17:13:28 +00:00
parent 17f8ddba2e
commit 675a85dfb6
32 changed files with 2098 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 Organisation entities.
*
* @ingroup opencase_entities
*/
class OCOrganisationListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Organisation ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var \Drupal\opencase_entities\Entity\OCOrganisation $entity */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.oc_organisation.edit_form',
['oc_organisation' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}