Added Organisation Relation entity with update hook to install it, bumped version

This commit is contained in:
2021-07-16 17:32:40 +02:00
parent 26d78a4f7f
commit d151b1744e
26 changed files with 950 additions and 1 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 Relation entities.
*
* @ingroup opencase_entities
*/
class OCOrganisationRelationListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Organisation Relation ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var \Drupal\opencase_entities\Entity\OCOrganisationRelation $entity */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.oc_organisation_relation.edit_form',
['oc_organisation_relation' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}