本文整理汇总了PHP中Drupal\Core\Config\Entity\ConfigEntityListBuilder::buildRow方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigEntityListBuilder::buildRow方法的具体用法?PHP ConfigEntityListBuilder::buildRow怎么用?PHP ConfigEntityListBuilder::buildRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Core\Config\Entity\ConfigEntityListBuilder
的用法示例。
在下文中一共展示了ConfigEntityListBuilder::buildRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row = [];
$row['name'] = $entity->label();
$row['type'] = $entity->id();
return $row + parent::buildRow($entity);
}
示例2: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $entity->label();
$row['provider'] = $this->keyProviderPluginManager->getDefinition($entity->getKeyProvider())['title'];
$row['service_default'] = $entity->getServiceDefault() ? "Yes" : "No";
return $row + parent::buildRow($entity);
}
示例3: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['id'] = $entity->getId();
$row['name'] = $this->getLabel($entity);
$row['tag'] = $entity->getTag();
return $row + parent::buildRow($entity);
}
示例4: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
/** @var $entity SearchApiPage */
$row['label'] = $entity->label();
$row['path'] = \Drupal::l($entity->getPath(), Url::fromRoute('search_api_page.' . $entity->id()));
return $row + parent::buildRow($entity);
}
示例5: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $this->getLabel($entity);
$row['id'] = $entity->id();
$row['service_default'] = $entity->getServiceDefault() ? "Yes" : "No";
return $row + parent::buildRow($entity);
}
示例6: 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);
}
示例7: buildRow
/**
* Builds a row for an entity in the entity listing.
*
* @param EntityInterface $entity
* The entity for which to build the row.
*
* @return array
* A render array of the table row for displaying the entity.
*
* @see Drupal\Core\Entity\EntityListController::render()
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $entity->label();
$row['machine_name'] = $entity->id();
$row['floopy'] = $entity->floopy;
return $row + parent::buildRow($entity);
}
示例8: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $this->getLabel($entity);
$row['id'] = $entity->id();
$row['key'] = $entity->getEncryptionKey();
return $row + parent::buildRow($entity);
}
示例9: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row['label'] = $this->getLabel($entity);
$row['id'] = $entity->id();
// You probably want a few more properties here...
return $row + parent::buildRow($entity);
}
示例10: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/** @var \Drupal\linkit\ProfileInterface $linkitProfile */
$linkitProfile = $entity;
$row['label'] = $linkitProfile->label();
$row['description']['data'] = ['#markup' => $linkitProfile->getDescription()];
return $row + parent::buildRow($entity);
}
示例11: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
global $base_url;
$block_url = Url::fromRoute('block.admin_display');
$page_url = Url::fromUri($base_url . '/' . $entity->settings['path']);
$modes = NULL;
$mc_lists = mailchimp_get_lists();
switch ($entity->mode) {
case MAILCHIMP_SIGNUP_BLOCK:
$modes = \Drupal::l(t('Block'), $block_url);
$block_only = TRUE;
break;
case MAILCHIMP_SIGNUP_PAGE:
$modes = \Drupal::l(t('Page'), $page_url);
break;
case MAILCHIMP_SIGNUP_BOTH:
$modes = \Drupal::l(t('Block'), $block_url) . ' and ' . \Drupal::l(t('Page'), $page_url);
break;
}
$list_labels = array();
foreach ($entity->mc_lists as $list_id) {
if (!empty($list_id)) {
$list_url = Url::fromUri('https://admin.mailchimp.com/lists/dashboard/overview?id=' . $mc_lists[$list_id]['web_id'], array('attributes' => array('target' => '_blank')));
$list_labels[] = \Drupal::l($mc_lists[$list_id]['name'], $list_url);
}
}
$row['label'] = $this->getLabel($entity) . ' (Machine name: ' . $entity->id() . ')';
$row['display_modes'] = $modes;
$row['lists'] = implode(', ', $list_labels);
return $row + parent::buildRow($entity);
}
示例12: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
$row = array();
$row['title'] = array('data' => $this->getLabel($entity), 'class' => array('menu-label'));
$row['description'] = Xss::filterAdmin($entity->description);
return $row + parent::buildRow($entity);
}
示例13: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity)
{
/** @var \Drupal\commerce_tax\Entity\TaxTypeInterface $entity */
$row['name'] = $entity->label();
$row['tag'] = $entity->getTag();
return $row + parent::buildRow($entity);
}
示例14: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
$row['label'] = $this->getLabel($entity);
$row['id'] = $entity->id();
// You probably want a few more properties here...
$row += parent::buildRow($entity);
$url = Url::fromRoute(
'block.admin_display',
array(),
['query' => ['block_visibility_group' => $row['id']]]
);
/*$row['manage_blocks'] = array(
'#type' => 'link',
'#title' => 'Manage Blocks',
// @todo Why does this crash?
'#url' => $url,
); */
$row['operations']['data']['#links']['manage_blocks'] = [
'title' => $this->t('Manage Blocks'),
'weight' => 80,
'url' => $url,
];
uasort($row['operations']['data']['#links'], '\Drupal\Component\Utility\SortArray::sortByWeightElement');
return $row;
}
示例15: buildRow
/**
* {@inheritdoc}
*/
public function buildRow(Schedule $entity)
{
$row['label'] = $entity->label();
$row['enabled'] = $entity->get('enabled') ? $this->t('Yes') : $this->t('No');
$row['period'] = $entity->getPeriodFormatted();
$row['last_run'] = $this->t('Never');
if ($last_run = $entity->getLastRun()) {
$row['last_run'] = \Drupal::service('date.formatter')->format($last_run, 'small');
$row['last_run'] .= ' (' . $this->t('@time ago', array('@time' => \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $last_run))) . ')';
}
$row['next_run'] = $this->t('Not Scheduled');
if ($next_run = $entity->getNextRun()) {
$interval = \Drupal::service('date.formatter')->formatInterval(abs($next_run - REQUEST_TIME));
if ($next_run > REQUEST_TIME) {
$row['next_run'] = \Drupal::service('date.formatter')->format($next_run, 'small');
$row['next_run'] .= ' (' . $this->t('in @time', array('@time' => $interval)) . ')';
} else {
$row['next_run'] = $this->t('Next cron run');
if ($last_run) {
$row['next_run'] .= ' (' . $this->t('was due @time ago', array('@time' => $interval)) . ')';
}
}
}
$row['keep'] = \Drupal::translation()->formatPlural($entity->get('keep'), 'Last 1 backup', 'Last @count backups');
return $row + parent::buildRow($entity);
}