PHP Класс Msieprawski\ResourceTable\Helpers\Column

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

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

Метод Описание
__construct ( array $data, string $viewName = '' ) Sets column data provided by user with addColumn method
content ( null | stdClass | array $row = null ) : string Returns column content (depends on column configuration)
getDatabaseName ( ) : null | string Returns column's database name
hasRenderer ( ) : boolean Checks whether column has a defined renderer
index ( ) : null | string Returns column index
label ( ) : string Returns column label - to be used by view when rendering table
options ( ) : array Returns column array with options for searchable form
queryConditionType ( ) : string Returns query condition type By default ->where(.
renderer ( stdClass $row ) : mixed Returns renderer result (if exists) or null when not defined
searchType ( ) : string Returns column search type (if valid and provided)
searchable ( ) : boolean Checks if column is searchable
searchableContent ( array $config = [] ) : string Returns HTML with column search field
sortActive ( ) : boolean Checks whether column is active by current sort index
sortDirection ( ) : string Returns current column's sort direction
sortUrl ( ) : string Returns column sort link
sortable ( ) : boolean Checks whether column is sortable

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

Метод Описание
_getSortAnchor ( ) : string Returns column sort anchor (result depends on view name)
_optionsHTML ( ) : string Returns HTML with select options for searchable column
_sortDirection ( ) : string Returns current sort direction (order_dir) Returns default direction if not defined
_sortIndex ( ) : string | null Returns current sort index (order_by)

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

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

Sets column data provided by user with addColumn method
public __construct ( array $data, string $viewName = '' )
$data array
$viewName string - used when calling content method

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

Returns column content (depends on column configuration)
public content ( null | stdClass | array $row = null ) : string
$row null | stdClass | array
Результат string

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

Returns column's database name
public getDatabaseName ( ) : null | string
Результат null | string

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

Checks whether column has a defined renderer
public hasRenderer ( ) : boolean
Результат boolean

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

Returns column index
public index ( ) : null | string
Результат null | string

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

Returns column label - to be used by view when rendering table
public label ( ) : string
Результат string

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

Returns column array with options for searchable form
public options ( ) : array
Результат array

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

. is used You can change it to for example ->having(.. if you used alias
public queryConditionType ( ) : string
Результат string

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

Returns renderer result (if exists) or null when not defined
public renderer ( stdClass $row ) : mixed
$row stdClass
Результат mixed

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

Returns column search type (if valid and provided)
public searchType ( ) : string
Результат string

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

Checks if column is searchable
public searchable ( ) : boolean
Результат boolean

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

Returns HTML with column search field
public searchableContent ( array $config = [] ) : string
$config array
Результат string

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

Checks whether column is active by current sort index
public sortActive ( ) : boolean
Результат boolean

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

Returns current column's sort direction
public sortDirection ( ) : string
Результат string

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

Returns column sort link
public sortUrl ( ) : string
Результат string

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

Checks whether column is sortable
public sortable ( ) : boolean
Результат boolean