Bluz\Grid\Grid
Grid
- Author: Anton Shevchuk
Synopsis
- // constants
- const ORDER_ASC = 'asc';
- const ORDER_DESC = 'desc';
- const FILTER_LIKE = 'like';
- const FILTER_ENUM = 'enum';
- const FILTER_EQ = 'eq';
- const FILTER_NE = 'ne';
- const FILTER_GT = 'gt';
- const FILTER_GE = 'ge';
- const FILTER_LT = 'lt';
- const FILTER_LE = 'le';
- // members
- protected AbstractSource $adapter;
- protected Data $data;
- protected $uid;
- protected string $prefix = '';
- protected $module;
- protected $controller;
- protected array $params = ;
- protected integer $page = 1;
- protected integer $limit = 25;
- protected integer $defaultLimit = 25;
- protected array $orders = ;
- protected $defaultOrder;
- protected array $allowOrders = ;
- protected array $filters = ;
- protected array $allowFilters = ;
- protected array $allowFilterNames = ;
- protected array $aliases = ;
- // methods
- public void __construct()
- public abstract Grid init()
- public void setAdapter()
- public AbstractSource getAdapter()
- public string getUid()
- public string getPrefix()
- public void setModule()
- public string getModule()
- public void setController()
- public string getController()
- public Grid processRequest()
- public Grid processSource()
- public Data getData()
- public array getSettings()
- public void setParams()
- public array getParams()
- public string getUrl()
- public void addAllowOrder()
- public void setAllowOrders()
- public array getAllowOrders()
- protected bool checkOrderColumn()
- protected bool checkOrderName()
- public void addOrder()
- public void addOrders()
- public void setOrder()
- public void setOrders()
- public array getOrders()
- public void addAllowFilter()
- public void setAllowFilters()
- public array getAllowFilters()
- protected bool checkFilterColumn()
- protected bool checkFilterName()
- public void addFilter()
- public mixed getFilter()
- public array getFilters()
- public void addAlias()
- protected string reverseAlias()
- protected string applyAlias()
- public void setPage()
- public int getPage()
- public void setLimit()
- public int getLimit()
- public void setDefaultLimit()
- public int getDefaultLimit()
- public void setDefaultOrder()
- public array getDefaultOrder()
- // Inherited methods from Options
- public mixed getOption()
- public void setOption()
- public array getOptions()
- public Options setOptions()
- protected void initOptions()
- // Inherited methods from Helper
- public void addHelperPath()
- public mixed __call()
Hierarchy
Constants
Name | Value |
---|---|
ORDER_ASC | 'asc' |
ORDER_DESC | 'desc' |
FILTER_LIKE | 'like' |
FILTER_ENUM | 'enum' |
FILTER_EQ | 'eq' |
FILTER_NE | 'ne' |
FILTER_GT | 'gt' |
FILTER_GE | 'ge' |
FILTER_LT | 'lt' |
FILTER_LE | 'le' |
Members
protected
- $adapter — Bluz\Grid\Source\AbstractSource
- $aliases
—
array
List of aliases for columns in DB - $allowFilterNames
—
array
List of allow filter names - $allowFilters
—
array
List of allow filters - $allowOrders — array
- $controller — string
- $data — Bluz\Grid\Data
- $defaultLimit — integer
- $defaultOrder — array
- $filters — array
- $helpers — array
- $helpersPath — array
- $limit — integer
- $module — string
- $options — array
- $orders
—
array
List of orders - $page — integer
- $params — array
- $prefix — string
- $uid — string
Methods
protected
- applyAlias() — Get alias by column name
- checkFilterColumn() — Check filter column
- checkFilterName() — Check filter
- checkOrderColumn() — Check order column
- checkOrderName() — Check order name
- reverseAlias() — Get column name by alias
public
- __construct() — Grid constructor
- addAlias() — Add alias for column name
- addAllowFilter() — Add column name to allow filter it
- addAllowOrder() — Add column name for allow order
- addFilter() — Add filter
- addOrder() — Add order rule
- addOrders() — Add order rules
- getAdapter() — Get source adapter
- getAllowFilters() — Get allow filters
- getAllowOrders() — Get allow orders
- getController() — Get controller
- getData() — Get data
- getDefaultLimit() — Get default limit
- getDefaultOrder() — Get default order
- getFilter() — Get filter
- getFilters() — Get filters
- getLimit() — Get limit per page
- getModule() — Get module
- getOrders() — Get orders
- getPage() — Get page
- getParams() — Return params prepared for url builder
- getPrefix() — Get prefix
- getSettings() — Get settings
- getUid() — Get unique Grid Id
- getUrl() — Get Url
- init() — Initialize Grid
- processRequest() — Process request
- processSource() — Process source
- setAdapter() — Set source adapter
- setAllowFilters() — Set allowed filters
- setAllowOrders() — Set allow orders
- setController() — Set controller
- setDefaultLimit() — Set default limit
- setDefaultOrder() — Set default order
- setLimit() — Set limit per page
- setModule() — Set module
- setOrder() — Set order
- setOrders() — Set orders
- setPage() — Set page
- setParams() — Setup params
Inherited from Bluz\Common\Options
protected
- initOptions() — Check and initialize options in package
public
- getOption() — Get option by key
- getOptions() — Get all options
- setOption() — Set option by key over setter
- setOptions() — Setup, check and init options
Inherited from Bluz\Common\Helper
public
- __call() — Call magic helper
- addHelperPath() — Add helper path
History
-
2017-10-19T14:42:45+00:00 (commit #2d7b561)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small fixes of codestyle
-
2017-10-10T13:57:55+00:00 (commit #d79c0e8)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed Grid reset helper
-
2017-08-01T10:21:18+00:00 (commit #9de2317)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed codestyle
-
2017-08-01T09:44:38+00:00 (commit #b01aa91)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed codestyle
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-21T15:28:30+00:00 (commit #f0410e7)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `join` with `implode`
-
2017-04-21T15:14:44+00:00 (commit #c7538da)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `sizeof` to `count`
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-04-11T08:21:54+00:00 (commit #f9900f1)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small refactoring for call `__DIR__`
-
2017-03-17T16:46:01+00:00 (commit #a11fc78)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated configuration
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`
-
2017-01-30T12:38:53+00:00 (commit #0ab8691)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `AttachmentResponse` Added `attachment($file)` helper for `Controller`