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


PHP EntityListBuilder::getDefaultOperations方法代码示例

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


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

示例1: getDefaultOperations

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

    $operations['edit']['title'] = $this->t('Edit items');

    return $operations;
  }
开发者ID:jkyto,项目名称:agolf,代码行数:10,代码来源:EntitySubqueueListBuilder.php

示例2: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = 'admin/structure/block/block-content';
     }
     return $operations;
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:11,代码来源:BlockContentListBuilder.php

示例3: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('update') && $entity->hasLinkTemplate('reassign-form')) {
         $operations['reassign'] = array('title' => $this->t('Reassign'), 'weight' => 20, 'url' => $entity->toUrl('reassign-form'));
     }
     return $operations;
 }
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:11,代码来源:OrderListBuilder.php

示例4: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = $entity->url('collection');
     }
     return $operations;
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:11,代码来源:BlockContentListBuilder.php

示例5: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit');
     }
     $operations['view'] = array('title' => t('View'), 'url' => $entity->toUrl());
     return $operations;
 }
开发者ID:dakala,项目名称:gradebook,代码行数:12,代码来源:GradeItemListBuilder.php

示例6: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($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:davidsoloman,项目名称:drupalconsole.com,代码行数:15,代码来源:ConfigTranslationEntityListBuilder.php

示例7: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\tmgmt_local\Entity\LocalTaskItem $entity */
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('view', \Drupal::currentUser()) && $entity->getTask()->getAssignee()->id() == \Drupal::currentUser()->id()) {
         if ($entity->isPending()) {
             $operations['translate'] = ['url' => $entity->urlInfo(), 'title' => t('Translate'), 'weight' => 0];
         } else {
             $operations['view'] = ['url' => $entity->urlInfo(), 'title' => t('View'), 'weight' => 0];
         }
     }
     return $operations;
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:16,代码来源:LocalTaskItemListBuilder.php

示例8: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->isSubmittable() && $entity->access('submit')) {
         $operations['submit'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Submit'), 'weight' => -10);
     } else {
         $operations['manage'] = array('url' => $entity->urlInfo()->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Manage'), 'weight' => -10);
     }
     if ($entity->isAbortable() && $entity->access('submit')) {
         $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10);
     }
     return $operations;
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:16,代码来源:JobListBuilder.php

示例9: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     if ($this->entityType->hasKey('status')) {
         if (!$entity->status() && $entity->hasLinkTemplate('enable')) {
             $operations['enable'] = array('title' => t('Enable'), 'weight' => -10, 'url' => $entity->urlInfo('enable'));
         } elseif ($entity->hasLinkTemplate('disable')) {
             $operations['disable'] = array('title' => t('Disable'), 'weight' => 40, 'url' => $entity->urlInfo('disable'));
         }
     }
     return $operations;
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:16,代码来源:ConfigEntityListBuilder.php

示例10: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->getCountTranslated() > 0 && $entity->access('accept')) {
         $operations['review'] = array('url' => $entity->urlInfo(), 'title' => t('Review'));
     } elseif (!$entity->getJob()->isUnprocessed()) {
         $operations['view'] = array('url' => $entity->urlInfo(), 'title' => t('View'));
     }
     // Display abort button on active or needs review job items.
     if ($entity->isActive() || $entity->isNeedsReview()) {
         $operations['abort'] = array('url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('<current>')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10);
     }
     return $operations;
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:17,代码来源:JobItemListBuilder.php

示例11: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['query']['destination'] = $entity->url('collection');
     }
     if (isset($operations['delete'])) {
         $operations['delete']['query']['destination'] = $entity->url('collection');
     }
     if ($entity->access('version-history') && $entity->hasLinkTemplate('version-history')) {
         $operations['version-history'] = ['title' => $this->t('Version history'), 'weight' => 10, 'url' => $entity->urlInfo('version-history')];
     }
     return $operations;
 }
开发者ID:heddn,项目名称:content_entity_base,代码行数:17,代码来源:EntityBaseListBuilder.php

示例12: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     /* @var $transition WorkflowTransitionInterface */
     $transition = $entity;
     if (isset($operations['edit'])) {
         $destination = \Drupal::destination()->getAsArray();
         $operations['edit']['query'] = $destination;
     }
     return $operations;
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:14,代码来源:WorkflowTransitionListBuilder.php

示例13: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $destination = $this->redirectDestination->getAsArray();
     foreach ($operations as $key => $operation) {
         $operations[$key]['query'] = $destination;
     }
     return $operations;
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:12,代码来源:NodeListBuilder.php

示例14: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     $operations['edit']['weight'] = 0;
     if ($entity->access('import') && $entity->hasLinkTemplate('import-form')) {
         $operations['import'] = ['title' => $this->t('Import'), 'weight' => 2, 'url' => $entity->urlInfo('import-form')];
     }
     if ($entity->access('clear') && $entity->hasLinkTemplate('clear-form')) {
         $operations['clear'] = ['title' => $this->t('Delete items'), 'weight' => 3, 'url' => $entity->urlInfo('clear-form')];
     }
     $destination = $this->redirectDestination->getAsArray();
     foreach ($operations as $key => $operation) {
         $operations[$key]['query'] = $destination;
     }
     return $operations;
 }
开发者ID:Tawreh,项目名称:mtg,代码行数:19,代码来源:FeedListBuilder.php

示例15: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 protected function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->access('view') && $entity->hasLinkTemplate('canonical')) {
         $operations['view'] = array('title' => $this->t('View'), 'weight' => 0, 'url' => $entity->urlInfo('canonical'));
     }
     return $operations;
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:11,代码来源:RegistrationListBuilder.php


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