Restagent\Request::data PHP Метод

data() публичный Метод

Set a variable (query param or a data var)
public data ( )
    public function data()
    {
        if (func_num_args() == 1) {
            $args = func_get_arg(0);
            if (!is_array($args)) {
                throw new RestAgentException("If you only pass one argument to data() it must be an array");
            }
            foreach ($args as $name => $value) {
                $this->data[$name] = $value;
            }
            return $this;
        }
        if (func_num_args() == 2) {
            $name = func_get_arg(0);
            $value = func_get_arg(1);
            if (!is_string($name) || !(is_string($value) || is_numeric($value) || is_bool($value))) {
                throw new RestAgentException("If you only pass two arguments to data(), first one must be a string and the second\n                                      one must be: a string, a number, or a boolean");
            }
            $this->data[$name] = $value;
            return $this;
        }
        throw new RestAgentException("data() method only accepts either one or two arguments");
    }