Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| VisitorsTimestamp | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| query | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| postExecute | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Drupal\visitors\Plugin\views\sort; |
| 4 | |
| 5 | use Drupal\views\Attribute\ViewsSort; |
| 6 | use Drupal\views\Plugin\views\sort\SortPluginBase; |
| 7 | use Drupal\visitors\Service\SequenceService; |
| 8 | |
| 9 | /** |
| 10 | * Sort handler for days of the week respecting system first day setting. |
| 11 | */ |
| 12 | #[ViewsSort("visitors_timestamp")] |
| 13 | class VisitorsTimestamp extends SortPluginBase { |
| 14 | |
| 15 | /** |
| 16 | * {@inheritdoc} |
| 17 | */ |
| 18 | public function query() { |
| 19 | $this->ensureMyTable(); |
| 20 | |
| 21 | /** @var \Drupal\views\Plugin\views\query\Sql $query */ |
| 22 | $query = $this->query; |
| 23 | $query->addOrderBy(NULL, NULL, $this->options['order'], $this->field); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * {@inheritdoc} |
| 28 | */ |
| 29 | public function postExecute(&$values) { |
| 30 | $values = SequenceService::fill($values); |
| 31 | } |
| 32 | |
| 33 | } |