1<?php 2 3namespace Sabre\Xml; 4 5/** 6 * Objects implementing XmlSerializable can control how they are represented in 7 * Xml. 8 * 9 * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/). 10 * @author Evert Pot (http://evertpot.com/) 11 * @license http://sabre.io/license/ Modified BSD License 12 */ 13interface XmlSerializable { 14 15 /** 16 * The xmlSerialize method is called during xml writing. 17 * 18 * Use the $writer argument to write its own xml serialization. 19 * 20 * An important note: do _not_ create a parent element. Any element 21 * implementing XmlSerializble should only ever write what's considered 22 * its 'inner xml'. 23 * 24 * The parent of the current element is responsible for writing a 25 * containing element. 26 * 27 * This allows serializers to be re-used for different element names. 28 * 29 * If you are opening new elements, you must also close them again. 30 * 31 * @param Writer $writer 32 * @return void 33 */ 34 function xmlSerialize(Writer $writer); 35 36} 37