MetaFox

WhenScope extends WhenScope
in package

Class SortScope.

Table of Contents

Constants

WHEN_DEFAULT  = \MetaFox\Platform\Support\Browse\Browse::WHEN_ALL

Properties

$when  : string
$whenColumn  : string

Methods

__construct()  : mixed
apply()  : mixed
Apply when query.
applyQueryBuilder()  : void
getAllowWhen()  : array<int, string>
getWhen()  : string
getWhenColumn()  : string
getWhenOptions()  : array<int, array<string, string>>
likeOperator()  : string
return the case-insensitive LIKE operator bases on the current database driver.
rules()  : array<string|int, string>
setWhen()  : self
setWhenColumn()  : self
alias()  : string
getStartOfWeek()  : int

Constants

WHEN_DEFAULT

public mixed WHEN_DEFAULT = \MetaFox\Platform\Support\Browse\Browse::WHEN_ALL

Properties

Methods

__construct()

public __construct([string|null $when = null ][, string $whenColumn = 'created_at' ]) : mixed
Parameters
$when : string|null = null
$whenColumn : string = 'created_at'

apply()

Apply when query.

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

(PHPMD.UnusedLocalVariable)

applyQueryBuilder()

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

getAllowWhen()

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

getWhen()

public getWhen() : string
Return values
string

getWhenColumn()

public getWhenColumn() : string
Return values
string

getWhenOptions()

public static getWhenOptions() : array<int, array<string, string>>
Return values
array<int, array<string, 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>

setWhen()

public setWhen(string $when) : self
Parameters
$when : string
Return values
self

setWhenColumn()

public setWhenColumn(string|null $whenColumn) : self
Parameters
$whenColumn : string|null
Return values
self

alias()

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

getStartOfWeek()

protected getStartOfWeek() : int
Return values
int

        
On this page

Search results