You are here

public function SalesforceMappingList::getDefaultOperations in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping_ui/src/SalesforceMappingList.php \Drupal\salesforce_mapping_ui\SalesforceMappingList::getDefaultOperations()

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides ConfigEntityListBuilder::getDefaultOperations

File

modules/salesforce_mapping_ui/src/SalesforceMappingList.php, line 72

Class

SalesforceMappingList
Defines the filter format list controller.

Namespace

Drupal\salesforce_mapping_ui

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  $url = Url::fromRoute('entity.salesforce_mapping.fields', [
    'salesforce_mapping' => $entity
      ->id(),
  ]);

  // Only makes sense to expose fields operation if edit exists.
  if (isset($operations['edit'])) {
    $operations['edit']['title'] = $this
      ->t('Settings');
    $operations['fields'] = [
      'title' => $this
        ->t('Fields'),
      'url' => $url,
      'weight' => -1000,
    ];
  }
  return $operations;
}