当前位置: 首页>>代码示例>>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;未经允许,请勿转载。