Initial Version
This commit is contained in:
42
shared/lib/Resource/Sort/ISort.php
Normal file
42
shared/lib/Resource/Sort/ISort.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user