本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例8: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['type'] = $entity->link();
$row['description'] = Xss::filterAdmin($entity->description);
return $row + parent::buildRow($entity);
}
示例9: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $entity->link();
return $row + parent::buildRow($entity);
}
示例10: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['type'] = $entity->link();
$row['description']['data']['#markup'] = $entity->getDescription();
return $row + parent::buildRow($entity);
}
示例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);
}
示例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;
}