Drupal investigation

DenormalizerInterface.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 denormalizers.
  13. *
  14. * @author Jordi Boggiano <j.boggiano@seld.be>
  15. */
  16. interface DenormalizerInterface
  17. {
  18. /**
  19. * Denormalizes data back into an object of the given class.
  20. *
  21. * @param mixed $data data to restore
  22. * @param string $class the expected class to instantiate
  23. * @param string $format format the given data was extracted from
  24. * @param array $context options available to the denormalizer
  25. *
  26. * @return object
  27. */
  28. public function denormalize($data, $class, $format = null, array $context = array());
  29. /**
  30. * Checks whether the given class is supported for denormalization by this normalizer.
  31. *
  32. * @param mixed $data Data to denormalize from
  33. * @param string $type The class to which the data should be denormalized
  34. * @param string $format The format being deserialized from
  35. *
  36. * @return bool
  37. */
  38. public function supportsDenormalization($data, $type, $format = null);
  39. }