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