Example #1
0
 /**
  * The xmlSerialize metod is called during xml writing.
  *
  * Use the $writer argument to write its own xml serialization.
  *
  * An important note: do _not_ create a parent element. Any element
  * implementing XmlSerializble should only ever write what's considered
  * its 'inner xml'.
  *
  * The parent of the current element is responsible for writing a
  * containing element.
  *
  * This allows serializers to be re-used for different element names.
  *
  * If you are opening new elements, you must also close them again.
  *
  * @param Writer $writer
  * @return void
  */
 function xmlSerialize(Xml\Writer $writer)
 {
     $writer->writeCData($this->value);
 }
Example #2
0
 /**
  * The serialize method is called during xml writing.
  *
  * It should use the $writer argument to encode this object into XML.
  *
  * Important note: it is not needed to create the parent element. The
  * parent element is already created, and we only have to worry about
  * attributes, child elements and text (if any).
  *
  * Important note 2: If you are writing any new elements, you are also
  * responsible for closing them.
  *
  * @param XML\Writer $writer
  * @return void
  */
 public function serializeXml(XML\Writer $writer)
 {
     $writer->writeCData($this->value);
 }