public function setMode($mode)
    {
        $validModes = array(
            self::MODE_INTERN,
            self::MODE_URI,
            self::MODE_EMAIL,
            self::MODE_NONE,
        );

        if (!in_array($mode, $validModes)) {
            throw new \InvalidArgumentException('Unknown value for ats mode.');
        }

        $this->mode = $mode;

        return $this;
    }