public static function createActionQueryString($actionId, string $addon, string $function, array $arguments = array()): string
    {
        if (empty($addon) && empty($function)) {
            TemplateRenderException::throw('Unknown addon and function while trying to create actionable query.');
        }
        
        $origin = Request::getCurrentUrl();
        
        $successDestination = ArrayUtils::getArrayValueForKeyOrDefault($arguments, 'successDestination', $origin);
        $errorDestination = ArrayUtils::getArrayValueForKeyOrDefault($arguments, 'errorDestination', $origin);
        
        $select = new \stdClass();
        
        if (!empty($actionId)) {
            $select->formId = $actionId;
        }
        
        $select->name = $addon;
        $select->method = $function;
        
        $select->successDestination = $successDestination;
        $select->errorDestination = $errorDestination;
        
        $select->origin = $origin;
        $select->arguments = $arguments;
        
        return Security::seal(json_encode($select));
    }