src/Traits/Transformations.php
protected function getTransformerFromClassProperty()
	{
		if (! isset($this->transformer) || ! $this->isTransformer($this->transformer)) {
			throw new \InvalidArgumentException('You cannot transform the entity without providing a valid Transformer. Verify your transformer extends ' . TransformerAbstract::class);
		}


		return (is_a($this->transformer, TransformerAbstract::class, true) && ! is_object($this->transformer)) ?
			new $this->transformer : $this->transformer;
	}
protected function getTransformerFromClassProperty()
	{
		if (! isset($this->transformer) || ! $this->isTransformer($this->transformer)) {
			throw new \InvalidArgumentException('You cannot transform the entity without providing a valid Transformer. Verify your transformer extends ' . TransformerAbstract::class);
		}


		return (is_a($this->transformer, TransformerAbstract::class, true) && ! is_object($this->transformer)) ?
			new $this->transformer : $this->transformer;
	}
protected function getTransformerFromClassProperty ( ) { if ( ! isset ( $ this -> transformer ) || ! $ this -> isTransformer ( $ this -> transformer ) ) { throw new \ InvalidArgumentException ( 'You cannot transform the entity without providing a valid Transformer. Verify your transformer extends ' . TransformerAbstract :: class ) ; } return ( is_a ( $ this -> transformer , TransformerAbstract :: class , true ) && ! is_object ( $ this -> transformer ) ) ? new $ this -> transformer : $ this -> transformer ; }
Gets the transformer from the class and validates it's a correct serializer.

@throws \InvalidArgumentException - If the class property does not set a proper Transformer.

@return TransformerAbstract
Gets the transformer from the class and validates it s a correct serializer .