Mark V
1: <?php
2: namespace MOC\V\Component\Document\Component\Bridge\Repository;
3:
4: use MOC\V\Component\Document\Component\Bridge\Bridge;
5: use MOC\V\Component\Document\Component\Exception\ComponentException;
6: use MOC\V\Component\Document\Component\IBridgeInterface;
7: use MOC\V\Component\Document\Component\Parameter\Repository\FileParameter;
8: use MOC\V\Component\Document\Vendor\UniversalXml\Api;
9:
10: /**
11: * Class UniversalXml
12: *
13: * @package MOC\V\Component\Document\Component\Bridge\Repository
14: */
15: class UniversalXml extends Bridge implements IBridgeInterface
16: {
17:
18: /**
19: * @param FileParameter $Location
20: *
21: * @return IBridgeInterface
22: */
23: public function loadFile(FileParameter $Location)
24: {
25:
26: $this->setFileParameter($Location);
27: return $this;
28: }
29:
30: /**
31: * @param null|FileParameter $Location
32: *
33: * @return IBridgeInterface
34: * @throws ComponentException
35: */
36: public function saveFile(FileParameter $Location = null)
37: {
38:
39: // TODO: Implement saveFile() method.
40: throw new ComponentException('saveFile() method not implemented');
41: }
42:
43: /**
44: * @return string
45: */
46: public function getContent()
47: {
48:
49: $Parser = new Api(file_get_contents($this->getFileParameter()->getFile()));
50:
51: return $Parser->parseContent();
52: }
53: }
54: