當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigEntityListBuilder::getDefaultOperations方法代碼示例

本文整理匯總了PHP中Drupal\Core\Config\Entity\ConfigEntityListBuilder::getDefaultOperations方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigEntityListBuilder::getDefaultOperations方法的具體用法?PHP ConfigEntityListBuilder::getDefaultOperations怎麽用?PHP ConfigEntityListBuilder::getDefaultOperations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Config\Entity\ConfigEntityListBuilder的用法示例。


在下文中一共展示了ConfigEntityListBuilder::getDefaultOperations方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

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

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

示例4: getDefaultOperations

 /**
  * Defines the default operations.
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     // Add an operation for adding a new entity object of this type.
     $url = new Url('mymodule.myentity.add', array('myentity_type' => $entity->id()));
     $operations['add_new'] = array('title' => $this->t('Add new My Entity'), 'weight' => 11, 'url' => $url);
     return $operations;
 }
開發者ID:Jamesadamar,項目名稱:programmers_guide_to_drupal,代碼行數:11,代碼來源:MyEntityTypeListBuilder.php

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

示例6: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit grade letter set');
     }
     $operations['list'] = array('title' => t('List grade letters'), 'url' => $entity->toUrl('list-form'));
     return $operations;
 }
開發者ID:dakala,項目名稱:gradebook,代碼行數:12,代碼來源:GradeLetterSetListBuilder.php

示例7: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $ops = parent::getDefaultOperations($entity);
     // Do not allow deletion of the default configuration.
     if ($entity->id() == 'default') {
         unset($ops['delete']);
     }
     return $ops;
 }
開發者ID:r-daneelolivaw,項目名稱:chalk,代碼行數:12,代碼來源:FlexsliderListBuilder.php

示例8: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\field\FieldInstanceConfigInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $operations['storage-settings'] = array('title' => $this->t('Field settings'), 'weight' => 20, 'attributes' => array('title' => $this->t('Edit field settings.'))) + $entity->urlInfo('storage-edit-form')->toArray();
     $operations['edit']['attributes']['title'] = $this->t('Edit instance settings.');
     $operations['delete']['attributes']['title'] = $this->t('Delete instance.');
     return $operations;
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:12,代碼來源:FieldInstanceConfigListBuilder.php

示例9: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\field\FieldConfigInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['weight'] = 30;
     }
     return $operations;
 }
開發者ID:eric-shell,項目名稱:eric-shell-d8,代碼行數:12,代碼來源:ParagraphsTypeListBuilder.php

示例10: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if (isset($operations['edit'])) {
         $operations['edit']['title'] = t('Edit shortcut set');
     }
     $operations['list'] = array('title' => t('List links'), 'url' => $entity->urlInfo('customize-form'));
     return $operations;
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:12,代碼來源:ShortcutSetListBuilder.php

示例11: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity instanceof IndexInterface) {
         $route_parameters['search_api_index'] = $entity->id();
         $operations['fields'] = array('title' => $this->t('Fields'), 'weight' => 20, 'url' => new Url('entity.search_api_index.fields', $route_parameters));
         $operations['processors'] = array('title' => $this->t('Processors'), 'weight' => 30, 'url' => new Url('entity.search_api_index.processors', $route_parameters));
     }
     return $operations;
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:13,代碼來源:IndexListBuilder.php

示例12: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $ratesRoute = Url::fromRoute('entity.commerce_tax_rate.collection', ['commerce_tax_type' => $entity->getId()]);
     $addRateRoute = Url::fromRoute('entity.commerce_tax_rate.add_form', ['commerce_tax_type' => $entity->getId()]);
     $operations['rates'] = ['title' => $this->t('View rates'), 'url' => $ratesRoute];
     $operations['add_rate'] = ['title' => $this->t('Add rate'), 'url' => $addRateRoute];
     return $operations;
 }
開發者ID:marmouset,項目名稱:drupal,代碼行數:13,代碼來源:TaxTypeListBuilder.php

示例13: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($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']['weight'] = 30;
     }
     return $operations;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:13,代碼來源:BlockContentTypeListBuilder.php

示例14: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
     $operations = parent::getDefaultOperations($entity);
     $message = 'Set Default';
     if ($entity->getServiceDefault()) {
         $message = 'Unset Default';
     }
     $operations['set_default'] = array('title' => t($message), 'weight' => 10, 'url' => $entity->urlInfo('set-default'));
     return $operations;
 }
開發者ID:nerdstein,項目名稱:key,代碼行數:14,代碼來源:KeyListBuilder.php

示例15: getDefaultOperations

 /**
  * {@inheritdoc}
  */
 public function getDefaultOperations(EntityInterface $entity)
 {
     $operations = parent::getDefaultOperations($entity);
     if ($entity->hasLinkTemplate('edit-form')) {
         $operations['edit'] = array('title' => t('Edit schedule'), 'weight' => 20, 'url' => $entity->urlInfo('edit-form'));
     }
     if ($entity->hasLinkTemplate('delete-form')) {
         $operations['delete'] = array('title' => t('Delete schedule'), 'weight' => 30, 'url' => $entity->urlInfo('delete-form'));
     }
     return $operations;
 }
開發者ID:sojo,項目名稱:d8_friendsofsilence,代碼行數:14,代碼來源:ScheduleListBuilder.php


注:本文中的Drupal\Core\Config\Entity\ConfigEntityListBuilder::getDefaultOperations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。