當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityInterface::link方法代碼示例

本文整理匯總了PHP中Drupal\Core\Entity\EntityInterface::link方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityInterface::link方法的具體用法?PHP EntityInterface::link怎麽用?PHP EntityInterface::link使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Entity\EntityInterface的用法示例。


在下文中一共展示了EntityInterface::link方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['type'] = $entity->link();
     $row['registration'] = $entity->getRegistration() ? t('Yes') : t('No');
     $row['multiple'] = $entity->getMultiple() ? t('Yes') : t('No');
     return $row + parent::buildRow($entity);
 }
開發者ID:darrylri,項目名稱:protovbmwmo,代碼行數:10,代碼來源:ProfileTypeListBuilder.php

示例2: buildRow

 /**
  * {@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);
 }
開發者ID:penyaskito,項目名稱:customslider,代碼行數:10,代碼來源:CustomSliderListBuilder.php

示例3: buildRow

 /**
  * {@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);
 }
開發者ID:mangyfox,項目名稱:magic-v2,代碼行數:10,代碼來源:CardBaseListBuilder.php

示例4: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /* @var $entity \Drupal\content_entity_example\Entity\Contact */
     $row['id'] = $entity->id();
     $row['name'] = $entity->link();
     $row['first_name'] = $entity->first_name->value;
     $row['gender'] = $entity->gender->value;
     return $row + parent::buildRow($entity);
 }
開發者ID:seongbae,項目名稱:drumo-distribution,代碼行數:12,代碼來源:ContactListBuilder.php

示例5: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /* @var $entity \Drupal\myeck\Entity\Myeck */
     foreach ($this->show_fields as $name => $label) {
         switch ($name) {
             case $this->entity_id:
                 $row[$name] = $entity->link($entity->id());
                 break;
             case $this->entity_label:
                 $row[$name] = $entity->link($entity->{$name}->value);
                 break;
             case 'user_id':
                 $user_id = $entity->{$name}->target_id;
                 $user = \Drupal\user\Entity\User::load($user_id);
                 $row[$name] = $user->getDisplayName();
                 break;
             case 'created':
             case 'changed':
                 $date = date('Y-m-d H:i:s', $entity->{$name}->value);
                 $row[$name] = $date;
                 break;
             case 'language':
             case 'langcode':
                 $row[$name] = $entity->langcode->value;
                 break;
             default:
                 $row[$name] = $entity->{$name}->value;
         }
     }
     //    $row['name'] = $entity->link();
     //    $row['first_name'] = $entity->first_name->value;
     //    $row['gender'] = $entity->gender->value;
     //    $row['name'] = $this->l(
     //      $this->getLabel($entity),
     //      new Url(
     //        'entity.my_test_entity.edit_form', array(
     //          'my_test_entity' => $entity->id(),
     //        )
     //      )
     //    );
     return $row + parent::buildRow($entity);
 }
開發者ID:alexawg2015,項目名稱:drupal-8,代碼行數:45,代碼來源:MyeckListBuilder.php

示例6: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     // Special case the personal form.
     if ($entity->id() == 'personal') {
         $row['form'] = $entity->label();
         $row['recipients'] = t('Selected user');
         $row['selected'] = t('No');
     } else {
         $row['form'] = $entity->link(NULL, 'canonical');
         $row['recipients']['data'] = ['#theme' => 'item_list', '#items' => $entity->getRecipients(), '#context' => ['list_style' => 'comma-list']];
         $default_form = \Drupal::config('contact.settings')->get('default_form');
         $row['selected'] = $default_form == $entity->id() ? t('Yes') : t('No');
     }
     return $row + parent::buildRow($entity);
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:18,代碼來源:ContactFormListBuilder.php

示例7: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /** @var \Drupal\profile\Entity\ProfileInterface $entity */
     $langcode = $entity->language()->getId();
     $uri = $entity->toUrl();
     $options = $uri->getOptions();
     $options += $langcode != LanguageInterface::LANGCODE_NOT_SPECIFIED && isset($languages[$langcode]) ? ['language' => $languages[$langcode]] : [];
     $uri->setOptions($options);
     $row['label'] = $entity->link();
     $row['type'] = $entity->getType();
     $row['owner']['data'] = ['#theme' => 'username', '#account' => $entity->getOwner()];
     $row['status'] = $entity->isActive() ? $this->t('active') : $this->t('not active');
     $row['is_default'] = $entity->isDefault() ? $this->t('default') : $this->t('not default');
     $row['changed'] = $this->dateFormatter->format($entity->getChangedTime(), 'short');
     $language_manager = \Drupal::languageManager();
     if ($language_manager->isMultilingual()) {
         $row['language_name'] = $language_manager->getLanguageName($langcode);
     }
     return $row + parent::buildRow($entity);
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:23,代碼來源:ProfileListBuilder.php

示例8: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['type'] = $entity->link();
     $row['description'] = Xss::filterAdmin($entity->description);
     return $row + parent::buildRow($entity);
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:9,代碼來源:BlockContentTypeListBuilder.php

示例9: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $entity->link();
     return $row + parent::buildRow($entity);
 }
開發者ID:heddn,項目名稱:content_entity_base,代碼行數:8,代碼來源:EntityBaseListBuilder.php

示例10: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['type'] = $entity->link();
     $row['description']['data']['#markup'] = $entity->getDescription();
     return $row + parent::buildRow($entity);
 }
開發者ID:heddn,項目名稱:content_entity_base,代碼行數:9,代碼來源:EntityTypeBaseListBuilder.php

示例11: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     /* @var $entity \Drupal\rdf_entity\Entity\Rdf */
     $row['id'] = $entity->link();
     $row['rid'] = $entity->bundle();
     $row['status'] = $entity->isPublished() ? $this->t('Published') : $this->t('Unpublished');
     return $row + parent::buildRow($entity);
 }
開發者ID:ec-europa,項目名稱:joinup-dev,代碼行數:11,代碼來源:RdfListBuilder.php

示例12: buildRow

 /**
  * Builds a table row for a licence rdf_entity.
  */
 public function buildRow(EntityInterface $entity)
 {
     /* @var $entity \Drupal\rdf_entity\Entity\Rdf */
     $row['id'] = $entity->link();
     $row['rid'] = $entity->bundle();
     return $row;
 }
開發者ID:ec-europa,項目名稱:joinup-dev,代碼行數:10,代碼來源:LicenceOverviewController.php


注:本文中的Drupal\Core\Entity\EntityInterface::link方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。