PHP 클래스 Bluz\Grid\Grid

저자: Anton Shevchuk
상속: use trait Bluz\Common\Options, use trait Bluz\Common\Helper
파일 보기 프로젝트 열기: bluzphp/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$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