43 lines
764 B
PHP
43 lines
764 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace KTXF\Resource\Sort;
|
|
|
|
interface ISort {
|
|
|
|
/**
|
|
* List of available attributes
|
|
*
|
|
* @since 1.0.0
|
|
*
|
|
* @return array<string,bool>
|
|
*/
|
|
public function attributes(): array;
|
|
|
|
/**
|
|
* Define sort condition
|
|
*
|
|
* @since 1.0.0
|
|
*
|
|
* @param string $attribute attribute name
|
|
* @param bool $direction true for ascending, false for descending
|
|
*/
|
|
public function condition(string $property, bool $direction): void;
|
|
|
|
/**
|
|
* List of sort conditions
|
|
*
|
|
* @since 1.0.0
|
|
*
|
|
* @return array<string,array{attribute:string,direction:bool}>
|
|
*/
|
|
public function conditions(): array;
|
|
|
|
}
|