public function setTransformer($transformer)
    {
        if ($transformer !== null) {
            if (!$this->isValidTransformer($transformer)) {
                throw new InvalidTransformerException('Transformer must be a callable or implement TransformerInterface');
            }
        }

        $this->transformer = $transformer;

        return $this;
    }
public function setTransformer($transformer)
    {
        if ($transformer !== null) {
            if (!$this->isValidTransformer($transformer)) {
                throw new InvalidTransformerException('Transformer must be a callable or implement TransformerInterface');
            }
        }

        $this->transformer = $transformer;

        return $this;
    }
public function setTransformer ( $ transformer ) { if ( $ transformer !== null ) { if ( ! $ this -> isValidTransformer ( $ transformer ) ) { throw new InvalidTransformerException ( 'Transformer must be a callable or implement TransformerInterface' ) ; } } $ this -> transformer = $ transformer ; return $ this ; }
Set the transformer.

@param callable|TransformerInterface|null $transformer

@throws InvalidTransformerException

@return $this
Set the transformer .