You are here

public function ViewsField::click_sort in Commerce Invoice 7.2

File

src/InvoiceNumber/ViewsField.php, line 27
Provides views field for invoice numbers.

Class

ViewsField

Namespace

Drupal\commerce_invoice\InvoiceNumber

Code

public function click_sort($order) {
  $params = $this->options['group_type'] != 'group' ? array(
    'function' => $this->options['group_type'],
  ) : array();
  $this->query
    ->add_orderby($this->table_alias, 'number_pattern', $order, '', $params);
  $this->query
    ->add_orderby($this->table_alias, 'number_key', $order, '', $params);
  $this->query
    ->add_orderby($this->table_alias, 'number_sequence', $order, '', $params);
}