Gennerated Profile entity

This commit is contained in:
naomi
2018-04-05 20:05:00 +02:00
parent e933c3ae23
commit 7ac39fc385
31 changed files with 1974 additions and 4 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 Profile entities.
*
* @ingroup zencrm_entities
*/
class ProfileListBuilder extends EntityListBuilder {
/**
* {@inheritdoc}
*/
public function buildHeader() {
$header['id'] = $this->t('Profile ID');
$header['name'] = $this->t('Name');
return $header + parent::buildHeader();
}
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\zencrm_entities\Entity\Profile */
$row['id'] = $entity->id();
$row['name'] = Link::createFromRoute(
$entity->label(),
'entity.profile.edit_form',
['profile' => $entity->id()]
);
return $row + parent::buildRow($entity);
}
}