Colymba\BulkManager\BulkAction\Handler
Base class to extend for all custom bulk action handlers Gives access to the GridField, Component and Controller and implements useful functions like {@link getRecordIDList()} and {@link getRecords()}.
- Author: colymba
Synopsis
class Handler
extends RequestHandler
{
- // members
- private static $url_segment = NULL;
- protected GridField $gridField;
- protected GridFieldBulkManager $component;
- protected string $label = 'Action';
- protected string $icon = '';
- protected string $buttonClasses = '';
- protected boolean $xhr = true;
- protected boolean $destructive = false;
- // methods
- public void __construct()
- public array getConfig()
- public RequestHandler setDestructive()
- public boolean getDestructive()
- public RequestHandler setXhr()
- public boolean getXhr()
- public RequestHandler setButtonClasses()
- public string getButtonClasses()
- public RequestHandler setIcon()
- public string getIcon()
- public RequestHandler setLabel()
- public string getLabel()
- public array getI18nLabel()
- public string Link()
- public array getRecordIDList()
- public DataList getRecords()
Hierarchy
Extends
- SilverStripe\Control\RequestHandler
Members
private
- $url_segment
—
string
URL segment used to call this handler If none given, @BulkManager will fallback to the Unqualified class name
protected
- $component
—
Colymba\BulkManager\BulkAction\GridFieldBulkManager
GridFieldBulkManager instance. - $destructive
—
boolean
Set to true is this handler will destroy any data. - $gridField
—
Colymba\BulkManager\BulkAction\GridField
Related GridField instance. - $icon
—
string
Front-end icon path for this handler's action. - $label
—
string
Front-end label for this handler's action - $xhr
—
boolean
Whether this handler should be called via an XHR from the front-end
Methods
public
- __construct()
- Link() — Returns the URL for this RequestHandler.
- getButtonClasses() — Return front-end buttonClasses
- getConfig() — Return front-end configuration
- getDestructive() — True if the hanlder performs destructive actions
- getI18nLabel() — Return i18n localized front-end label
- getIcon() — Return front-end icon
- getLabel() — Return front-end label
- getRecordIDList() — Returns the list of record IDs selected in the front-end.
- getRecords() — Returns a DataList of the records selected in the front-end.
- getXhr() — True if handler is called via XHR
- setButtonClasses() — Set front-end buttonClasses
- setDestructive() — Set if hanlder performs destructive actions
- setIcon() — Set front-end icon
- setLabel() — Set front-end label
- setXhr() — Set if handler is called via XHR