1 | <?php |
||
13 | abstract class AbstractElement |
||
14 | { |
||
15 | /** |
||
16 | * @var DOMElement |
||
17 | */ |
||
18 | private $element; |
||
19 | |||
20 | /** |
||
21 | * @var Reader |
||
22 | */ |
||
23 | private $reader; |
||
24 | |||
25 | /** |
||
26 | * @param Reader $reader |
||
27 | * @param DOMElement $element |
||
28 | */ |
||
29 | public function __construct(Reader $reader, DOMElement $element) |
||
30 | { |
||
31 | $this->element = $element; |
||
32 | $this->reader = $reader; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return DOMElement |
||
37 | */ |
||
38 | 1 | public function getElement() |
|
42 | |||
43 | /** |
||
44 | * @param string $name |
||
45 | * @return boolean |
||
46 | */ |
||
47 | public function hasAttribute($name) |
||
48 | { |
||
49 | return $this->element->hasAttribute($name); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param string $name |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getAttribute($name) |
||
57 | { |
||
58 | return $this->element->getAttribute($name); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @param string $name |
||
63 | * @param mixed $value |
||
64 | */ |
||
65 | 1 | public function setAttribute($name, $value) |
|
66 | { |
||
67 | $this->element->setAttribute($name, $value); |
||
68 | 1 | } |
|
69 | |||
70 | /** |
||
71 | * @param string $name |
||
72 | */ |
||
73 | 1 | public function removeAttribute($name) |
|
74 | { |
||
75 | $this->element->removeAttribute($name); |
||
76 | 1 | } |
|
77 | |||
78 | /** |
||
79 | * @return boolean |
||
80 | */ |
||
81 | public function isDisabled() |
||
82 | { |
||
83 | return $this->element->hasAttribute('disabled'); |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return Reader |
||
88 | */ |
||
89 | 1 | public function getReader() |
|
93 | |||
94 | /** |
||
95 | * @param string $xpath |
||
96 | * @return DOMNodeList |
||
97 | */ |
||
98 | public function getChildren($xpath) |
||
99 | { |
||
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getName() |
||
110 | } |
||
111 |