-
Notifications
You must be signed in to change notification settings - Fork 690
Expand file tree
/
Copy pathSortableFieldInterface.php
More file actions
32 lines (30 loc) · 948 Bytes
/
SortableFieldInterface.php
File metadata and controls
32 lines (30 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* @link https://craftcms.com/
* @copyright Copyright (c) Pixel & Tonic, Inc.
* @license https://craftcms.github.io/license/
*/
namespace craft\base;
/**
* SortableFieldInterface defines the common interface to be implemented by field classes that can be available as
* sort options on element indexes.
*
* @author Pixel & Tonic, Inc. <[email protected]>
* @since 3.2.0
*/
interface SortableFieldInterface
{
/**
* Returns the field’s sort option definition.
*
* This should return an array with the following keys:
*
* - `label` – The sort option label
* - `orderBy` – An array or comma-delimited string of columns to order the query by
* - `attribute` – The table attribute name that this option is associated with
* (required if `orderBy` is an array or more than one column name)
*
* @return array
*/
public function getSortOption(): array;
}