PHP Class Mgallegos\LaravelJqgrid\Repositories\EloquentRepositoryAbstract

Inheritance: implements Mgallegos\LaravelJqgrid\Repositories\RepositoryInterface
显示文件 Open project: mgallegos/laravel-jqgrid

Protected Properties

Property Type Description
$Database Database
$leafColumn String Leaf Column Name (TreeGrid Property)
$orderBy array OrderBy
$parentColumn String Parent Column Name (TreeGrid Property)
$treeGrid boolean Tree Grid Flag
$visibleColumns Array Visible columns

Public Methods

Method Description
getRows ( integer $limit, integer $offset, string $orderBy = null, string $sord = null, array $filters = [], string $nodeId = null, string $nodeLevel = null, boolean $exporting ) : array Get the rows data to be shown in the grid.
getTotalNumberOfRows ( array $filters = [] ) : integer Calculate the number of rows. It's used for paging the result.

Method Details

getRows() public method

Get the rows data to be shown in the grid.
public getRows ( integer $limit, integer $offset, string $orderBy = null, string $sord = null, array $filters = [], string $nodeId = null, string $nodeLevel = null, boolean $exporting ) : array
$limit integer Number of rows to be shown into the grid
$offset integer Start position
$orderBy string Column name to order by.
$sord string Sorting order
$filters array An array of filters, example: array(array('field'=>'column index/name 1','op'=>'operator','data'=>'searched string column 1'), array('field'=>'column index/name 2','op'=>'operator','data'=>'searched string column 2')) The 'field' key will contain the 'index' column property if is set, otherwise the 'name' column property. The 'op' key will contain one of the following operators: '=', '<', '>', '<=', '>=', '<>', '!=','like', 'not like', 'is in', 'is not in'. when the 'operator' is 'like' the 'data' already contains the '%' character in the appropiate position. The 'data' key will contain the string searched by the user.
$nodeId string Node id (used only when the treeGrid option is set to true)
$nodeLevel string Node level (used only when the treeGrid option is set to true)
$exporting boolean Flag that determines if the data will be exported (used only when the treeGrid option is set to true)
return array An array of array, each array will have the data of a row. Example: array(array("column1" => "1-1", "column2" => "1-2"), array("column1" => "2-1", "column2" => "2-2"))

getTotalNumberOfRows() public method

Calculate the number of rows. It's used for paging the result.
public getTotalNumberOfRows ( array $filters = [] ) : integer
$filters array An array of filters, example: array(array('field'=>'column index/name 1','op'=>'operator','data'=>'searched string column 1'), array('field'=>'column index/name 2','op'=>'operator','data'=>'searched string column 2')) The 'field' key will contain the 'index' column property if is set, otherwise the 'name' column property. The 'op' key will contain one of the following operators: '=', '<', '>', '<=', '>=', '<>', '!=','like', 'not like', 'is in', 'is not in'. when the 'operator' is 'like' the 'data' already contains the '%' character in the appropiate position. The 'data' key will contain the string searched by the user.
return integer Total number of rows

Property Details

$Database protected_oe property

Database
protected $Database

$leafColumn protected_oe property

Leaf Column Name (TreeGrid Property)
protected String $leafColumn
return String

$orderBy protected_oe property

OrderBy
protected array $orderBy
return array

$parentColumn protected_oe property

Parent Column Name (TreeGrid Property)
protected String $parentColumn
return String

$treeGrid protected_oe property

Tree Grid Flag
protected bool $treeGrid
return boolean

$visibleColumns protected_oe property

Visible columns
protected Array $visibleColumns
return Array