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
160919
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;
	}
817135
public function getResponse()
    {
        if (! $this->_response instanceof LibBaseDispatcherResponse) {
            $this->_response = parent::getResponse();

            if (! $this->_response instanceof LibBaseDispatcherResponse) {
                throw new InvalidArgumentException(
                    'Response: '.get_class($this->_response).' must be an intance of LibBaseDispatcherResponse'
                );
            }

            $this->_response->setRequest($this->getRequest());
        }

        return $this->_response;
    }
429476
public function getEncoder($format)
    {
        if (!$this->supports($format)) {
            throw new \InvalidArgumentException(sprintf("Format '%s' is not supported by ContainerDecoderProvider.", $format));
        }

        return $this->container->get($this->encoders[$format]);
    }
815603
public function getOptionsModel()
    {
        $model = $this->options;

        if (is_string($model)) {
            $model = app($model);
        }

        if (! ($model instanceof Model)) {
            throw new InvalidArgumentException(
                sprintf(
                    'The %s element[%s] options class must be instanced of "%s".',
                    $this->getType(),
                    $this->getName(),
                    Model::class
                )
            );
        }

        return $model;
    }
233403
public function getConverter($attributeName)
    {
        if (!$this->hasConverter($attributeName)) {
            throw new InvalidArgumentException(sprintf('No converter exists for attribute "%s".', $attributeName));
        }

        return $this->lcConverterMap[strtolower($attributeName)];
    }
712955
protected Transformer _newTransformer()
    {
        Transformer  transformer = null;

        if (_stylesheet == null) {
            try {
                transformer = TransformerFactory.newInstance().newTransformer();
            } catch (Exception ex) {
                throw new XmlException( ex );
            }

            return transformer;
        }

        if (_templates == null) {
            _templates = _getTemplates( _stylesheet );
        }

        try {
            transformer = _templates.newTransformer();
                                     //throws TransformerConfigurationException

            if (_params.size() > 0) {
                for (String  name : _params.keySet()) {
                    Object  value = _params.get( name );
                    transformer.setParameter( name, value );
                }
            }
        } catch (Exception ex) {
            throw new XmlException( ex );
        }

        return transformer;
    }
205671
public function obj()
    {
        if ($this->obj === null) {
            $objId   = filter_input(INPUT_GET, 'obj_id', FILTER_SANITIZE_STRING);
            $objType = filter_input(INPUT_GET, 'obj_type', FILTER_SANITIZE_STRING);
            if ($objId && $objType) {
                $obj = $this->modelFactory()->create($objType);
                $obj->load($objId);

                $this->obj = $obj;
            } else {
                throw new InvalidArgumentException('Missing Object Type or ID');
            }
        }

        return $this->obj;
    }
183958
protected function getTransformers()
    {
        $out = [];

        foreach ($this->transformers as $transformer) {
            if ($transformer instanceof Transformer) {
                $out[] = $transformer;
            } else if (is_string($transformer)) {
                $out[] = TransformerLibrary::make($transformer);
            } else {
                throw new LogicException("All transformers must implement " . Transformer::class);
            }
        }

        return $out;
    }
1032074
public function item($model, $transformer = null)
    {

        // Prevent error if include dont work
        // This only returns null
        if ( ! $model ) {
            return $this->formatOutput(null);
        }

        // Check if we should call this function on another transformer
        if ( $transformer ) {
            return $transformer->item( $model );
        }

        // Format output to api
        return $this->formatOutput( $this->callTransform( $model ) );
    }
318326
public function transformPrimitiveResource()
    {
        if (! ($this->resource instanceof Primitive)) {
            throw new InvalidArgumentException(
                'Argument $resource should be an instance of League\Fractal\Resource\Primitive'
            );
        }

        $transformer = $this->resource->getTransformer();
        $data = $this->resource->getData();

        if (null === $transformer) {
            $transformedData = $data;
        } elseif (is_callable($transformer)) {
            $transformedData = call_user_func($transformer, $data);
        } else {
            $transformer->setCurrentScope($this);
            $transformedData = $transformer->transform($data);
        }

        return $transformedData;
    }
724288
public function getIterator()
    {
        // Recursively resolve until we hit a real schema
        //because you can't use get_object_vars on a reference.
        $schema = $this->resolve();
        while ($schema instanceof Reference) {
            $schema = $schema->resolve();
        }

        if (!is_object($schema) && !is_array($schema)) {
            throw new \InvalidArgumentException(
                sprintf('Expected an object or array, got "%s"', gettype($schema))
            );
        }

        return new \ArrayIterator(is_object($schema) ? get_object_vars($schema) : $schema);
    }
27922
public function setTransformer($transformer)
    {
        if (!(new \ReflectionClass($transformer))->implementsInterface(TransformerInterface::class)) {
            throw new InvalidTransformer();
        }

        $this->transformer = $transformer;

        return $this;
    }
668689
public function getValidator()
    {
        if (!($this->validator instanceof ValidatorInterface)) {
            $this->validator = ValidatorHelper::create($this->validator);
        }

        return $this->validator;
    }
225816
public function getSerializer() {
		if(!$this->serializer)
			$this->serializer = new \Asgard\Entity\Serializer;
		return $this->serializer;
	}
1226643
public function getSerializer()
    {
        if (! $this->serializer || ! ($this->serializer instanceof Serializer)) {
            $this->serializer = Serializer::getInstance();
        }

        return $this->serializer;
    }
578845
protected function deserializer()
    {
        if (null === $this->deserializer) {
            $self = $this;
            $this->deserializer = Closure::bind($this->bindDeserializer(), null, $this->class);
        }
        return $this->deserializer;
    }
886442
protected function getTransformer()
    {
        $transformer = null;

        // Check if controller specifies a resource
        if (! is_null(static::$transformer)) {
            $transformer = static::$transformer;
        }

        // Otherwise, check if model is specified
        else {
            // If it is, check if the controller's model specifies the transformer
            if (! is_null(static::$model)) {
                // If it does, use it
                if (! is_null((static::$model)::$transformer)) {
                    $transformer = (static::$model)::$transformer;
                }
            }
        }

        // This is the default transformer, if one is not specified
        if (is_null($transformer)) {
            $transformer = BaseTransformer::class;
        }

        return new $transformer;
    }