| 1 | <?php |
||
| 12 | abstract class AbstractXMLResource |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $path; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var \XMLReader |
||
| 21 | */ |
||
| 22 | private $xml; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The Archive from which the path was extracted. |
||
| 26 | * |
||
| 27 | * A reference to the object is kept here to ensure that it is not deleted |
||
| 28 | * before the RowIterator, as this would remove the extraction folder. |
||
| 29 | * |
||
| 30 | * @var Archive |
||
| 31 | */ |
||
| 32 | private $archive; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Constructor |
||
| 36 | * |
||
| 37 | * @param string $path path to the extracted shared strings XML file |
||
| 38 | * @param Archive|null $archive The Archive from which the path was extracted |
||
| 39 | */ |
||
| 40 | public function __construct($path, Archive $archive = null) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @inheritdoc |
||
| 48 | */ |
||
| 49 | public function __destruct() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Returns the XML reader |
||
| 58 | * |
||
| 59 | * @return \XMLReader |
||
| 60 | */ |
||
| 61 | protected function getXMLReader() |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Creates the XML Reader |
||
| 72 | * |
||
| 73 | * @return \XMLReader |
||
| 74 | */ |
||
| 75 | protected function createXMLReader() |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Closes the XML reader |
||
| 85 | */ |
||
| 86 | protected function closeXMLReader() |
||
| 91 | } |
||
| 92 |