MetaFox

SortScope extends SortScope
in package
implements HasAlphabetSort, HasFeatureSort Uses AlphabetSortTrait, FeatureSortTrait

Class SortScope.

Table of Contents

Interfaces

HasAlphabetSort
Interface HasAlphabetSort
HasFeatureSort
Interface HasFeatureSort

Constants

SORT_ALPHABETICAL_COLUMN  = 'title'
SORT_DEFAULT  = \MetaFox\Platform\Support\Browse\Browse::SORT_RECENT
SORT_TYPE_DEFAULT  = \MetaFox\Platform\Support\Browse\Browse::SORT_TYPE_DESC

Properties

$sort  : string
$sortType  : string

Methods

__construct()  : mixed
apply()  : mixed
applyAlphabetSort()  : void
applyFeatureSort()  : void
applyQueryBuilder()  : void
getAllowSort()  : array<int, string>
getAllowSortType()  : array<int, string>
getAlphabetSort()  : string
getAlphabetSortColumn()  : string
getFeatureSort()  : string
getFeatureSortColumn()  : string
getSort()  : string
getSortType()  : string
likeOperator()  : string
return the case-insensitive LIKE operator bases on the current database driver.
rules()  : array<string|int, string>
setSort()  : self
setSortType()  : self
sortTypes()  : array<string|int, string>
alias()  : string

Constants

SORT_ALPHABETICAL_COLUMN

public mixed SORT_ALPHABETICAL_COLUMN = 'title'

SORT_DEFAULT

public mixed SORT_DEFAULT = \MetaFox\Platform\Support\Browse\Browse::SORT_RECENT

SORT_TYPE_DEFAULT

public mixed SORT_TYPE_DEFAULT = \MetaFox\Platform\Support\Browse\Browse::SORT_TYPE_DESC

Properties

$sort

private string $sort = self::SORT_DEFAULT

$sortType

private string $sortType = self::SORT_TYPE_DEFAULT

Methods

__construct()

public __construct([string|null $sort = null ][, string|null $sortType = null ]) : mixed
Parameters
$sort : string|null = null
$sortType : string|null = null

apply()

public apply(Builder $builder, Model $model) : mixed
Parameters
$builder : Builder
$model : Model
Tags
SuppressWarnings

(PHPMD.CyclomaticComplexity)

SuppressWarnings

(PHPMD.NPathComplexity)

applyAlphabetSort()

public applyAlphabetSort(Builder $builder, Model $model) : void
Parameters
$builder : Builder
$model : Model

applyFeatureSort()

public applyFeatureSort(Builder $builder, Model $model) : void
Parameters
$builder : Builder
$model : Model

applyQueryBuilder()

public applyQueryBuilder(Builder $builder) : void
Parameters
$builder : Builder

getAllowSort()

public static getAllowSort() : array<int, string>
Return values
array<int, string>

getAllowSortType()

public static getAllowSortType() : array<int, string>
Return values
array<int, string>

getAlphabetSortColumn()

public getAlphabetSortColumn() : string
Return values
string

getFeatureSortColumn()

public getFeatureSortColumn() : string
Return values
string

getSort()

public getSort() : string
Return values
string

getSortType()

public getSortType() : string
Return values
string

likeOperator()

return the case-insensitive LIKE operator bases on the current database driver.

public likeOperator() : string
Return values
string

rules()

public static rules() : array<string|int, string>
Return values
array<string|int, string>

setSort()

public setSort(string $sort) : self
Parameters
$sort : string
Return values
self

setSortType()

public setSortType(string $sortType) : self
Parameters
$sortType : string
Return values
self

sortTypes()

public static sortTypes() : array<string|int, string>
Return values
array<string|int, string>

alias()

protected alias(string $table, string $column) : string
Parameters
$table : string
$column : string
Return values
string

        
On this page

Search results