public function setEncoder($name, $encoder = null)
    {
        if (!isset($encoder)) {
            $encoder = '\OtherCode\Rest\Modules\Encoders\\' . strtoupper($name) . 'Encoder';
        }

        if (class_exists($encoder, true)) {
            $this->registerModule($name, new $encoder($this->request), 'before');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Encoder ' . $name . ' not found!');
        }
        return $this;
    }
public function setEncoder($name, $encoder = null)
    {
        if (!isset($encoder)) {
            $encoder = '\OtherCode\Rest\Modules\Encoders\\' . strtoupper($name) . 'Encoder';
        }

        if (class_exists($encoder, true)) {
            $this->registerModule($name, new $encoder($this->request), 'before');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Encoder ' . $name . ' not found!');
        }
        return $this;
    }
public function setEncoder ( $ name , $ encoder = null ) { if ( ! isset ( $ encoder ) ) { $ encoder = '\OtherCode\Rest\Modules\Encoders\\' . strtoupper ( $ name ) . 'Encoder' ; } if ( class_exists ( $ encoder , true ) ) { $ this -> registerModule ( $ name , new $ encoder ( $ this -> request ) , 'before' ) ; } else { throw new \ OtherCode \ Rest \ Exceptions \ ModuleNotFoundException ( 'Encoder ' . $ name . ' not found!' ) ; } return $ this ; }
Set a new encoder instance
@param string $name Encoder unique name
@param string $encoder Encoder class name with namespace
@throws \OtherCode\Rest\Exceptions\ModuleNotFoundException
@return $this
Set a new encoder instance