• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Entity\ConfigEntityListBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Drupal\Core\Config\Entity\ConfigEntityListBuilder的典型用法代码示例。如果您正苦于以下问题:PHP ConfigEntityListBuilder类的具体用法?PHP ConfigEntityListBuilder怎么用?PHP ConfigEntityListBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ConfigEntityListBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row = [];
     $row['name'] = $entity->label();
     $row['type'] = $entity->id();
     return $row + parent::buildRow($entity);
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:10,代码来源:ProductVariationTypeListBuilder.php


示例2: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['year'] = $entity->id();
     $row['start_date'] = $entity->start_date;
     $row['end_date'] = $entity->end_date;
     return $row + parent::buildRow($entity);
 }
开发者ID:wallecan,项目名称:drupalpp,代码行数:10,代码来源:SeasonListBuilder.php


示例3: 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);
 }
开发者ID:sepal,项目名称:particle_cloud,代码行数:10,代码来源:DeviceListBuilder.php


示例4: render

 /**
  * Adds some descriptive text to our entity list.
  *
  * @return array
  *   Renderable array.
  */
 public function render()
 {
     $build['description'] = array('#markup' => $this->t("<p>This is a list of the countries currently" . " defined for use on your Drupal site. This country data adheres to" . " the @iso standard for country and zone naming used by payment" . " providers and package couriers.</p>" . "<p>To make a country available for use at checkout or in a user's" . " address book, 'Enable' the country using the widget in the" . " 'Operations' for that country. You may also 'Disable' a country to" . " prevent customers from selecting that country as a billing or" . " shipping address.</p>" . "<p>You may also use the 'Edit' widget in the 'Operations' column to" . " edit a country's name or address format.</p>", ['@iso' => Link::fromTextAndUrl('ISO 3166', Url::fromUri('http://en.wikipedia.org/wiki/ISO_3166'))->toString()]));
     $build += parent::render();
     $build['table']['#empty'] = $this->t('No countries have been configured yet.');
     return $build;
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:13,代码来源:CountryListBuilder.php


示例5: getOperations

  /**
   * {@inheritdoc}
   */
  public function getOperations(EntityInterface $entity) {
    $operations = parent::getOperations($entity);
    // Place the edit operation after the operations added by field_ui.module
    // which have the weights 15, 20, 25.
    if (isset($operations['edit'])) {
      $operations['edit'] = [
        'title' => t('Edit'),
        'weight' => 30,
        'url' => $entity->urlInfo('edit-form')
      ];
    }
    if (isset($operations['delete'])) {
      $operations['delete'] = [
        'title' => t('Delete'),
        'weight' => 35,
        'url' => $entity->urlInfo('delete-form')
      ];
    }
    // Sort the operations to normalize link order.
    uasort($operations, [
      'Drupal\Component\Utility\SortArray',
      'sortByWeightElement'
    ]);

    return $operations;
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:29,代码来源:ProfileTypeListBuilder.php


示例6: 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);
 }
开发者ID:rafavergara,项目名称:ddv8,代码行数:34,代码来源:MailchimpSignupListBuilder.php


示例7: 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;
  }
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:28,代码来源:BlockVisibilityGroupListBuilder.php


示例8: 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);
 }
开发者ID:borisson,项目名称:search_api_page,代码行数:10,代码来源:SearchApiPageListBuilder.php


示例9: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if (!empty($this->weightKey)) {
         return $this->formBuilder()->getForm($this);
     }
     return parent::render();
 }
开发者ID:318io,项目名称:318-io,代码行数:10,代码来源:DraggableListBuilder.php


示例10: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $this->getLabel($entity);
     $redirect = $entity->getRedirect();
     $row['redirect'] = empty($redirect) ? $this->t('None') : $redirect;
     return $row += parent::buildRow($entity);
 }
开发者ID:dropdog,项目名称:play,代码行数:10,代码来源:DomainAliasListBuilder.php


示例11: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['set_default'] = array('title' => t('Set Default'), 'weight' => -10, 'url' => $entity->urlInfo('set-default'));
     return $operations;
 }
开发者ID:badjava,项目名称:encrypt,代码行数:10,代码来源:EncryptionProfileListBuilder.php


示例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);
 }
开发者ID:jasonruyle,项目名称:crm_core,代码行数:10,代码来源:ContactTypeListBuilder.php


示例13: buildRow

 /**
  * {@inheritdoc}
  */
 public function buildRow(EntityInterface $entity)
 {
     $row['label'] = $this->l($this->getLabel($entity), new Url('entity.question.add_form', array('question_type' => $entity->id(), 'quiz' => $this->getQuizId())));
     $row['id'] = $entity->id();
     // You probably want a few more properties here...
     return $row + parent::buildRow($entity);
 }
开发者ID:novaFTL,项目名称:quiz-drupal8,代码行数:10,代码来源:QuestionTypeListBuilder.php


示例14: 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);
 }
开发者ID:juanramonperez,项目名称:encrypt,代码行数:10,代码来源:EncryptionProfileListBuilder.php


示例15: getDefaultOperations

  /**
   * {@inheritdoc}
   */
  public function getDefaultOperations(EntityInterface $entity) {
    $operations = parent::getDefaultOperations($entity);

    if (isset($operations['edit'])) {
      $operations['edit']['title'] = t('Edit profile');
    }

    $operations['matchers'] = [
      'title' => t('Manage matchers'),
      'weight' => 10,
      'url' => Url::fromRoute('linkit.matchers', [
        'linkit_profile' => $entity->id()
      ]),
    ];

    $operations['attributes'] = [
      'title' => t('Manage attributes'),
      'weight' => 20,
      'url' => Url::fromRoute('linkit.attributes', [
        'linkit_profile' => $entity->id()
      ]),
    ];

    return $operations;
  }
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:28,代码来源:ProfileListBuilder.php


示例16: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\commerce_tax\Entity\TaxRateInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['rate_amounts'] = ['title' => $this->t('View rate amounts'), 'url' => Url::fromRoute('entity.commerce_tax_rate_amount.collection', ['commerce_tax_rate' => $entity->id()])];
     return $operations;
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:10,代码来源:TaxRateListBuilder.php


示例17: render

 /**
  * {@inheritdoc}
  */
 public function render() {
   $build = parent::render();
   $build['#empty'] = $this->t('There are currently no blocktabs. <a href=":url">Add a new one</a>.', array(
     ':url' => $this->urlGenerator->generateFromRoute('blocktabs.add'),
   ));
   return $build;
 }
开发者ID:AshishNaik021,项目名称:iimisac-d8,代码行数:10,代码来源:BlocktabsListBuilder.php


示例18: __construct

 /**
  * Constructs a new FieldStorageConfigListBuilder object.
  *
  * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
  *   The entity type definition.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager.
  * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
  *   The 'field type' plugin manager.
  */
 public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, EntityTypeBundleInfoInterface $bundle_info_service)
 {
     parent::__construct($entity_type, $entity_manager->getStorage($entity_type->id()));
     $this->entityManager = $entity_manager;
     $this->bundles = $bundle_info_service->getAllBundleInfo();
     $this->fieldTypeManager = $field_type_manager;
     $this->fieldTypes = $this->fieldTypeManager->getDefinitions();
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:18,代码来源:FieldStorageConfigListBuilder.php


示例19: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build['description'] = array('#markup' => $this->t("<p>This is a list of the tax rates currently" . " defined on your Drupal site.</p><p>You may use the 'Add a tax rate'" . " button to add a new rate, or use the widget in the 'Operations'" . " column to edit, delete, or clone existing tax rates.</p>"));
     $build += parent::render();
     $build['table']['#empty'] = $this->t('No tax rates have been configured yet.');
     $build['table']['#tabledrag'] = array(array('action' => 'order', 'relationship' => 'sibling', 'group' => 'uc-tax-method-weight'));
     return $build;
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:11,代码来源:TaxRateListBuilder.php


示例20: getDefaultOperations

 /**
  * Gets this list's default operations.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity the operations are for.
  *
  * @return array
  *   The array structure is identical to the return value of
  *   self::getOperations().
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('backups') && $entity->hasLinkTemplate('backups')) {
         $operations['backups'] = array('title' => $this->t('List Backups'), 'weight' => 100, 'url' => $entity->toUrl('backups'));
     }
     return $operations;
 }
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:18,代码来源:DestinationListBuilder.php



注:本文中的Drupal\Core\Config\Entity\ConfigEntityListBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Controller\ControllerResolverInterface类代码示例发布时间:2022-05-23
下一篇:
PHP Entity\ConfigEntityInterface类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap