# Action methods

## \_\_construct( setup ) <a href="#construct" id="construct"></a>

* **`setup`** A hash array with the following possible keys:
  * **`moduleType`** The type of the module that will be called on this action. Actions can call methods on both Core and App modules, but also on Core and App UiComponents.
  * **`moduleName`** The name of the module that will be called for this action.
  * **`methodName`** The name of the method within the module that will be called for this action. This method must return false if he doesn't accepts the request. It can return true or nothing if the request has been accepted.
  * **`request`** The [Request](/version-0.x/reference/core-classes/request.md) that triggers this Action.
  * **`isCache`** Whether this action must be cached or not.
  * **`isSensibleToBruteForceAttacks`** Whether this action is sensible to brute force attacks or not. For example, an action that checks a given password and returns false if the password is incorrect. In such case, this request will sleep for some time when the password is wrong in order to discourage crackers.
  * **`timeout`** When set, this action must have this specific timeout.
  * **`cacheProviderName`** The name of the cache provider to use when caching this action, defaults to the `defaultActionCacheProviderName` config key for the Actions module.
  * **`cacheTtl`** The TTL to use when caching this action, defaults to the `defaultActionCacheTtl` config key for the Actions module.
  * **`cachePrefix`** The cache prefix to use when caching this action, defaults to the `defaultActionCachePrefix` config key for the Actions module.

## clearCache( parameterValues ) <a href="#resetcache" id="resetcache"></a>

Removes this action from cache

* **`parameterValues`** An optional hash array containing the values for the variable path components, parameters and `additionalCacheKeys` involved in this action's [Request](/version-0.x/reference/core-classes/request.md). If not specified, the current parameter values will be used.

## isCli

**Returns:** A boolean indicating whether this Action is intended for a command line request or not


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cherrycake.tin.cat/version-0.x/reference/core-classes/action/methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
