Drupal investigation

NormalizerInterface.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Serializer\Normalizer;
  11. /**
  12. * Defines the interface of normalizers.
  13. *
  14. * @author Jordi Boggiano <j.boggiano@seld.be>
  15. */
  16. interface NormalizerInterface
  17. {
  18. /**
  19. * Normalizes an object into a set of arrays/scalars.
  20. *
  21. * @param object $object object to normalize
  22. * @param string $format format the normalization result will be encoded as
  23. * @param array $context Context options for the normalizer
  24. *
  25. * @return array|scalar
  26. */
  27. public function normalize($object, $format = null, array $context = array());
  28. /**
  29. * Checks whether the given class is supported for normalization by this normalizer.
  30. *
  31. * @param mixed $data Data to normalize
  32. * @param string $format The format being (de-)serialized from or into
  33. *
  34. * @return bool
  35. */
  36. public function supportsNormalization($data, $format = null);
  37. }