1 | <?php |
||
9 | class OPMLParser implements OPMLInterface |
||
10 | { |
||
11 | /** |
||
12 | * XML content |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $xml; |
||
16 | |||
17 | /** |
||
18 | * Array containing the parsed XML |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $result = []; |
||
22 | |||
23 | /** |
||
24 | * Constructor |
||
25 | * |
||
26 | * @param string $xml is the string we want to parse |
||
27 | * @throws Exceptions\ParseException |
||
28 | */ |
||
29 | public function __construct($xml) |
||
69 | |||
70 | /** |
||
71 | * Parse an XML object as an outline object and return corresponding array |
||
72 | * |
||
73 | * @param SimpleXMLElement $outlineXML the XML object we want to parse |
||
74 | * @return array corresponding to an outline and following format described above |
||
75 | */ |
||
76 | protected function parseOutline(SimpleXMLElement $outlineXML) |
||
94 | |||
95 | /** |
||
96 | * Return the parsed XML as an Array |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | public function getResult() |
||
104 | |||
105 | /** |
||
106 | * Validate the parsed XML array |
||
107 | * Note: The parser support parsing of OPMLs with missing content |
||
108 | * |
||
109 | * @return \SimpleXMLElement|false Validated object on success, false on failure |
||
110 | */ |
||
111 | public function validate() |
||
120 | } |
||
121 |