GroupAction
in package
Action over records marked by a checkbox (buttons in the table footer).
Processing is done by a callback function (array $ids): void; the delete action without
a callback uses the built-in delete through the grid manager.
Plain configuration object: GroupAction::create('delete')->setLabel(…)->….
Table of Contents
Properties
- $callback : callable|null
- $confirm : string|null
- $icon : string|null
- $label : string
- $name : string
- $privilege : string|null
- $variant : string
- $visibleInPickerMode : bool
Methods
- __construct() : mixed
- create() : static
- getCallback() : callable|null
- getConfirm() : string|null
- getIcon() : string|null
- getLabel() : string
- getName() : string
- getPrivilege() : string|null
- getVariant() : string
- isVisibleInPickerMode() : bool
- setCallback() : static
- setConfirm() : static
- setIcon() : static
- setLabel() : static
- setPrivilege() : static
- Privilege action (suffix) that governs this group action, e.g. `del`, `export`.
- setVariant() : static
- showInPickerMode() : static
Properties
$callback
protected
callable|null
$callback
= null
function (array $ids): void
$confirm
protected
string|null
$confirm
= null
$icon
protected
string|null
$icon
= null
$label
protected
string
$label
= ''
$name read-only
protected
string
$name
$privilege
protected
string|null
$privilege
= null
$variant
protected
string
$variant
= 'danger'
$visibleInPickerMode
protected
bool
$visibleInPickerMode
= false
Methods
__construct()
public
final __construct(string $name) : mixed
Parameters
- $name : string
create()
public
static create(string $name) : static
Parameters
- $name : string
Return values
staticgetCallback()
public
getCallback() : callable|null
Return values
callable|nullgetConfirm()
public
getConfirm() : string|null
Return values
string|nullgetIcon()
public
getIcon() : string|null
Return values
string|nullgetLabel()
public
getLabel() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetPrivilege()
public
getPrivilege() : string|null
Return values
string|nullgetVariant()
public
getVariant() : string
Return values
stringisVisibleInPickerMode()
public
isVisibleInPickerMode() : bool
Return values
boolsetCallback()
public
setCallback(callable $callback) : static
Parameters
- $callback : callable
-
function (array $ids): void
Return values
staticsetConfirm()
public
setConfirm(string|null $confirm) : static
Parameters
- $confirm : string|null
Return values
staticsetIcon()
public
setIcon(string|null $icon) : static
Parameters
- $icon : string|null
Return values
staticsetLabel()
public
setLabel(string $label) : static
Parameters
- $label : string
Return values
staticsetPrivilege()
Privilege action (suffix) that governs this group action, e.g. `del`, `export`.
public
setPrivilege(string|null $privilege) : static
The grid composes the full key from the presenter: :Admin:<Module>:<Presenter>:<action>.
Without the privilege the button is not rendered and the submit ends with 403.
NOTE: delete needs no privilege setting, it has one built in (del), see
DataGrid::groupActionPrivilege().
This is for actions with their own callback whose name differs from the privilege
(exportXml → export).
Parameters
- $privilege : string|null
Return values
staticsetVariant()
public
setVariant(string $variant) : static
Parameters
- $variant : string
Return values
staticshowInPickerMode()
public
showInPickerMode() : static