TractorCow\Fluent\Forms\CopyLocaleAction
Synopsis
class CopyLocaleAction
extends BaseAction
{
- // constants
- const COPY_TO = 'COPY_TO';
- const COPY_FROM = 'COPY_FROM';
- // members
- protected $otherLocale;
- protected bool $isTo;
- // methods
- public void __construct()
- public void getTitle()
- public void getActions()
- public void handleAction()
- protected mixed appliesToRecord()
- protected GridField_FormAction getButtonAction()
- public void getGroup()
- private bool validateAction()
- // Inherited methods from BaseAction
- protected abstract GridField_FormAction|null getButtonAction()
- protected abstract mixed appliesToRecord()
- public array|null getExtraData()
- public null|string getGroup()
- protected array getRecordAndLocale()
Hierarchy
Constants
Name | Value |
---|---|
COPY_TO | 'COPY_TO' |
COPY_FROM | 'COPY_FROM' |
Members
protected
- $isTo
—
TractorCow\Fluent\Forms\bool
If true, this is "copy to $otherlocale". If false "copy from $otherLocale" - $otherLocale
—
string
Other locale to copy between
Methods
private
- validateAction() — Ensures that action is executed only once and not once per per locale
protected
- appliesToRecord() — Item needs to be translated before it can be published
- getButtonAction()
public
- __construct() — CopyLocaleAction constructor.
- getActions()
- getGroup()
- getTitle()
- handleAction() — Handle an action on the given {@link GridField}.
Inherited from TractorCow\Fluent\Forms\BaseAction
protected
- appliesToRecord() — Check if this item is enabled for the given record in locale
- getButtonAction()
- getRecordAndLocale() — Given a gridfield, and either an ID or record, return a list with both the record being localised, and the locale object