ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\Xml\Element\Mock Class Reference
+ Inheritance diagram for Sabre\Xml\Element\Mock:
+ Collaboration diagram for Sabre\Xml\Element\Mock:

Public Member Functions

 xmlSerialize (Xml\Writer $writer)
 The serialize method is called during xml writing. More...
 
- Public Member Functions inherited from Sabre\Xml\XmlSerializable
 xmlSerialize (Writer $writer)
 The xmlSerialize method is called during xml writing. More...
 

Static Public Member Functions

static xmlDeserialize (Xml\Reader $reader)
 The deserialize method is called during xml parsing. More...
 
- Static Public Member Functions inherited from Sabre\Xml\XmlDeserializable
static xmlDeserialize (Reader $reader)
 The deserialize method is called during xml parsing. More...
 

Detailed Description

Definition at line 7 of file Mock.php.

Member Function Documentation

◆ xmlDeserialize()

static Sabre\Xml\Element\Mock::xmlDeserialize ( Xml\Reader  $reader)
static

The deserialize method is called during xml parsing.

This method is called statictly, this is because in theory this method may be used as a type of constructor, or factory method.

Often you want to return an instance of the current class, but you are free to return other data as well.

Important note 2: You are responsible for advancing the reader to the next element. Not doing anything will result in a never-ending loop.

If you just want to skip parsing for this element altogether, you can just call $reader->next();

$reader->parseSubTree() will parse the entire sub-tree, and advance to the next element.

Parameters
Xml\Reader$reader
Returns
mixed

Definition at line 53 of file Mock.php.

53  {
54 
55  $reader->next();
56  return 'foobar';
57 
58  }

◆ xmlSerialize()

Sabre\Xml\Element\Mock::xmlSerialize ( Xml\Writer  $writer)

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.

Parameters
Xml\Writer$writer
Returns
void

Definition at line 24 of file Mock.php.

24  {
25 
26  $writer->startElement('{http://sabredav.org/ns}elem1');
27  $writer->write('hiiii!');
28  $writer->endElement();
29 
30  }

The documentation for this class was generated from the following file: