XmlDeserializable.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. namespace Sabre\Xml;
  4. /**
  5. * Implementing the XmlDeserializable interface allows you to use a class as a
  6. * deserializer for a specific element.
  7. *
  8. * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/).
  9. * @author Evert Pot (http://evertpot.com/)
  10. * @license http://sabre.io/license/ Modified BSD License
  11. */
  12. interface XmlDeserializable
  13. {
  14. /**
  15. * The deserialize method is called during xml parsing.
  16. *
  17. * This method is called statically, this is because in theory this method
  18. * may be used as a type of constructor, or factory method.
  19. *
  20. * Often you want to return an instance of the current class, but you are
  21. * free to return other data as well.
  22. *
  23. * You are responsible for advancing the reader to the next element. Not
  24. * doing anything will result in a never-ending loop.
  25. *
  26. * If you just want to skip parsing for this element altogether, you can
  27. * just call $reader->next();
  28. *
  29. * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
  30. * the next element.
  31. */
  32. public static function xmlDeserialize(Reader $reader);
  33. }