当前位置: 首页>>代码示例>>PHP>>正文


PHP ConfigEntityListBuilder::getOperations方法代码示例

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


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

示例1: 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

示例2: getOperations

 /**
  * @inheritDoc
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     if (!empty($operations['edit'])) {
         /** @var \Drupal\Core\Url $edit */
         $edit = $operations['edit']['url'];
         $edit->setRouteParameters(['machine_name' => $entity->id(), 'step' => 'general']);
     }
     return $operations;
 }
开发者ID:Wylbur,项目名称:gj,代码行数:13,代码来源:ExampleConfigEntityListBuilder.php

示例3: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     // Global and entity defaults can be reverted but not deleted.
     if (strpos($entity->id(), '__') === FALSE) {
         unset($operations['delete']);
         $operations['revert'] = array('title' => t('Revert'), 'weight' => $operations['edit']['weight'] + 1, 'url' => $entity->urlInfo('revert-form'));
     }
     return $operations;
 }
开发者ID:darrylri,项目名称:protovbmwmo,代码行数:13,代码来源:MetatagDefaultsListBuilder.php

示例4: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     foreach (array_keys($operations) as $operation) {
         // This is a translation UI for translators. Show the translation
         // operation only.
         if (!($operation == 'translate')) {
             unset($operations[$operation]);
         }
     }
     return $operations;
 }
开发者ID:sarahwillem,项目名称:OD8,代码行数:15,代码来源:ConfigTranslationEntityListBuilder.php

示例5: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     $operations['delete']['href'] = 'admin/config/domain/alias/delete/' . $entity->id();
     return $operations;
 }
开发者ID:dropdog,项目名称:play,代码行数:9,代码来源:DomainAliasListBuilder.php

示例6: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     if (isset($operations['translate'])) {
         unset($operations['translate']);
     }
     return $operations;
 }
开发者ID:jeroenos,项目名称:jeroenos_d8.mypressonline.com,代码行数:11,代码来源:XmlSitemapListBuilder.php


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