Drupal investigation

SerializerInterface.php 1.0KB

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;
  11. /**
  12. * Defines the interface of the Serializer.
  13. *
  14. * @author Jordi Boggiano <j.boggiano@seld.be>
  15. */
  16. interface SerializerInterface
  17. {
  18. /**
  19. * Serializes data in the appropriate format.
  20. *
  21. * @param mixed $data any data
  22. * @param string $format format name
  23. * @param array $context options normalizers/encoders have access to
  24. *
  25. * @return string
  26. */
  27. public function serialize($data, $format, array $context = array());
  28. /**
  29. * Deserializes data into the given type.
  30. *
  31. * @param mixed $data
  32. * @param string $type
  33. * @param string $format
  34. * @param array $context
  35. *
  36. * @return object
  37. */
  38. public function deserialize($data, $type, $format, array $context = array());
  39. }