public function EventTypeListBuilder::getDefaultOperations in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/Lists/EventTypeListBuilder.php \Drupal\rng\Lists\EventTypeListBuilder::getDefaultOperations()
- 3.x src/Lists/EventTypeListBuilder.php \Drupal\rng\Lists\EventTypeListBuilder::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
- src/
Lists/ EventTypeListBuilder.php, line 52
Class
- EventTypeListBuilder
- Builds a list of event config entities.
Namespace
Drupal\rng\ListsCode
public function getDefaultOperations(EntityInterface $entity) {
/** @var \Drupal\rng\EventTypeInterface $entity **/
$operations = parent::getDefaultOperations($entity);
if ($this->moduleHandler
->moduleExists('field_ui')) {
$entity_type = \Drupal::entityTypeManager()
->getDefinition($entity
->getEventEntityTypeId());
if ($entity_type
->get('field_ui_base_route')) {
$options = [];
if ($entity_type
->getBundleEntityType() !== 'bundle') {
$options[$entity_type
->getBundleEntityType()] = $entity
->getEventBundle();
}
$operations['manage-fields'] = [
'title' => t('Event setting defaults'),
'weight' => 15,
'url' => Url::fromRoute("entity." . $entity
->getEventEntityTypeId() . ".field_ui_fields", $options),
];
}
}
return $operations;
}