Get or set command action.

@param callable|null $action If provided it is set

@return callable|self If $action provided then self, otherwise the preset action.
508624
public function action(callable $action = null)
    {
        if (\func_num_args() === 0) {
            return $this->_action;
        }

        $this->_action = $action;

        return $this;
    }
550236
public function Link($action = null)
    {
        if (!$action) {
            $action = $this->step;
        }

        return $this->dataRecord->RelativeLink($action);
    }
793503
public function setAction(string $action)
    {
        $string = new CamelCase($action);
        $this->action = $string->camelize();
    }
697539
public function run(callable $action)
    {
        $retryCount = 0;
        $lastException = null;

        do {
            try {
                return $action();
            } catch (Exception $e) {
                $lastException = $e;
                if (!$this->strategy->shouldRetry($e, $retryCount)) {
                    throw $e;
                }
            }
        } while ($this->retries > $retryCount++);

        if ($lastException !== null) {
            throw $lastException;
        }
    }
662276
public function setAction($action)
    {
        if (!$this->validateAction($action)) {
            throw new \RuntimeException("$action: is not a valide Action.");
        }

        $this->action = $action;

        return $this;
    }
1024739
public static function getAroundActions($clazz, $action) {
        $actions = null;
        if (isset(static::$aroundActions[ $clazz ]) && static::$aroundActions[ $clazz ]) {
            $actions = static::buildActions(static::$aroundActions[ $clazz ], $action);
        }
        if ($actions && count($actions) > 0) {
            return $actions[ 0 ];
        }
        return null;
    }
336662
public function link($action = null)
    {
        if ($action) {
            return Controller::join_links($this->link, $action);
        }

        return $this->link;
    }
1245877
protected function parseAction($action)
    {
        if ($action === $this->fullController) {
            return $this->action = null;
        }

        $this->action = strtolower(
            preg_replace(['/^get/', '/^post/', '/^put/', '/^patch/', '/^delete/'], '', $action)
        );
    }
1200033
public function setAction($action)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($action) {
            if ($tab instanceof FormInterface) {
                $tab->setAction($action);
            }
        });

        return $this;
    }
786882
public function dispatchTo($action)
    {
        $this->setAction($action);

        $this->hook->action(
            'init',
            [$this, 'hooks']
        )->dispatch();

        return $this;
    }
126271
public function action($action)
    {
        $a = func_get_args();
        $controllerPath = $this->controller->getControllerActionPath();
        array_unshift($a, $controllerPath);
        $ret = call_user_func_array([$this, 'url'], $a);

        return $ret;
    }
769423
public function action($action, $task = null)
    {
        return $this->app->make(ResolverManagerInterface::class)->resolve(func_get_args());
    }
821589
public function setAction($action)
    {
        foreach ($this->routes as $route)
            $route->setAction($action);
        return $this;
    }
254813
public function action($action = null)
    {
        if ($action === null) {
            return $this->clause('action');
        }

        $this->_parts['action'] = $action;

        return $this;
    }
595612
public function prep($action = null)
    {
        $method = $this->getSetupMethod($action);

        if (!is_null($method)) {
            $method->invokeArgs($this->reflection->newInstance(), array('action' => $action));
        }

        $this->sortParams();
    }
1057918
public function setAction($action)
    {
        $result           = false;
        $actionsAvailable = $this->getActionsInfo();
        if (is_array($actionsAvailable) && array_key_exists($action,
                $actionsAvailable)) {
            $this->action = $action;
            $result       = true;
        }
        return $result;
    }
491559
protected function action($action)
    {
        $action = in_array($action, $this->actions) ? $action : null;
        $action = array_key_exists($action, $this->aliases) ? $this->aliases[$action] : $action;

        return $action;
    }