function Node::getAvailableSorts

Same name in other branches
  1. 8.9.x core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node::getAvailableSorts()
  2. 10 core/modules/node/src/Plugin/views/wizard/Node.php \Drupal\node\Plugin\views\wizard\Node::getAvailableSorts()
  3. 11.x 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 101

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'),
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.