Interface craft\base\ElementActionInterface
- Extends
- craft\base\SavableComponentInterface
- Implemented by
- craft\base\ElementAction, craft\elements\actions\CopyReferenceTag, craft\elements\actions\Delete, craft\elements\actions\DeleteAssets, craft\elements\actions\DeleteUsers, craft\elements\actions\DownloadAssetFile, craft\elements\actions\Edit, craft\elements\actions\EditImage, craft\elements\actions\NewChild, craft\elements\actions\PreviewAsset, craft\elements\actions\RenameFile, craft\elements\actions\ReplaceFile, craft\elements\actions\SetStatus, craft\elements\actions\SuspendUsers, craft\elements\actions\UnsuspendUsers, craft\elements\actions\View
- Available since version
- 3.0
- Source Code
- https://github.com/craftcms/cms/blob/master/src/base/ElementActionInterface.php
ElementActionInterface defines the common interface to be implemented by element action classes.
Method | Description | Defined By |
---|---|---|
afterDelete() |
Performs actions after a component is deleted. | craft\base\SavableComponentInterface |
afterSave() |
Performs actions after a component is saved. | craft\base\SavableComponentInterface |
beforeDelete() |
Performs actions before a component is deleted. | craft\base\SavableComponentInterface |
beforeSave() |
Performs actions before a component is saved. | craft\base\SavableComponentInterface |
displayName() |
Returns the display name of this class. | craft\base\ComponentInterface |
getConfirmationMessage() |
Returns a confirmation message that should be displayed before the action is performed. | craft\base\ElementActionInterface |
getIsNew() |
Returns whether the component is new (unsaved). | craft\base\SavableComponentInterface |
getMessage() |
Returns the message that should be displayed to the user after the action is performed. | craft\base\ElementActionInterface |
getSettings() |
Returns an array of the component’s settings. | craft\base\SavableComponentInterface |
getSettingsHtml() |
Returns the component’s settings HTML. | craft\base\SavableComponentInterface |
getTriggerHtml() |
Returns the action’s trigger HTML. | craft\base\ElementActionInterface |
getTriggerLabel() |
Returns the action’s trigger label. | craft\base\ElementActionInterface |
isDestructive() |
Returns whether this action is destructive in nature. | craft\base\ElementActionInterface |
isSelectable() |
Returns whether the component should be selectable in component Type selects. | craft\base\SavableComponentInterface |
performAction() |
Performs the action on any elements that match the given criteria. | craft\base\ElementActionInterface |
settingsAttributes() |
Returns the list of settings attribute names. | craft\base\SavableComponentInterface |
validate() |
Validates the component. | craft\base\SavableComponentInterface |
Method Details
getConfirmationMessage()
public abstract method
#
Returns a confirmation message that should be displayed before the action is performed.
public abstract string, null getConfirmationMessage ( )
return | string, null | The confirmation message, if any. |
---|
getMessage()
public abstract method
#
Returns the message that should be displayed to the user after the action is performed.
public abstract string, null getMessage ( )
return | string, null | The message that should be displayed to the user. |
---|
getTriggerHtml()
public abstract method
#
Returns the action’s trigger HTML.
public abstract string, null getTriggerHtml ( )
return | string, null | The action’s trigger HTML. |
---|
getTriggerLabel()
public abstract method
#
Returns the action’s trigger label.
public abstract string getTriggerLabel ( )
return | string | The action’s trigger label |
---|
isDestructive()
public abstract static method
#
Returns whether this action is destructive in nature.
public abstract static boolean isDestructive ( )
return | boolean | Whether this action is destructive in nature. |
---|
performAction()
public abstract method
#
Performs the action on any elements that match the given criteria.
public abstract boolean performAction ( craft\elements\db\ElementQueryInterface $query )
$query |
craft\elements\db\ElementQueryInterface | The element query defining which elements the action should affect. |
return | boolean | Whether the action was performed successfully. |
---|