PHP Класс Msieprawski\ResourceTable\Generators\Collection

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Builder $builder ) Sets builder object
addColumn ( array $data ) Adds column to resource table
customView ( string $name ) Sets custom view name for further rendering
filter ( boolean $enabled ) Sets true if filter should be rendered
getSort ( ) : array Returns $_sort variable
make ( ) : string Returns HTML with resource table
page ( integer $page ) Sets $_page variable
paginate ( boolean $paginate ) Sets $_paginate variable
perPage ( integer $perPage ) Sets $_perPage variable
renderFilterForm ( ) : boolean Checks if filter form should be generated
rendererNamespace ( ) : string Returns renderer default namespace
resetFormUrl ( ) : string Returns URL to reset search form
setExtraViewData ( array $data ) Sets extra (custom) view data
setPaginationPresenter ( string $presenter ) Sets $_paginationPresenter object name
setRendererNamespace ( string $namespace ) Set renderer default namespace to prevent long class names
sort ( string $index, string $direction ) Sets sort configuration
view ( string $name ) Sets package view name for further rendering

Приватные методы

Метод Описание
_addQueryCondition ( Builder $builder, string $type, string $columnName, string $operator, string $value ) : Builder Adds condition to the query builder
_getCountForPagination ( Builder $builder ) : integer Returns total results for given query
_getPaginatorPresenter ( array $items ) : mixed Returns Paginator Presenter object if pagination is enabled
_prepareBuilder ( ) Prepares builder object before calling get method on it
_prepareFilterValue ( array $column, mixed $value ) : mixed Basing on column configuration prepares given field value If column configuration has filter function - use it to prepare value
_setView ( string $name, boolean $custom = false ) Sets view name for further rendering
_validSort ( array $params ) : boolean Checks if provided order configuration (from GET) is valid
_validateColumn ( array $data ) : boolean | string Checks if provided column data is valid Returns bool if it's valid Returns string it it's not valid

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

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

Sets builder object
public __construct ( Builder $builder )
$builder Illuminate\Database\Query\Builder

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

Adds column to resource table
public addColumn ( array $data )
$data array

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

Sets custom view name for further rendering
public customView ( string $name )
$name string

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

Sets true if filter should be rendered
public filter ( boolean $enabled )
$enabled boolean

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

Returns $_sort variable
public getSort ( ) : array
Результат array

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

Returns HTML with resource table
public make ( ) : string
Результат string

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

Sets $_page variable
public page ( integer $page )
$page integer

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

Sets $_paginate variable
public paginate ( boolean $paginate )
$paginate boolean

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

Sets $_perPage variable
public perPage ( integer $perPage )
$perPage integer

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

Checks if filter form should be generated
public renderFilterForm ( ) : boolean
Результат boolean

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

Returns renderer default namespace
public rendererNamespace ( ) : string
Результат string

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

Returns URL to reset search form
public resetFormUrl ( ) : string
Результат string

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

Sets extra (custom) view data
public setExtraViewData ( array $data )
$data array

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

Sets $_paginationPresenter object name
public setPaginationPresenter ( string $presenter )
$presenter string

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

Set renderer default namespace to prevent long class names
public setRendererNamespace ( string $namespace )
$namespace string

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

Sets sort configuration
public sort ( string $index, string $direction )
$index string
$direction string

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

Sets package view name for further rendering
public view ( string $name )
$name string