public function deserializeEntity(array $data, $entityOrClass)
    {
        $context = null;
        if (is_object($entityOrClass)) {
            $context = DeserializationContext::create();
            $context->attributes->set('target', $entityOrClass);
            $context->enableMaxDepthChecks(true);
            $entityOrClass = get_class($entityOrClass);
        }

        return $this->getSerializer()->deserialize(json_encode($data), $entityOrClass, 'json',  $context);
    }
public function deserializeEntity(array $data, $entityOrClass)
    {
        $context = null;
        if (is_object($entityOrClass)) {
            $context = DeserializationContext::create();
            $context->attributes->set('target', $entityOrClass);
            $context->enableMaxDepthChecks(true);
            $entityOrClass = get_class($entityOrClass);
        }

        return $this->getSerializer()->deserialize(json_encode($data), $entityOrClass, 'json',  $context);
    }
public function deserializeEntity ( array $ data , $ entityOrClass ) { $ context = null ; if ( is_object ( $ entityOrClass ) ) { $ context = DeserializationContext :: create ( ) ; $ context -> attributes -> set ( 'target' , $ entityOrClass ) ; $ context -> enableMaxDepthChecks ( true ) ; $ entityOrClass = get_class ( $ entityOrClass ) ; } return $ this -> getSerializer ( ) -> deserialize ( json_encode ( $ data ) , $ entityOrClass , 'json' , $ context ) ; }
Deserialize data into Doctrine entity.

@param string|mixed $item Either a valid Entity class name, or a Doctrine Entity object

@return mixed
Deserialize data into Doctrine entity .