PHP Класс Bluz\Grid\Grid

Автор: Anton Shevchuk
Наследование: use trait Bluz\Common\Options, use trait Bluz\Common\Helper
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$adapter instance of Source
$aliases array List of aliases for columns in DB
$allowFilters array Example ['id', 'status' => ['active', 'disable']]
$allowOrders list of allow orders
$controller location of Grid
$data instance of Data
$defaultLimit default value of page limit
$defaultOrder default order
$filters list of filters
$limit limit per page
$module location of Grid
$orders array Example 'first' => 'ASC', 'last' => 'ASC'
$page start from first page
$params custom array params
$prefix unique prefix of grid
$uid unique identification of grid

Открытые методы

Метод Описание
__construct ( array $options = null ) Grid constructor
addAlias ( string $key, string $value ) : void Add alias
addFilter ( string $column, string $filter, string $value ) : void Add filter
addOrder ( string $column, string $order = Grid::ORDER_ASC ) : void Add order rule
addOrders ( array $orders ) : void Add order rules
checkFilter ( string $filter ) : boolean Check filter
getAdapter ( ) : Bluz\Grid\Source\AbstractSource Get source adapter
getAllowFilters ( ) : array Get allow filters
getAllowOrders ( ) : array Get allow orders
getController ( ) : string Get controller
getData ( ) : Bluz\Grid\Data Get data
getDefaultLimit ( ) : integer Get default limit
getDefaultOrder ( ) : array Get default order
getFilter ( string $column, string $filter = null ) : mixed Get filter
getFilters ( ) : array Get filters
getLimit ( ) : integer Get limit per page
getModule ( ) : string Get module
getOrders ( ) : array Get orders
getPage ( ) : integer Get page
getParams ( array $rewrite = [] ) : array Return params prepared for url builder
getPrefix ( ) : string Get prefix
getSettings ( ) : array Get settings
getUid ( ) : string Get unique Grid Id
getUrl ( array $params ) : string Get Url
init ( ) : Grid Initialize Grid
processRequest ( ) : Grid Process request
processSource ( ) : self Process source
setAdapter ( Bluz\Grid\Source\AbstractSource $adapter ) : void Set source adapter
setAliases ( array $aliases ) : void Set aliases
setAllowFilters ( array $filters = [] ) : void Set allowed filters
setAllowOrders ( array $orders = [] ) : void Set allow orders
setController ( string $controller ) : void Set controller
setDefaultLimit ( integer $limit ) : void Set default limit
setDefaultOrder ( string $column, string $order = Grid::ORDER_ASC ) : void Set default order
setLimit ( integer $limit ) : void Set limit per page
setModule ( string $module ) : void Set module
setOrder ( string $column, string $order = Grid::ORDER_ASC ) : void Set order
setOrders ( array $orders ) : void Set orders
setPage ( integer $page = 1 ) : void Set page
setParams ( $params ) : void Setup params

Защищенные методы

Метод Описание
applyAlias ( string $key ) : string Apply Alias

Описание методов

__construct() публичный Метод

Grid constructor
public __construct ( array $options = null )
$options array

addAlias() публичный Метод

Add alias
public addAlias ( string $key, string $value ) : void
$key string
$value string
Результат void

addFilter() публичный Метод

Add filter
public addFilter ( string $column, string $filter, string $value ) : void
$column string
$filter string
$value string
Результат void

addOrder() публичный Метод

Add order rule
public addOrder ( string $column, string $order = Grid::ORDER_ASC ) : void
$column string
$order string
Результат void

addOrders() публичный Метод

Add order rules
public addOrders ( array $orders ) : void
$orders array
Результат void

applyAlias() защищенный Метод

Apply Alias
protected applyAlias ( string $key ) : string
$key string
Результат string

checkFilter() публичный Метод

Check filter
public checkFilter ( string $filter ) : boolean
$filter string
Результат boolean

getAdapter() публичный Метод

Get source adapter
public getAdapter ( ) : Bluz\Grid\Source\AbstractSource
Результат Bluz\Grid\Source\AbstractSource

getAllowFilters() публичный Метод

Get allow filters
public getAllowFilters ( ) : array
Результат array

getAllowOrders() публичный Метод

Get allow orders
public getAllowOrders ( ) : array
Результат array

getController() публичный Метод

Get controller
public getController ( ) : string
Результат string

getData() публичный Метод

Get data
public getData ( ) : Bluz\Grid\Data
Результат Bluz\Grid\Data

getDefaultLimit() публичный Метод

Get default limit
public getDefaultLimit ( ) : integer
Результат integer

getDefaultOrder() публичный Метод

Get default order
public getDefaultOrder ( ) : array
Результат array

getFilter() публичный Метод

Get filter
public getFilter ( string $column, string $filter = null ) : mixed
$column string
$filter string
Результат mixed

getFilters() публичный Метод

Get filters
public getFilters ( ) : array
Результат array

getLimit() публичный Метод

Get limit per page
public getLimit ( ) : integer
Результат integer

getModule() публичный Метод

Get module
public getModule ( ) : string
Результат string

getOrders() публичный Метод

Get orders
public getOrders ( ) : array
Результат array

getPage() публичный Метод

Get page
public getPage ( ) : integer
Результат integer

getParams() публичный Метод

Return params prepared for url builder
public getParams ( array $rewrite = [] ) : array
$rewrite array
Результат array

getPrefix() публичный Метод

Get prefix
public getPrefix ( ) : string
Результат string

getSettings() публичный Метод

Get settings
public getSettings ( ) : array
Результат array

getUid() публичный Метод

Get unique Grid Id
public getUid ( ) : string
Результат string

getUrl() публичный Метод

Get Url
public getUrl ( array $params ) : string
$params array
Результат string

init() абстрактный публичный Метод

Initialize Grid
abstract public init ( ) : Grid
Результат Grid

processRequest() публичный Метод

Example of request url - http://domain.com/pages/grid/ - http://domain.com/pages/grid/page/2/ - http://domain.com/pages/grid/page/2/order-alias/desc/ - http://domain.com/pages/grid/page/2/order-created/desc/order-alias/asc/ with prefix for support more than one grid on page - http://domain.com/users/grid/users-page/2/users-order-created/desc/ - http://domain.com/users/grid/users-page/2/users-filter-status/active/ hash support - http://domain.com/pages/grid/#/page/2/order-created/desc/order-alias/asc/
public processRequest ( ) : Grid
Результат Grid

processSource() публичный Метод

Process source
public processSource ( ) : self
Результат self

setAdapter() публичный Метод

Set source adapter
public setAdapter ( Bluz\Grid\Source\AbstractSource $adapter ) : void
$adapter Bluz\Grid\Source\AbstractSource
Результат void

setAliases() публичный Метод

Set aliases
public setAliases ( array $aliases ) : void
$aliases array
Результат void

setAllowFilters() публичный Метод

Set allowed filters
public setAllowFilters ( array $filters = [] ) : void
$filters array
Результат void

setAllowOrders() публичный Метод

Set allow orders
public setAllowOrders ( array $orders = [] ) : void
$orders array
Результат void

setController() публичный Метод

Set controller
public setController ( string $controller ) : void
$controller string
Результат void

setDefaultLimit() публичный Метод

Set default limit
public setDefaultLimit ( integer $limit ) : void
$limit integer
Результат void

setDefaultOrder() публичный Метод

Set default order
public setDefaultOrder ( string $column, string $order = Grid::ORDER_ASC ) : void
$column string
$order string ASC or DESC
Результат void

setLimit() публичный Метод

Set limit per page
public setLimit ( integer $limit ) : void
$limit integer
Результат void

setModule() публичный Метод

Set module
public setModule ( string $module ) : void
$module string
Результат void

setOrder() публичный Метод

Set order
public setOrder ( string $column, string $order = Grid::ORDER_ASC ) : void
$column string
$order string ASC or DESC
Результат void

setOrders() публичный Метод

Set orders
public setOrders ( array $orders ) : void
$orders array
Результат void

setPage() публичный Метод

Set page
public setPage ( integer $page = 1 ) : void
$page integer
Результат void

setParams() публичный Метод

Setup params
public setParams ( $params ) : void
$params
Результат void

Описание свойств

$adapter защищенное свойство

instance of Source
protected $adapter

$aliases защищенное свойство

List of aliases for columns in DB
protected array $aliases
Результат array

$allowFilters защищенное свойство

Example ['id', 'status' => ['active', 'disable']]
См. также: Grid::$filters
protected array $allowFilters
Результат array

$allowOrders защищенное свойство

list of allow orders
См. также: Grid::$orders
protected $allowOrders

$controller защищенное свойство

location of Grid
protected $controller

$data защищенное свойство

instance of Data
protected $data

$defaultLimit защищенное свойство

default value of page limit
См. также: Grid::$limit
protected $defaultLimit

$defaultOrder защищенное свойство

default order
См. также: Grid::$orders
protected $defaultOrder

$filters защищенное свойство

list of filters
protected $filters

$limit защищенное свойство

limit per page
protected $limit

$module защищенное свойство

location of Grid
protected $module

$orders защищенное свойство

Example 'first' => 'ASC', 'last' => 'ASC'
protected array $orders
Результат array

$page защищенное свойство

start from first page
protected $page

$params защищенное свойство

custom array params
protected $params

$prefix защищенное свойство

unique prefix of grid
protected $prefix

$uid защищенное свойство

unique identification of grid
protected $uid