本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}