Adds a action name to the list of actions the worker listens to.

@param Action $action

@return Worker
551439
public function addAction($action)
    {
        if ($action instanceof Action) {
            $action = $action->getName();
        }
        $this->actionList[] = $action;
        $this->valid = null;

        return $this;
    }
599565
public function addPostAction($action)
    {
        $mbAction = new MbAction($this->shortcodeAction()->getMbPage(), $this->getName());

        $mbAction->setShortcode(true)->actionResolver($action);

        $this->shortcodePostAction = $mbAction;

        return $this;
    }
1344994
public function setAction($action)
    {
        if (gettype($action) !== 'string') {
            throw new BadParametersException(
                sprintf(
                    ' The action type ("%s") must be a string',
                    gettype($action)
                )
            );
        }
        $this->action = $action;
        return $this;
    }
711575
public function addActions(array $actions)
    {
        collect($actions)->each(function ($action) {
            $this->addAction($action);
        });

        return $this;
    }
1094752
public function withAction(string $action): self
    {
        $this->action = AuditActionEnum::ensureValid($action);
        return $this;
    }
1329148
protected function addApiVersion(string $action): string
    {
        if (mb_strpos($action, 'api.') === 0) {
            $action = preg_replace('/^api\./u', 'api-v'.$this->App::REST_ACTION_API_VERSION.'.', $action);
        }
        return $action; // With an API version.
    }
1338908
public function addAction(array $action)
    {
        $actions = $this->getAction();

        $actions[] = $action;

        return $this->setAction($actions);
    }
1187627
public function check($action = 'resource')
    {
        $this->setCurrentAction($action)->targets->each(function (
            Target $target
        ) {
            $target->check($target);
        });

        $this->notify();

        return $this;
    }
1200033
public function setAction($action)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($action) {
            if ($tab instanceof FormInterface) {
                $tab->setAction($action);
            }
        });

        return $this;
    }
784114
public function actionify($action)
    {
        if (false !== ($pos = strrpos($action, '.'))) {
            $action = substr($action, $pos + 1);
        }

        // if this is a service rather than just a controller name, the suffix
        // Action is not automatically appended to the method name
        if (false === strpos($this->baseControllerName, ':')) {
            $action .= 'Action';
        }

        return lcfirst(str_replace(' ', '', ucwords(strtr($action, '_-', '  '))));
    }
1073678
private static function getActionName(string $action): string
    {
        if ($action === '') {
            return 'index';
        }

        if (in_array(strtolower($action), self::$magicActionMethods)) {
            return '_' . $action;
        }

        return $action;
    }
1116029
public function addJSAction($action)
    {
        if (is_array($action)) {
            $this->jsActions = array_merge($action, $this->jsActions);
        } else {
            $this->jsActions[] = $action;
        }
    }
1138401
public function uses($action)
    {
        $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action;

        return $this->setAction(array_merge($this->action, $this->parseAction([
            'uses' => $action,
            'controller' => $action,
        ])));
    }
1357022
public function addIntendedAction($action)
    {
        if (empty($this->current_node->type) || $this->current_node->type == 'welcome') {
            return;
        }

        // If it's ->then() intended action. We'll save next action as id
        if (is_callable($action)) {
            $related = $this->current_node;

            $then_node = $this->persistNode([
                [
                    'type'    => 'callback',
                    'content' => $action,
                ],
            ], 'intended', 'IA#' . $related->id);

            $related->wait = $then_node->id;

            $related->save();
        } else {
            $this->current_node->wait = $action;

            $this->current_node->save();
        }
    }
1298361
public function add($title, BatchAction $action = null)
    {
        $id = $this->actions->count();

        if (func_num_args() == 1) {
            $action = $title;
            $action->setId($id);
        } elseif (func_num_args() == 2) {
            $action->setId($id);
            $action->setTitle($title);
        }

        $this->actions->push($action);

        return $this;
    }
968703
public function all($uri, $action = null)
    {
        $verbs = ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'];

        return $this->addRoute($verbs, $uri, $action);
    }
671364
private function addAction($actionName)
    {
        $template         = $this->templates[$actionName];
        $command          = preg_filter('/^/', '    ', explode(PHP_EOL, strtr($template, ['$actionName' => $actionName])));
        $command          = array_filter($command, function($var){return strlen(trim($var));});
        $command          = implode(PHP_EOL, $command);
        $this->commands[] = $command;
    }