SerializerInterface.php 792 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Elasticsearch\Serializers;
  3. /**
  4. * Interface SerializerInterface
  5. *
  6. * @category Elasticsearch
  7. * @package Elasticsearch\Serializers
  8. * @author Zachary Tong <zach@elastic.co>
  9. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  10. * @link http://elastic.co
  11. */
  12. interface SerializerInterface
  13. {
  14. /**
  15. * Serialize a complex data-structure into a json encoded string
  16. *
  17. * @param mixed The data to encode
  18. *
  19. * @return string
  20. */
  21. public function serialize($data);
  22. /**
  23. * Deserialize json encoded string into an associative array
  24. *
  25. * @param string $data JSON encoded string
  26. * @param array $headers Response Headers
  27. *
  28. * @return array
  29. */
  30. public function deserialize($data, $headers);
  31. }