You are here

protected function InvoiceItemTypesAdminController::buildOperations in Commerce Invoice 8.2

Builds a renderable list of operation links for the bundle.

Return value

array A renderable array of operation links.

See also

\Drupal\Core\Entity\EntityListBuilder::buildRow()

1 call to InvoiceItemTypesAdminController::buildOperations()
InvoiceItemTypesAdminController::adminPage in src/Controller/InvoiceItemTypesAdminController.php
Handles base route for the field UI.

File

src/Controller/InvoiceItemTypesAdminController.php, line 115

Class

InvoiceItemTypesAdminController
Provides the invoice item type admin controller.

Namespace

Drupal\commerce_invoice\Controller

Code

protected function buildOperations($bundle_name) {
  $operations = [
    'manage-fields' => [
      'title' => t('Manage fields'),
      'weight' => 15,
      'url' => Url::fromRoute("entity.commerce_invoice_item.field_ui_fields", [
        'bundle' => $bundle_name,
      ]),
    ],
    'manage-form-display' => [
      'title' => t('Manage form display'),
      'weight' => 20,
      'url' => Url::fromRoute("entity.entity_form_display.commerce_invoice_item.default", [
        'bundle' => $bundle_name,
      ]),
    ],
    'manage-display' => [
      'title' => t('Manage display'),
      'weight' => 25,
      'url' => Url::fromRoute("entity.entity_view_display.commerce_invoice_item.default", [
        'bundle' => $bundle_name,
      ]),
    ],
  ];
  return [
    '#type' => 'operations',
    '#links' => $operations,
  ];
}