You are here

public function WebformSubmissionFieldNumericSort::query in Webform Views Integration 8.5

Called to add the sort to a query.

Overrides SortPluginBase::query

File

src/Plugin/views/sort/WebformSubmissionFieldNumericSort.php, line 20

Class

WebformSubmissionFieldNumericSort
Sorting by numeric webform submission field.

Namespace

Drupal\webform_views\Plugin\views\sort

Code

public function query() {
  $this
    ->ensureMyTable();
  $field = $this->query
    ->addField(NULL, $this
    ->castToDataType($this->tableAlias . '.' . $this->realField), $this->realField . '_sort');
  $this->query
    ->addOrderBy(NULL, NULL, $this->options['order'], $field);
}