Paradox/toolbox/Server.php
public function createAQLFunction($name, $code)
    {
        try {
            $userFunction = new AqlUserFunction($this->_toolbox->getConnection());
            $userFunction->setName($name);
            $userFunction->setCode($code);
            $userFunction->register();
        } catch (\Exception $e) {
            $normalised = $this->_toolbox->normaliseDriverExceptions($e);
            throw new ServerException($normalised['message'], $normalised['code']);
        }

        return true;
    }
public function createAQLFunction($name, $code)
    {
        try {
            $userFunction = new AqlUserFunction($this->_toolbox->getConnection());
            $userFunction->setName($name);
            $userFunction->setCode($code);
            $userFunction->register();
        } catch (\Exception $e) {
            $normalised = $this->_toolbox->normaliseDriverExceptions($e);
            throw new ServerException($normalised['message'], $normalised['code']);
        }

        return true;
    }
Register an AQL function with the server.
@param  string          $name The name of the server
@param  string          $code The javascript code of the function.
@throws ServerException