public function deserialize($serializedPage, $format)
    {
        // check if supported deserialization format
        if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatDeserialization))
            throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedDeserializationFormatException('Invalid SerpPageSerializer $format: supported deserialization formats are JSON and XML.');
        // TODO: typecheck object
        if (!SerpPageSerializerHelper::deserializablePage($serializedPage))
            throw new \Franzip\SerpPageSerializer\Exceptions\RuntimeException('Invalid SerpPageSerializer $serializedPage: you must supply a SerializedSerpPage object to deserialize.');

        $format = strtolower($format);
        $targetClass = self::SERIALIZABLE_OBJECT_PREFIX . strtoupper($format);
        return $this->getSerializer()->deserialize($serializedPage->getContent(), $targetClass, $format);
    }
public function deserialize($serializedPage, $format)
    {
        // check if supported deserialization format
        if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatDeserialization))
            throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedDeserializationFormatException('Invalid SerpPageSerializer $format: supported deserialization formats are JSON and XML.');
        // TODO: typecheck object
        if (!SerpPageSerializerHelper::deserializablePage($serializedPage))
            throw new \Franzip\SerpPageSerializer\Exceptions\RuntimeException('Invalid SerpPageSerializer $serializedPage: you must supply a SerializedSerpPage object to deserialize.');

        $format = strtolower($format);
        $targetClass = self::SERIALIZABLE_OBJECT_PREFIX . strtoupper($format);
        return $this->getSerializer()->deserialize($serializedPage->getContent(), $targetClass, $format);
    }
public function deserialize ( $ serializedPage , $ format ) { // check if supported deserialization format if ( ! SerpPageSerializerHelper :: validFormat ( $ format , self :: $ supportedFormatDeserialization ) ) throw new \ Franzip \ SerpPageSerializer \ Exceptions \ UnsupportedDeserializationFormatException ( 'Invalid SerpPageSerializer $format: supported deserialization formats are JSON and XML.' ) ; // TODO: typecheck object if ( ! SerpPageSerializerHelper :: deserializablePage ( $ serializedPage ) ) throw new \ Franzip \ SerpPageSerializer \ Exceptions \ RuntimeException ( 'Invalid SerpPageSerializer $serializedPage: you must supply a SerializedSerpPage object to deserialize.' ) ; $ format = strtolower ( $ format ) ; $ targetClass = self :: SERIALIZABLE_OBJECT_PREFIX . strtoupper ( $ format ) ; return $ this -> getSerializer ( ) -> deserialize ( $ serializedPage -> getContent ( ) , $ targetClass , $ format ) ; }
Deserialize a serialized page.
YAML deserialization is not currently supported.
@param  SerializedSerpPage   $serializedPage
@param  string               $format
@return SerializableSerpPage
Deserialize a serialized page . YAML deserialization is not currently supported .