/** * {@inheritdoc} */ public function render() { $build = parent::render(); // Override the empty text. $build['table']['#empty'] = $this->t('There are no @label entities yet.', ['@label' => $this->entityType->getLabel()]); return $build; }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\quiz\Entity\Quiz */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.quiz.canonical', array('quiz' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\drupalbristol_sponsors\Entity\SponsorEntity */ $row['id'] = $entity->id(); $row['name'] = $this->l($entity->label(), new Url('entity.sponsor.edit_form', array('sponsor' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\oauth2_server\Entity\ClientEntity */ $row['id'] = $entity->id(); $row['server'] = \Drupal::l($this->getLabel($entity), new Url('entity.oauth2_server_client.edit_form', array('oauth2_server_client' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\happy_alexandrie\Entity\AuthorEntity */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.author_entity.edit_form', array('author_entity' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\brand\Entity\brand */ $row['id'] = $entity->id(); $row['name'] = \Drupal::l($this->getLabel($entity), new Url('entity.brand.edit_form', array('brand' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\hall_reservation\Entity\ReservationEntity */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.reservation_entity.edit_form', array('reservation_entity' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\drupal8_entity\Entity\Drupal8EntityItem */ $row['id'] = $entity->id(); $row['name'] = $this->l($entity->label(), new Url('entity.drupal8_entity_item.edit_form', array('drupal8_entity_item' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\magic_cards\Entity\CardBase */ $row['id'] = $entity->id(); $row['name'] = $entity->link(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\content_entity_example\Entity\Contact */ $row['rid'] = $entity->id(); $row['first_name'] = $entity->first_name->value; return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\eck\Entity\EckEntity */ $row['id'] = $entity->id(); $row['title'] = \Drupal::l($this->getLabel($entity), Url::fromRoute('entity.' . $this->entityTypeId . '.canonical', array($this->entityTypeId => $entity->id()))); return array_merge($row, parent::buildRow($entity)); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\dinodb\Entity\Dinosaur */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.dinosaur.edit_form', array('dinosaur' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\my_first_entity\Entity\Course */ $row['id'] = $entity->id(); $row['name'] = \Drupal::l($this->getLabel($entity), new Url('entity.course.edit_form', array('course' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\scheduled_updates\Entity\ScheduledUpdate */ $row['name'] = $this->l($entity->label(), new Url('entity.scheduled_update.edit_form', array('scheduled_update' => $entity->id()))); $row['type'] = $this->updateUtils->getUpdateTypeLabel($entity); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\log\Entity\Log */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.log.edit_form', array('log' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\customslider\Entity\Contact */ $row['id'] = $entity->id(); $row['name'] = $entity->link(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\content_entity_example\Entity\OnlineMessage */ $row['id'] = $entity->id(); $row['name'] = $this->l($entity->label(), new Url('entity.online_message.edit_form', array('online_message' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\gestiondenuncias\Entity\DefaultEntity */ $row['id'] = $entity->id(); $row['name'] = $this->l($this->getLabel($entity), new Url('entity.default_entity.edit_form', array('default_entity' => $entity->id()))); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $operations['edit']['title'] = $this->t('Edit items'); return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['query']['destination'] = 'admin/structure/block/block-content'; } return $operations; }
/** * {@inheritdoc} */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if (isset($operations['edit'])) { $operations['edit']['query']['destination'] = $entity->url('collection'); } return $operations; }
/** * {@inheritdoc} */ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); if ($entity->access('update') && $entity->hasLinkTemplate('reassign-form')) { $operations['reassign'] = array('title' => $this->t('Reassign'), 'weight' => 20, 'url' => $entity->toUrl('reassign-form')); } return $operations; }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\foo_bar\Entity\FooBar */ $row['id'] = $entity->id(); $row['label'] = l($this->getLabel($entity), 'foo-bar/' . $entity->id()); $row['foo_bar_field'] = $entity->getFooBarField(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\component\Entity\Component */ $row['id'] = $entity->id(); $row['name'] = $this->l($entity->label(), new Url('entity.component.canonical', array('component' => $entity->id()))); $row['uuid'] = $entity->uuid(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\commerce_store\Entity\Store */ $store_type = StoreType::load($entity->bundle()); $row['name']['data'] = ['#type' => 'link', '#title' => $entity->label()] + $entity->urlInfo()->toRenderArray(); $row['type'] = $store_type->label(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\interns\Entity\InternsEntity */ $row['id'] = $entity->id(); $row['name'] = \Drupal::l($this->getLabel($entity), new Url('entity.interns_entity.edit_form', array('interns_entity' => $entity->id()))); $row['interns'] = $entity->interns->value; return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /* @var $entity \Drupal\custom_page\Entity\CustomPage */ $row['id'] = $entity->id(); $row['name'] = $this->l($entity->label(), new Url('entity.custom_page.canonical', array('custom_page' => $entity->id()))); $row['uuid'] = $entity->uuid(); return $row + parent::buildRow($entity); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { /** @var \Drupal\conference_sessions\Entity\RoomTypeInterface $entity */ $product_type = RoomType::load($entity->bundle()); $row['title']['data'] = ['#type' => 'link', '#title' => $entity->label()] + $entity->toUrl()->toRenderArray(); $row['type'] = $product_type->label(); $row['status'] = $entity->isPublished() ? $this->t('Published') : $this->t('Unpublished'); return $row + parent::buildRow($entity); }
/** * Tests that buildRow() returns a string which has been run through * SafeMarkup::checkPlain(). * * @dataProvider providerTestBuildRow * * @param string $input * The entity label being passed into buildRow. * @param string $expected * The expected output of the label from buildRow. * @param string $message * The message to provide as output for the test. * @param bool $ignorewarnings * Whether or not to ignore PHP 5.3+ invalid multibyte sequence warnings. * * @see \Drupal\Core\Entity\EntityListBuilder::buildRow() */ public function testBuildRow($input, $expected, $message, $ignorewarnings = FALSE) { $this->role->expects($this->any())->method('label')->will($this->returnValue($input)); if ($ignorewarnings) { $built_row = @$this->entityListBuilder->buildRow($this->role); } else { $built_row = $this->entityListBuilder->buildRow($this->role); } $this->assertEquals($built_row['label'], $expected, $message); }
/** * {@inheritdoc} */ public function buildRow(EntityInterface $entity) { $langcode = $entity->language()->getId(); $uri = $entity->toUrl(); $options = $uri->getOptions(); $options += $langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? array('language' => $languages[$langcode]) : array(); $uri->setOptions($options); $row['name']['data'] = array('#type' => 'link', '#title' => $entity->label(), '#url' => $uri); $row['scales']['data'] = array('#type' => 'markup', '#markup' => implode(', ', $entity->getScales())); return $row + parent::buildRow($entity); }