public function setProtocol($protocol)
    {
        if ($protocol instanceof Protocol) {
            $this->protocol = $protocol;
        } elseif (is_array($protocol)) {
            $this->protocol = new Protocol($protocol);
        } else {
            $this->protocol = null;
            trigger_error('Argument must be an object of class Protocol. Data loss!', E_USER_WARNING);
        }

        return $this;
    }