WebformSubmissionFieldNumericSort.php in Webform Views Integration 8.5
File
src/Plugin/views/sort/WebformSubmissionFieldNumericSort.php
View source
<?php
namespace Drupal\webform_views\Plugin\views\sort;
use Drupal\views\Plugin\views\sort\SortPluginBase;
use Drupal\webform_views\Plugin\views\WebformSubmissionCastToNumberTrait;
class WebformSubmissionFieldNumericSort extends SortPluginBase {
use WebformSubmissionCastToNumberTrait;
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);
}
}