@brief Adds "action" with correct format and parameters to current object.

@param string $action Action type
@param array $actionParams Action parameters

@return boolean False if unsuccessful
@return array Array of currently stored actions in object
549375
public function addAction($action, $actionParams)
    {
        // check if valid rule usage for object_type_id
        $this->validateRule("Actions", $action);
        // get required parameters for specific rule
        $requiredParams = Actions::GetRequiredParams($action);
        // checking for missing and invalid parameters
        $exception = false;
        if ($action == Actions::PING_URL)
        {
            $exception = true;
        }
        $check_params = $this->_checkParams($requiredParams, $actionParams, $exception);
        // if no missing or invalid rule parameters
        if ($check_params)
        {
            $rule = $action;
            // special formatting for ping_url
            if ($action == Actions::PING_URL)
            {
                $formatted = $this->_formatParams($actionParams, "::");
                $this->_actions[] = $action . "(" . $formatted . ")";

                return $this->_actions;
            }
            // general formatting for actions
            $value = $this->_formatParams($actionParams);
            $formatted = "(" . $value . ")";
            $this->_actions[] = $rule . $formatted;

            return $this->_actions;
        }
        return false;
    }
140299
public function hasAction($action) {
    if (!parent::hasAction($action)) {
      if (
        ($this->hasMethod($action.'GET')) || ($this->hasMethod($action.'POST')) || ($this->hasMethod($action.'DELETE')) || ($this->hasMethod($action.'PUT')) || ($this->hasMethod($action.'PATCH'))
      ) {
        return true;
      }
    }
    return parent::hasAction($action);
  }
1060909
public function setActionParameters($action, array $parameters): void
    {
        if ('submit_button' === $action) {
            $this->setSubmitButton(
                array_merge(
                    $this->getSubmitButton(),
                    [
                        'route_parameters' => $parameters,
                    ]
                )
            );

            return;
        }
        if ('reset_button' === $action) {
            $this->setResetButton(
                array_merge(
                    $this->getResetButton(),
                    [
                        'route_parameters' => $parameters,
                    ]
                )
            );

            return;
        }
        $this->setAction(
            $action,
            array_merge(
                $this->getAction($action),
                [
                    'route_parameters' => $parameters,
                ]
            )
        );
    }
734543
public function setAction($action) {
		
		if(false === is_string($action)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($action)), E_USER_ERROR);
		}

		$this -> action = $action;
	}
337687
public function setAction($action)
    {
        $this->action = is_string($action) ? $action : $this->$action;
        $this->prepareUrl();

        return $this;
    }
226325
public function dispatch($action, array $parameters = [])
    {
        return $this->server->dispatch(
            new Request($action, $parameters)
        )->getData();
    }
731556
protected function forwardAction ($action, $params=array())
    {
        // Get controller public name
        $ctrlPubName = \Teon\Base\Stdlib\ClassUtils::getPublicControllerName(get_class($this));

        // Get original parameters
        $paramsOrig = $this->params()->fromRoute();

        // Combine parameters - if action is explicitly specified in params it is overriden
        $params2pass = array_merge(
            $paramsOrig,
            $params,
            array('action' => $action)
        );

        // Do the forward
        return $this->forward()->dispatch($ctrlPubName, $params2pass);
    }
461560
private function formatAction(Action $action)
    {
        $info = [
            'envelope' => 'JSON-RPC-2.0',
            'transport' => 'POST',
            'name' => $action->getName(),
            'description' => $action->getDescription(),
            'parameters' => []
        ];

        foreach ($action->getParameters() as $parameter) {
            $parameterInfo = [
                'name' => $parameter->getName(),
                'type' => $parameter->getType(),
                'description' => $parameter->getDescription(),
                'required' => $parameter->isRequired()
            ];

            if (!$parameter->isRequired()) {
                $parameterInfo['default'] = $parameter->getDefault();
            }

            $info['parameters'][] = $parameterInfo;
        }

        if ($action->getResponse()) {
            $response = $action->getResponse();

            $info['response'] = $response->toArray();
        }

        return $info;
    }
912159
private function createActions($actions)
    {
        $actionBuilders = [];

        foreach ($actions as $action) {
            switch (strtolower($action->type)) {
                case Action::TYPE_POSTBACK:
                    $actionBuilders[] = new PostbackTemplateActionBuilder($action->label, $action->value);
                    break;
                case Action::TYPE_URI:
                    $actionBuilders[] = new UriTemplateActionBuilder($action->label, $action->value);
                    break;
                default:
                    $actionBuilders[] = new MessageTemplateActionBuilder($action->label, $action->value);
            }
        }

        return $actionBuilders;
    }
532871
public function getParams($withActionParams = false)
    {
        return $withActionParams ? array_merge($this->actionParams, $this->params) : $this->params;
    }
362586
public function doCall($action, $params) {
    if (self::$logger->isDebugEnabled()) {
      self::$logger->debug("SoapServer action: ".$action);
      self::$logger->debug($params);
    }
    $authHeader = $this->requestHeader['Security']['UsernameToken'];

    $request = ObjectFactory::getInstance('request');
    $request->setAction('actionSet');
    $request->setFormat('soap');
    $request->setResponseFormat('null');
    $request->setValues([
      'data' => [
        'action1' => [
          'action' => 'login',
          'params' => [
            'user' => $authHeader['Username'],
            'password' => $authHeader['Password']['!']
          ]
        ],
        'action2' => [
          'action' => $action,
          'params' => $params
        ],
        'action3' => [
          'action' => 'logout'
        ]
      ]
    ]);

    // run the application
    $actionResponse = ObjectFactory::getInstance('response');
    try {
      $response = $this->application->run($request);
      if ($response->hasErrors()) {
        $errors = $response->getErrors();
        $this->handleException(new ApplicationException($request, $response, $errors[0]));
      }
      else {
        $responseData = $response->getValue('data');
        $data = $responseData['action2'];
        $actionResponse->setSender($data['controller']);
        $actionResponse->setContext($data['context']);
        $actionResponse->setAction($data['action']);
        $actionResponse->setFormat('soap');
        $actionResponse->setValues($data);
        $formatter = ObjectFactory::getInstance('formatter');
        $formatter->serialize($actionResponse);
        if (self::$logger->isDebugEnabled()) {
          self::$logger->debug($actionResponse->__toString());
        }
      }
    }
    catch (\Exception $ex) {
      $this->handleException($ex);
    }
    return $actionResponse;
  }
265207
public function checkAction( $action, $parameters = array(), $absolute = true )
  {
    try {
      $url = $this->_app['url']->action($action, $parameters, $absolute);
    } catch( InvalidArgumentException $e ) {
      return false;
    }

    return $url;
  }
1338908
public function addAction(array $action)
    {
        $actions = $this->getAction();

        $actions[] = $action;

        return $this->setAction($actions);
    }
1071946
public function getActionResult($action = null)
    {
        $result = $this->results;

        if (!empty($action)) {
            $result = $this->results[$action];
        }

        return $result;
    }
1134843
protected function buildUri(Actions\ActionsInterface $action, array $requestParams)
    {
        $uri = $this->connection->getEndpoint() . '/' . $action->getAction();

        if ($this->connection->getHttpMethod() === Request::METHOD_GET) {
            $uri .= '?' . http_build_query($requestParams);
        }

        return new Uri($uri);
    }
115562
public function execute($action, array $parameters = []) {
        $result = null;
        if (is_string($action)) {
            $actionParts = explode("@", $action);
            $controllerClass = $actionParts[0];
            $controllerMethodName = sizeof($actionParts) > 1 ? $actionParts[1] : "index";
            $controller = Controllers::get($controllerClass);
            if ($controller == null) {
                throw new ActionNotFoundException ( "Controller \"$controllerClass\" not found !!");
            }
            if (method_exists($controller, $controllerMethodName)) {
                $controllerMethodParams = $this->getParameterValues(new ReflectionMethod($controller, $controllerMethodName), $parameters);
                $result = call_user_func_array([$controller, $controllerMethodName], $controllerMethodParams);
            }
            else {
                throw new ActionNotFoundException ("Method \"$controllerMethodName\" not found in controller \"$controllerClass\" !!");
            }
        }
        else if (is_callable($action)) {
            $actionParams = $this->getParameterValues(new ReflectionFunction($action), $parameters);
            $result = call_user_func_array($action, $actionParams);
        }
        return $result;
    }
239043
public function amOnAction($action, $params = [])
    {
        $route = $this->getRouteByAction($action);
        $absolute = !is_null($route->domain());
        $url = $this->app['url']->action($action, $params, $absolute);

        $this->amOnPage($url);
    }