PHP Class Encore\Admin\Grid\Model

Show file Open project: z-song/laravel-admin

Protected Properties

Property Type Description
$data array
$model Illuminate\Database\Eloquent\Model Eloquent model instance of the grid model.
$perPage * 20 items per page as default.
$queries array Array of queries of the eloquent model.
$sort array Sort parameters of the model.

Public Methods

Method Description
__call ( $method, $arguments )
__construct ( Model $model ) Create a new grid model instance.
__get ( $key )
addConditions ( array $conditions ) : void Add conditions to grid model.
buildData ( ) : array Build.
eloquent ( ) : Model Get the eloquent model of the grid model.
getTable ( ) : string Get table of the model.

Protected Methods

Method Description
findQueryByMethod ( $method ) : static Find query by method name.
get ( )
joinParameters ( Illuminate\Database\Eloquent\Relations\Relation $relation ) : array Build join parameters.
setPaginate ( ) : void Set the grid paginate.
setRelationSort ( string $column ) : void Set relation sort.
setSort ( ) : void Set the grid sort.

Method Details

__call() public method

public __call ( $method, $arguments )

__construct() public method

Create a new grid model instance.
public __construct ( Model $model )
$model Illuminate\Database\Eloquent\Model

__get() public method

public __get ( $key )

addConditions() public method

Add conditions to grid model.
public addConditions ( array $conditions ) : void
$conditions array
return void

buildData() public method

Build.
public buildData ( ) : array
return array

eloquent() public method

Get the eloquent model of the grid model.
public eloquent ( ) : Model
return Illuminate\Database\Eloquent\Model

findQueryByMethod() protected method

Find query by method name.
protected findQueryByMethod ( $method ) : static
$method
return static

get() protected method

protected get ( )

getTable() public method

Get table of the model.
public getTable ( ) : string
return string

joinParameters() protected method

Build join parameters.
protected joinParameters ( Illuminate\Database\Eloquent\Relations\Relation $relation ) : array
$relation Illuminate\Database\Eloquent\Relations\Relation
return array

setPaginate() protected method

Set the grid paginate.
protected setPaginate ( ) : void
return void

setRelationSort() protected method

Set relation sort.
protected setRelationSort ( string $column ) : void
$column string
return void

setSort() protected method

Set the grid sort.
protected setSort ( ) : void
return void

Property Details

$data protected property

protected array $data
return array

$model protected property

Eloquent model instance of the grid model.
protected Model,Illuminate\Database\Eloquent $model
return Illuminate\Database\Eloquent\Model

$perPage protected property

* 20 items per page as default.
protected $perPage

$queries protected property

Array of queries of the eloquent model.
protected array $queries
return array

$sort protected property

Sort parameters of the model.
protected array $sort
return array