class TableActionHandler extends ActionHandlerHelper

Traits

Constants

TRIGGER_DEFAULT

TRIGGER_SELECT_ACTION

TRIGGER_ROW_ACTION

TRIGGER_ALL_ACTION

Methods

addAction(ActionHelper $actionHelper, string $trigger = self::TRIGGER_DEFAULT)

Bind possible action to trigger

addRowAction(ActionHelper $action)

Action for the user per row

addSelectAction(ActionHelper $action)

Actions for the user based on selected table records

addSelectAllAction(ActionHelper $action)

Actions valid for all records in the data object

int
count()

No description

static ItemListTrait
create(ItemInterface ...$items)

No description

ItemInterface|null
first()

Get first element

string|null
getActionHandlerEndpoint()

No description

Collection|null
getCollection()

Return collection if is set

array
getItems()

No description

getIterator()

No description

array
getRegisteredActions(string $trigger)

Return actions that are registered in this handler for a specific trigger

string
getSelectField()

No description

array
getSelectedIds()

Get the selected ids from the table

bool
hasBulkAction()

Do we have a registered Bulk Action?

bool
hasRowAction()

No description

array
jsonSerialize()

No description

ItemInterface|null
last()

Return the last element

bool
offsetExists($offset)

No description

ItemInterface|null
offsetGet($offset)

No description

void
offsetSet($offset, $value)

No description

void
offsetUnset($offset)

No description

int
push(ItemInterface $item)

No description

void
sendFeedbackAsFlashMessages()

Send Feedback Messages

setActionHandlerEndpoint(string|null $actionHandlerEndpoint)

No description

setCollection(Collection $collection)

Set collection for CollectionActionHelper

void
setItems(array $items)

No description

setSelectField(string $field = 'id')

Which table field contains your selection context? (e.g. id for standard model collection)

setSelectedIds(array $selectedIds)

Set the ids which are currently selected in table, this is usually done automatically in the table during action processing

array
toArray()

Transforms the option into an array.

bool|null
triggerAction(string $actionKey = null, string $trigger = self::TRIGGER_DEFAULT)

Execute Actions

int
unshift(ItemInterface $item)

No description

Details

ActionHandlerHelper addAction(ActionHelper $actionHelper, string $trigger = self::TRIGGER_DEFAULT)

Bind possible action to trigger

Parameters

ActionHelper $actionHelper
string $trigger

Return Value

ActionHandlerHelper

at line 54
TableActionHandler addBulkAction(ActionHelper $action)

No description

Parameters

ActionHelper $action

Return Value

TableActionHandler

at line 50
TableActionHandler addRowAction(ActionHelper $action)

Action for the user per row

Parameters

ActionHelper $action

Return Value

TableActionHandler

at line 65
TableActionHandler addSelectAction(ActionHelper $action)

Actions for the user based on selected table records

Parameters

ActionHelper $action

Return Value

TableActionHandler

at line 79
TableActionHandler addSelectAllAction(ActionHelper $action)

Actions valid for all records in the data object

todo: We cannot distinguish between select and bulk in UI currently.. todo: (we should disable actions via JS if ALL records are selected but the operation is not supported and vice versa)

Parameters

ActionHelper $action

Return Value

TableActionHandler

in ItemListTrait at line 147
int count()

No description

Return Value

int

in ItemListTrait at line 37
static ItemListTrait create(ItemInterface ...$items)

No description

Parameters

ItemInterface ...$items

Return Value

ItemListTrait

in ItemListTrait at line 96
ItemInterface|null first()

Get first element

Return Value

ItemInterface|null

in ActionHandlerHelper at line 212
string|null getActionHandlerEndpoint()

No description

Return Value

string|null

in ActionHandlerHelper at line 178
Collection|null getCollection()

Return collection if is set

Return Value

Collection|null

in ItemListTrait at line 57
array getItems()

No description

Return Value

array

in ItemListTrait at line 107
ArrayIterator getIterator()

No description

Return Value

ArrayIterator

in ActionHandlerHelper at line 189
array getRegisteredActions(string $trigger)

Return actions that are registered in this handler for a specific trigger

Parameters

string $trigger

Return Value

array

at line 38
string getSelectField()

No description

Return Value

string

at line 115
array getSelectedIds()

Get the selected ids from the table

Return Value

array

at line 87
bool hasBulkAction()

Do we have a registered Bulk Action?

Return Value

bool

at line 94
bool hasRowAction()

No description

Return Value

bool

in ItemListTrait at line 154
array jsonSerialize()

No description

Return Value

array

in ItemListTrait at line 88
ItemInterface|null last()

Return the last element

Return Value

ItemInterface|null

in ItemListTrait at line 116
bool offsetExists($offset)

No description

Parameters

$offset

Return Value

bool

in ItemListTrait at line 125
ItemInterface|null offsetGet($offset)

No description

Parameters

$offset

Return Value

ItemInterface|null

in ItemListTrait at line 133
void offsetSet($offset, $value)

No description

Parameters

$offset
$value

Return Value

void

in ItemListTrait at line 140
void offsetUnset($offset)

No description

Parameters

$offset

Return Value

void

in ItemListTrait at line 44
int push(ItemInterface $item)

No description

Parameters

ItemInterface $item

Return Value

int

in ActionHandlerHelper at line 120
void sendFeedbackAsFlashMessages()

Send Feedback Messages

Return Value

void

in ActionHandlerHelper at line 204
ActionHandlerHelper setActionHandlerEndpoint(string|null $actionHandlerEndpoint)

No description

Parameters

string|null $actionHandlerEndpoint

Return Value

ActionHandlerHelper

in ActionHandlerHelper at line 168
CollectionActionHandlerInterface setCollection(Collection $collection)

Set collection for CollectionActionHelper

Parameters

Collection $collection

Return Value

CollectionActionHandlerInterface

in ItemListTrait at line 66
void setItems(array $items)

No description

Parameters

array $items

Return Value

void

at line 30
TableActionHandler setSelectField(string $field = 'id')

Which table field contains your selection context? (e.g. id for standard model collection)

Parameters

string $field

Return Value

TableActionHandler

at line 105
TableActionHandler setSelectedIds(array $selectedIds)

Set the ids which are currently selected in table, this is usually done automatically in the table during action processing

Parameters

array $selectedIds

Return Value

TableActionHandler

in ItemListTrait at line 74
array toArray()

Transforms the option into an array.

Return Value

array

at line 123
bool|null triggerAction(string $actionKey = null, string $trigger = self::TRIGGER_DEFAULT)

Execute Actions

Parameters

string $actionKey
string $trigger

Return Value

bool|null

Returns null if no action was executed, True for successful execution, False for error

in ItemListTrait at line 49
int unshift(ItemInterface $item)

No description

Parameters

ItemInterface $item

Return Value

int