IElementAction

Type
Interface
Namespace
Craft
Extends
Craft\IComponentType
Implemented by
Craft\BaseElementAction, Craft\CopyReferenceTagElementAction, Craft\DeleteAssetsElementAction, Craft\DeleteElementAction, Craft\DeleteUsersElementAction, Craft\DownloadFileElementAction, Craft\EditElementAction, Craft\NewChildElementAction, Craft\RenameFileElementAction, Craft\ReplaceFileElementAction, Craft\SetStatusElementAction, Craft\SuspendUsersElementAction, Craft\UnsuspendUsersElementAction, Craft\ViewElementAction
Since
2.3

Interface IElementAction

See also http://craftcms.com

View source (opens new window)

# Public Methods

Method Description
getClassHandle() Returns the component’s handle, ideally based on the class name.
getConfirmationMessage() Returns a confirmation message that should be displayed before the action is performed.
getMessage() Returns the message that should be displayed to the user after the action is performed.
getName() Returns the component’s name.
getParams() Returns the action’s params model.
getTriggerHtml() Returns the action’s trigger HTML.
isDestructive() Returns whether this action is destructive in nature.
isSelectable() Returns whether this component should be shown when the user is creating a component of this type.
performAction() Performs the action on any elements that match the given criteria.
setParams() Sets the param values.

# getConfirmationMessage()

Returns a confirmation message that should be displayed before the action is performed.

View source (opens new window)

Returns

string (opens new window), null (opens new window) – The confirmation message, if any.

Signature

public abstract string, null getConfirmationMessage ( )

# getMessage()

Returns the message that should be displayed to the user after the action is performed.

View source (opens new window)

Returns

string (opens new window), null (opens new window) – The message that should be displayed to the user.

Signature

public abstract string, null getMessage ( )

# getParams()

Returns the action’s params model.

View source (opens new window)

Returns

Craft\BaseModel – The action’s params model.

Signature

public abstract Craft\BaseModel getParams ( )

# getTriggerHtml()

Returns the action’s trigger HTML.

View source (opens new window)

Returns

string (opens new window), null (opens new window) – The action’s trigger HTML.

Signature

public abstract string, null getTriggerHtml ( )

# isDestructive()

Returns whether this action is destructive in nature.

View source (opens new window)

Returns

boolean (opens new window) – Whether this action is destructive in nature.

Signature

public abstract boolean isDestructive ( )

# performAction()

Performs the action on any elements that match the given criteria.

View source (opens new window)

Arguments

Returns

boolean (opens new window) – Whether the action was performed successfully.

Signature

public abstract boolean performAction ( Craft\ElementCriteriaModel $criteria )

# setParams()

Sets the param values. The values may come as a key/value array, or a {@link BaseModel} object. Either way, this method should store the values on the model that is returned by {@link getParams()}.

View source (opens new window)

Arguments

Returns

null (opens new window)

Signature

public abstract null setParams ( $values )