public function deserialize($data, $type, $format, array $context = array())
    {
        if ('jsonld' !== $format) {
            throw new UnexpectedValueException('Deserialization for the format ' . $format . ' is not supported');
        }

        $reflectionClass = new \ReflectionClass($type);

        if (null !== ($constructor = $reflectionClass->getConstructor())) {
            if (0 !== $constructor->getNumberOfRequiredParameters()) {
                throw new RuntimeException(
                    'Cannot create an instance of '. $type .
                    ' from serialized data because its constructor has required parameters.'
                );
            }
        }

        return $this->doDeserialize($data, new $type);
    }
public function deserialize($data, $type, $format, array $context = array())
    {
        if ('jsonld' !== $format) {
            throw new UnexpectedValueException('Deserialization for the format ' . $format . ' is not supported');
        }

        $reflectionClass = new \ReflectionClass($type);

        if (null !== ($constructor = $reflectionClass->getConstructor())) {
            if (0 !== $constructor->getNumberOfRequiredParameters()) {
                throw new RuntimeException(
                    'Cannot create an instance of '. $type .
                    ' from serialized data because its constructor has required parameters.'
                );
            }
        }

        return $this->doDeserialize($data, new $type);
    }
public function deserialize ( $ data , $ type , $ format , array $ context = array ( ) ) { if ( 'jsonld' !== $ format ) { throw new UnexpectedValueException ( 'Deserialization for the format ' . $ format . ' is not supported' ) ; } $ reflectionClass = new \ ReflectionClass ( $ type ) ; if ( null !== ( $ constructor = $ reflectionClass -> getConstructor ( ) ) ) { if ( 0 !== $ constructor -> getNumberOfRequiredParameters ( ) ) { throw new RuntimeException ( 'Cannot create an instance of ' . $ type . ' from serialized data because its constructor has required parameters.' ) ; } } return $ this -> doDeserialize ( $ data , new $ type ) ; }
Deserializes data into the given type.

@param mixed  $data
@param string $type
@param string $format
@param array  $context

@return object
Deserializes data into the given type .