* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Serializer\Normalizer; use Symfony\Component\Serializer\SerializerAwareInterface; use Symfony\Component\Serializer\SerializerAwareTrait; /** * @author Jordi Boggiano */ class CustomNormalizer implements NormalizerInterface, DenormalizerInterface, SerializerAwareInterface { use ObjectToPopulateTrait; use SerializerAwareTrait; private $cache = array(); /** * {@inheritdoc} */ public function normalize($object, $format = null, array $context = array()) { return $object->normalize($this->serializer, $format, $context); } /** * {@inheritdoc} */ public function denormalize($data, $class, $format = null, array $context = array()) { $object = $this->extractObjectToPopulate($class, $context) ?: new $class(); $object->denormalize($this->serializer, $data, $format, $context); return $object; } /** * Checks if the given class implements the NormalizableInterface. * * @param mixed $data Data to normalize * @param string $format The format being (de-)serialized from or into * * @return bool */ public function supportsNormalization($data, $format = null) { return $data instanceof NormalizableInterface; } /** * Checks if the given class implements the DenormalizableInterface. * * @param mixed $data Data to denormalize from * @param string $type The class to which the data should be denormalized * @param string $format The format being deserialized from * * @return bool */ public function supportsDenormalization($data, $type, $format = null) { if (isset($this->cache[$type])) { return $this->cache[$type]; } if (!class_exists($type)) { return $this->cache[$type] = false; } return $this->cache[$type] = is_subclass_of($type, 'Symfony\Component\Serializer\Normalizer\DenormalizableInterface'); } } __halt_compiler();----SIGNATURE:----SelM6H0w8bBoyQClYZA6KmglA5zJ4SgpTFSfTnqK8n0tyqst3flDOARYZpotRsW56SSG2ez8D7x5QrCiik9AJAmQYhqH3oMrXd1n8Q/AmiphFpjeP8oPkMQaFr9r5IXkX++bzoX/bNqKnNUQV3L5VZdSTRf/XE2TZ8Iaol3qUWpxavQWLpXf94mp0p/ir69XYyNEUqF1v5vq7AW0PPxCPfZ+5WNctI750Q6OUSQDPlUr4AupdZEiBVn/637AgFLkWOn2I0XwITyCQ5onRGADZJ9Mo9Aht0OPP9OugaCjq4nNMvrLXPoaon8IayC29tHMnVZ+7NLIl+I5o88/yRUkQJbjVbDnG40cm5kLvjeHc2ozy7DkKpHs1v6lewHnQktHz8i1ap2LGJmw0vQBvtjH9cArAWPRpbR0qrZ3SuUfWI955s85iHsKYSPKcyn1y3UkFevH9ZjcHDDYocnPwgilUpZ25gaf4mng5mBUXCmULJhYSryRkTdqEgmaZ985BGuHjwweOr86OAdlCENKU67UUhR83BFauISrMV6GgGxbk0OISw7WJa+ZxWCBcqQf5Glj1BWVXMvcG+grkDv3UVCLqCwOAhkX0Q5yn8y5P7EGbDV96jXrrJedlojg3YH0bV5eC5B7wXSILNASEcevDYeMgMPzTW/rUk5TsMLFB2UVqgc=----ATTACHMENT:----NTMyMDExMTc0MzI4NTM3MiA2Njc3ODY0MjA1NzQwOTAgNzMwODg4MTYzODY0MjI0