You are here

public function Node::getAvailableSorts in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node::getAvailableSorts()
  2. 9 core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node::getAvailableSorts()

Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::getAvailableSorts().

Return value

array An array whose keys are the available sort options and whose corresponding values are human readable labels.

Overrides WizardPluginBase::getAvailableSorts

File

core/modules/node/src/Plugin/views/wizard/Node.php, line 97

Class

Node
Tests creating node views with the wizard.

Namespace

Drupal\node\Plugin\views\wizard

Code

public function getAvailableSorts() {

  // You can't execute functions in properties, so override the method
  return [
    'node_field_data-title:ASC' => $this
      ->t('Title'),
  ];
}