public function setTransformer($transformer = null)
    {
        if (!$this->resource) {
            throw new MissingResourceException('Resource must be specified before setting a transformer');
        }
        $this->resource->setTransformer($transformer);

        return $this;
    }
public function setTransformer($transformer = null)
    {
        if (!$this->resource) {
            throw new MissingResourceException('Resource must be specified before setting a transformer');
        }
        $this->resource->setTransformer($transformer);

        return $this;
    }
public function setTransformer ( $ transformer = null ) { if ( ! $ this -> resource ) { throw new MissingResourceException ( 'Resource must be specified before setting a transformer' ) ; } $ this -> resource -> setTransformer ( $ transformer ) ; return $ this ; }
Sets the transformer to be used to transform the resource ... later.

@param TransformerInterface|mixed|null $transformer

@throws MissingResourceException

@return $this
Sets the transformer to be used to transform the resource ... later .