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
$when
private
string
$when
$whenColumn
private
string
$whenColumn
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
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
stringgetWhenColumn()
public
getWhenColumn() : string
Return values
stringgetWhenOptions()
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
stringrules()
public
static rules() : array<string|int, string>
Return values
array<string|int, string>setWhen()
public
setWhen(string $when) : self
Parameters
- $when : string
Return values
selfsetWhenColumn()
public
setWhenColumn(string|null $whenColumn) : self
Parameters
- $whenColumn : string|null
Return values
selfalias()
protected
alias(string $table, string $column) : string
Parameters
- $table : string
- $column : string
Return values
stringgetStartOfWeek()
protected
getStartOfWeek() : int