| 1 | <?php |
||
| 8 | abstract class SortClauseHandler implements Handler |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Check if this sort clause handler accepts to handle the given sort clause. |
||
| 12 | * |
||
| 13 | * @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause |
||
| 14 | * |
||
| 15 | * @return bool |
||
| 16 | */ |
||
| 17 | abstract public function accept(SortClause $sortClause); |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Map field value to a proper SOLR representation |
||
| 21 | * |
||
| 22 | * @param SortClause $sortClause |
||
| 23 | * |
||
| 24 | * @return array |
||
| 25 | */ |
||
| 26 | abstract public function handle(SortClause $sortClause); |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get Solr sort direction from sort clause. |
||
| 30 | * |
||
| 31 | * @param SortClause $sortClause |
||
| 32 | * |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | protected function getDirection(SortClause $sortClause) |
||
| 39 | } |
||
| 40 |