Skip to content
Snippets Groups Projects
SortingPair.php 402 B
Newer Older
Pavel's avatar
Pavel committed
<?php

namespace IQDEV\ElasticSearch\Search\Sorting;

abstract class SortingPair implements Sorting
{
    public string $by;
    public string $direction;

    public function __construct(string $by = '', string $direction = 'asc')
    {
        $this->by = $by;
        $this->direction = $direction;
    }

    public function es(): array
    {
        return [$this->by => $this->direction];
    }
}