public function AbstractSolrEntityListBuilder::getDefaultOperations in Search API Solr 8.3
Same name and namespace in other branches
- 4.x src/Controller/AbstractSolrEntityListBuilder.php \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder::getDefaultOperations()
Throws
\Drupal\Core\Entity\EntityMalformedException
Overrides ConfigEntityListBuilder::getDefaultOperations
File
- src/
Controller/ AbstractSolrEntityListBuilder.php, line 127
Class
- AbstractSolrEntityListBuilder
- Provides a listing of Solr Entities.
Namespace
Drupal\search_api_solr\ControllerCode
public function getDefaultOperations(EntityInterface $solr_entity) {
/** @var \Drupal\search_api_solr\SolrConfigInterface $solr_entity */
$operations = parent::getDefaultOperations($solr_entity);
unset($operations['delete']);
if (!$solr_entity->disabledOnServer && $solr_entity
->access('view') && $solr_entity
->hasLinkTemplate('disable-for-server')) {
$operations['disable_for_server'] = [
'title' => $this
->t('Disable'),
'weight' => 10,
'url' => $solr_entity
->toUrl('disable-for-server'),
];
}
if ($solr_entity->disabledOnServer && $solr_entity
->access('view') && $solr_entity
->hasLinkTemplate('enable-for-server')) {
$operations['enable_for_server'] = [
'title' => $this
->t('Enable'),
'weight' => 10,
'url' => $solr_entity
->toUrl('enable-for-server'),
];
}
return $operations;
}