Added activity entity

This commit is contained in:
naomi
2018-04-14 12:26:09 +02:00
parent 74e98818ba
commit 484fb5a119
25 changed files with 1028 additions and 0 deletions

View File

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