MultiColumn
extends BaseColumn
in package
Multi column: several properties shown in one cell (joined by a separator) with a single search field. The filter searches an OR group over all properties (see {@see \App\UI\Admin\System\Components\DataGridComponent\Filters\TextFilter}).
Table of Contents
Properties
- $filter : ColumnFilter|null
- $hiddenInPickerMode : bool
- $hiddenInReorderMode : bool
- $htmlAttributes : array<string, string>
- $label : string
- $linkDestination : string|null
- Target destination of the link wrapping the cell content; null means no link.
- $linkParams : array<string, string>
- $linkRequiredParams : array<string|int, string>|null
- Names of URL parameters that must be filled (not null / '') after mapping, otherwise the link is not generated. null requires all ({@see getLinkRequiredParams()}).
- $linkTarget : string|null
- $name : string
- $properties : array<string|int, string>
- $renderer : CellRenderer|null
- $separator : string
- $sortable : bool
- $sortBy : string|null
- $treeIndent : bool
- $width : int|null
Methods
- __construct() : mixed
- create() : static
- getFilter() : ColumnFilter|null
- getHtmlAttributes() : array<string, string>
- getLabel() : string
- getLinkDestination() : string|null
- getLinkParams() : array<string, string>
- getLinkRequiredParams() : array<string|int, string>
- Names of URL parameters that must be filled for the link to be generated.
- getLinkTarget() : string|null
- getName() : string
- getProperties() : array<string|int, string>
- Dotted property paths the column works on (filter, value).
- getRenderer() : CellRenderer
- Cell renderer; plain text unless set explicitly.
- getSeparator() : string
- getSortBy() : string|null
- getValue() : mixed
- Cell value for the given row (entity).
- getWidth() : int|null
- hasTreeIndent() : bool
- hideInPickerMode() : static
- The column is hidden when the grid runs in picker mode (selection modal).
- hideInReorderMode() : static
- The column is hidden in the reorder mode (nested drag & drop view).
- isSortable() : bool
- isVisibleInPickerMode() : bool
- isVisibleInReorderMode() : bool
- setFilter() : static
- setHtmlAttribute() : static
- Adds an HTML attribute to the column cell (`<td>` in a flat table, the cell in the tree view).
- setHtmlClass() : static
- Shorthand for {@see setHtmlAttribute()} with the `class` attribute.
- setLabel() : static
- setLink() : static
- Wraps the whole cell content in a link to a presenter action. Works with any renderer (text, name via {@see MultiColumn}, badge, …). Link parameters are mapped from the row properties: `setLink(':Admin:System:User:edit', ['id' => 'id'])` fills URL parameter `id` with the `id` property of the entity.
- setProperties() : static
- setRenderer() : static
- setSeparator() : static
- setSortable() : static
- setSortBy() : static
- Explicit path for ORDER BY; defaults to the first property of the column.
- setTreeIndent() : static
- In tree mode the cell is indented by the record level (typically the name column).
- setWidth() : static
- Column width in percent (CSS class `width-X`).
- resolve() : mixed
Properties
$filter
protected
ColumnFilter|null
$filter
= null
$hiddenInPickerMode
protected
bool
$hiddenInPickerMode
= false
$hiddenInReorderMode
protected
bool
$hiddenInReorderMode
= false
$htmlAttributes
protected
array<string, string>
$htmlAttributes
= []
HTML attribute => value (rendered on the column cell)
$label
protected
string
$label
= ''
$linkDestination
Target destination of the link wrapping the cell content; null means no link.
protected
string|null
$linkDestination
= null
$linkParams
protected
array<string, string>
$linkParams
= []
URL parameter => entity property path
$linkRequiredParams
Names of URL parameters that must be filled (not null / '') after mapping, otherwise the link is not generated. null requires all ({@see getLinkRequiredParams()}).
protected
array<string|int, string>|null
$linkRequiredParams
= null
$linkTarget
protected
string|null
$linkTarget
= null
$name read-only
protected
string
$name
$properties
protected
array<string|int, string>
$properties
= []
$renderer
protected
CellRenderer|null
$renderer
= null
$separator
protected
string
$separator
= ' '
$sortable
protected
bool
$sortable
= false
$sortBy
protected
string|null
$sortBy
= null
$treeIndent
protected
bool
$treeIndent
= false
$width
protected
int|null
$width
= null
Methods
__construct()
public
final __construct(string $name) : mixed
Parameters
- $name : string
create()
public
static create(string $name) : static
Parameters
- $name : string
Return values
staticgetFilter()
public
getFilter() : ColumnFilter|null
Return values
ColumnFilter|nullgetHtmlAttributes()
public
getHtmlAttributes() : array<string, string>
Return values
array<string, string> —HTML attributes of the cell (name => value)
getLabel()
public
getLabel() : string
Return values
stringgetLinkDestination()
public
getLinkDestination() : string|null
Return values
string|nullgetLinkParams()
public
getLinkParams() : array<string, string>
Return values
array<string, string>getLinkRequiredParams()
Names of URL parameters that must be filled for the link to be generated.
public
getLinkRequiredParams() : array<string|int, string>
All mapped parameters unless set explicitly.
Return values
array<string|int, string>getLinkTarget()
public
getLinkTarget() : string|null
Return values
string|nullgetName()
public
getName() : string
Return values
stringgetProperties()
Dotted property paths the column works on (filter, value).
public
getProperties() : array<string|int, string>
Return values
array<string|int, string>getRenderer()
Cell renderer; plain text unless set explicitly.
public
getRenderer() : CellRenderer
Return values
CellRenderergetSeparator()
public
getSeparator() : string
Return values
stringgetSortBy()
public
getSortBy() : string|null
Return values
string|nullgetValue()
Cell value for the given row (entity).
public
getValue(object $entity[, int|null $langId = null ]) : mixed
Parameters
- $entity : object
- $langId : int|null = null
getWidth()
public
getWidth() : int|null
Return values
int|nullhasTreeIndent()
public
hasTreeIndent() : bool
Return values
boolhideInPickerMode()
The column is hidden when the grid runs in picker mode (selection modal).
public
hideInPickerMode([bool $hide = true ]) : static
Parameters
- $hide : bool = true
Return values
statichideInReorderMode()
The column is hidden in the reorder mode (nested drag & drop view).
public
hideInReorderMode([bool $hide = true ]) : static
Parameters
- $hide : bool = true
Return values
staticisSortable()
public
isSortable() : bool
Return values
boolisVisibleInPickerMode()
public
isVisibleInPickerMode() : bool
Return values
boolisVisibleInReorderMode()
public
isVisibleInReorderMode() : bool
Return values
boolsetFilter()
public
setFilter(ColumnFilter|null $filter) : static
Parameters
- $filter : ColumnFilter|null
Return values
staticsetHtmlAttribute()
Adds an HTML attribute to the column cell (`<td>` in a flat table, the cell in the tree view).
public
setHtmlAttribute(string $name, string $value) : static
Can be called repeatedly for more attributes; the same name overwrites the previous value.
class is merged with the internal cell classes (tree indent), other attributes are rendered
unchanged.
setHtmlAttribute('class', 'highlight'), setHtmlAttribute('data-id', '5').
Parameters
- $name : string
- $value : string
Return values
staticsetHtmlClass()
Shorthand for {@see setHtmlAttribute()} with the `class` attribute.
public
setHtmlClass(string $class) : static
Parameters
- $class : string
Return values
staticsetLabel()
public
setLabel(string $label) : static
Parameters
- $label : string
Return values
staticsetLink()
Wraps the whole cell content in a link to a presenter action. Works with any renderer (text, name via {@see MultiColumn}, badge, …). Link parameters are mapped from the row properties: `setLink(':Admin:System:User:edit', ['id' => 'id'])` fills URL parameter `id` with the `id` property of the entity.
public
setLink(string|null $destination[, array<string, string> $params = [] ][, string|null $target = null ][, array<string|int, string>|null $requiredParams = null ]) : static
Do not use on columns whose renderer produces <a> itself (EmailRenderer,
LinkRenderer, toggle, …): the link would be nested and invalid. Use that renderer directly.
$destination === null disables the link, useful for conditional wiring by privilege:
setLink($canEdit ? ':Admin:System:User:edit' : null, …).
$requiredParams says which mapped parameters must be filled (not null / ''), otherwise the
link is not generated; this guards against broken links and a link() crash on a missing id
(id from a null property). Default null requires all parameters; ['id'] only the listed
ones; [] none (the link is always generated, even with null parameters).
Parameters
- $destination : string|null
- $params : array<string, string> = []
-
URL parameter => entity property path
- $target : string|null = null
- $requiredParams : array<string|int, string>|null = null
-
names of required URL parameters (null = all)
Return values
staticsetProperties()
public
setProperties(array<string|int, string> $properties) : static
Parameters
- $properties : array<string|int, string>
-
dotted property paths
Return values
staticsetRenderer()
public
setRenderer(CellRenderer|null $renderer) : static
Parameters
- $renderer : CellRenderer|null
Return values
staticsetSeparator()
public
setSeparator(string $separator) : static
Parameters
- $separator : string
Return values
staticsetSortable()
public
setSortable([bool $sortable = true ]) : static
Parameters
- $sortable : bool = true
Return values
staticsetSortBy()
Explicit path for ORDER BY; defaults to the first property of the column.
public
setSortBy(string|null $sortBy) : static
Parameters
- $sortBy : string|null
Return values
staticsetTreeIndent()
In tree mode the cell is indented by the record level (typically the name column).
public
setTreeIndent([bool $treeIndent = true ]) : static
Parameters
- $treeIndent : bool = true
Return values
staticsetWidth()
Column width in percent (CSS class `width-X`).
public
setWidth(int|null $width) : static
Parameters
- $width : int|null
Return values
staticresolve()
protected
resolve(object $entity, string $path, int|null $langId) : mixed
Parameters
- $entity : object
- $path : string
- $langId : int|null