atk4\data\tests\Structure::_set_args PHP Method

_set_args() protected method

Sets value in args array. Doesn't allow duplicate aliases.
protected _set_args ( string $what, string $alias, mixed $value )
$what string Where to set it - table|field
$alias string Alias name
$value mixed Value to set in args array
    protected function _set_args($what, $alias, $value)
    {
        // save value in args
        if ($alias === null) {
            $this->args[$what][] = $value;
        } else {
            // don't allow multiple values with same alias
            if (isset($this->args[$what][$alias])) {
                throw new Exception([ucfirst($what) . ' alias should be unique', 'alias' => $alias]);
            }
            $this->args[$what][$alias] = $value;
        }
    }