| Total Complexity | 4 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class SimpleXmlManager |
||
| 8 | {
|
||
| 9 | /** |
||
| 10 | * @var object |
||
| 11 | */ |
||
| 12 | protected $xml; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * SimpleXmlManager constructor. |
||
| 16 | * @param $path |
||
| 17 | */ |
||
| 18 | public function __construct($path) |
||
| 19 | {
|
||
| 20 | $this->xml = \simplexml_load_file($path); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * get xml object |
||
| 25 | * |
||
| 26 | * @return object|\SimpleXMLElement |
||
| 27 | */ |
||
| 28 | public function getXml() |
||
| 29 | {
|
||
| 30 | return $this->xml; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Convert XML to an Array |
||
| 35 | * |
||
| 36 | * @return array |
||
| 37 | */ |
||
| 38 | public function toArray() |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Convert Array to an xml |
||
| 47 | * |
||
| 48 | * @param array $data |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | public function toXml($data=array()) |
||
| 54 | } |
||
| 55 | } |