@@ -71,9 +71,7 @@ public function __construct(
71
71
*/
72
72
public function getVars ($ module )
73
73
{
74
- if ($ this ->data === null ) {
75
- $ this ->data = $ this ->read ();
76
- }
74
+ $ this ->setData ();
77
75
return isset ($ this ->data ['vars ' ][$ module ]) ? $ this ->data ['vars ' ][$ module ] : [];
78
76
}
79
77
@@ -86,9 +84,7 @@ public function getVars($module)
86
84
*/
87
85
public function getVarValue ($ module , $ var )
88
86
{
89
- if ($ this ->data === null ) {
90
- $ this ->data = $ this ->read ();
91
- }
87
+ $ this ->setData ();
92
88
if (!isset ($ this ->data ['vars ' ][$ module ])) {
93
89
return false ;
94
90
}
@@ -114,9 +110,7 @@ public function getVarValue($module, $var)
114
110
*/
115
111
public function getMediaEntities ($ module , $ mediaType )
116
112
{
117
- if ($ this ->data === null ) {
118
- $ this ->data = $ this ->read ();
119
- }
113
+ $ this ->setData ();
120
114
return isset ($ this ->data ['media ' ][$ module ][$ mediaType ]) ? $ this ->data ['media ' ][$ module ][$ mediaType ] : [];
121
115
}
122
116
@@ -130,9 +124,7 @@ public function getMediaEntities($module, $mediaType)
130
124
*/
131
125
public function getMediaAttributes ($ module , $ mediaType , $ mediaId )
132
126
{
133
- if ($ this ->data === null ) {
134
- $ this ->data = $ this ->read ();
135
- }
127
+ $ this ->setData ();
136
128
return isset ($ this ->data ['media ' ][$ module ][$ mediaType ][$ mediaId ])
137
129
? $ this ->data ['media ' ][$ module ][$ mediaType ][$ mediaId ]
138
130
: [];
@@ -202,10 +194,15 @@ public function getExcludedDir()
202
194
* @return array
203
195
*/
204
196
protected function getItems ()
197
+ {
198
+ $ this ->setData ();
199
+ return isset ($ this ->data ['exclude ' ]) ? $ this ->data ['exclude ' ] : [];
200
+ }
201
+
202
+ protected function setData ()
205
203
{
206
204
if ($ this ->data === null ) {
207
205
$ this ->data = $ this ->read ();
208
206
}
209
- return isset ($ this ->data ['exclude ' ]) ? $ this ->data ['exclude ' ] : [];
210
207
}
211
208
}
0 commit comments