PHP Class Devise\Support\Sortable\Sort

Mostra file Open project: devisephp/cms Class Usage Examples

Protected Properties

Property Type Description
$Framework Devise\Support\Framework
$Input Illuminate\Http\Request
$Manager Manager
$defaultOrderBy array

Public Methods

Method Description
__construct ( Manager $Manager, Framework $Framework )
clearSortLink ( string $label = 'Clear Sort', null $options = null ) : string
filter ( $filterName, $elementSelector, array $options = [] ) : string
handleFiltering ( QueryBuilder &$query, Eloquent $model ) : void We process filtering on this query if there is any $this->Input->get() found for dvs-filters this is used in Sortable\Database\Eloquent\Builder.paginate
handleSorting ( QueryBuilder &$query, Model $model ) : void Ads orderBy to the current query in builder
link ( $field, null $label = null, array $options = [] ) : string
setDefaultOrderBy ( string $field, string $dir = 'asc' ) : void Sets the default value of defaultOrderBy

Protected Methods

Method Description
appendSort ( &$query, $model, $sort ) : mixed
belongsTo ( $relation, $query, $model, $orderBy, $direction ) : mixed
getAliasedForeignKey ( $relation, $alias ) : string
get_random_string ( $length, string $valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) : string
hasOne ( $relation, $query, $model, $orderBy, $direction ) : mixed
morphMany ( $relation, $query, $model, $orderBy, $direction ) : mixed
setSelectFromBindings ( $query, $model )
sortByDefault ( $query, $model ) : mixed

Method Details

__construct() public method

public __construct ( Manager $Manager, Framework $Framework )
$Manager Manager
$Framework Devise\Support\Framework

appendSort() protected method

protected appendSort ( &$query, $model, $sort ) : mixed
$query
$model
$sort
return mixed

belongsTo() protected method

protected belongsTo ( $relation, $query, $model, $orderBy, $direction ) : mixed
$relation
$query
$model
$orderBy
$direction
return mixed

filter() public method

public filter ( $filterName, $elementSelector, array $options = [] ) : string
$filterName
$elementSelector
$options array
return string

getAliasedForeignKey() protected method

protected getAliasedForeignKey ( $relation, $alias ) : string
$relation
$alias
return string

get_random_string() protected method

protected get_random_string ( $length, string $valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ) : string
$length
$valid_chars string
return string

handleFiltering() public method

It's magic... really.
public handleFiltering ( QueryBuilder &$query, Eloquent $model ) : void
$query QueryBuilder
$model Eloquent
return void

handleSorting() public method

Ads orderBy to the current query in builder
public handleSorting ( QueryBuilder &$query, Model $model ) : void
$query QueryBuilder
$model Model
return void

hasOne() protected method

protected hasOne ( $relation, $query, $model, $orderBy, $direction ) : mixed
$relation
$query
$model
$orderBy
$direction
return mixed

morphMany() protected method

protected morphMany ( $relation, $query, $model, $orderBy, $direction ) : mixed
$relation
$query
$model
$orderBy
$direction
return mixed

setDefaultOrderBy() public method

Sets the default value of defaultOrderBy
public setDefaultOrderBy ( string $field, string $dir = 'asc' ) : void
$field string
$dir string
return void

setSelectFromBindings() protected method

protected setSelectFromBindings ( $query, $model )
$query
$model

sortByDefault() protected method

protected sortByDefault ( $query, $model ) : mixed
$model
return mixed

Property Details

$Framework protected_oe property

protected Framework,Devise\Support $Framework
return Devise\Support\Framework

$Input protected_oe property

protected Request,Illuminate\Http $Input
return Illuminate\Http\Request

$Manager protected_oe property

protected Manager,Devise\Support\Sortable $Manager
return Manager

$defaultOrderBy protected_oe property

protected array $defaultOrderBy
return array