@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getBasePath() |
137 | 137 | { |
138 | - return $this->getModule()->basePath; |
|
138 | + return $this->getModule()->basePath; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | private $_modelBasePath = null; |
@@ -147,16 +147,16 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function getModelBasePath() |
149 | 149 | { |
150 | - if ($this->_modelBasePath === null) { |
|
151 | - return $this->getModule()->basePath; |
|
152 | - } |
|
150 | + if ($this->_modelBasePath === null) { |
|
151 | + return $this->getModule()->basePath; |
|
152 | + } |
|
153 | 153 | |
154 | - return $this->_modelBasePath; |
|
154 | + return $this->_modelBasePath; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | public function setModelBasePath($path) |
158 | 158 | { |
159 | - $this->_modelBasePath = $path; |
|
159 | + $this->_modelBasePath = $path; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -169,23 +169,23 @@ discard block |
||
169 | 169 | */ |
170 | 170 | public function getNamespace() |
171 | 171 | { |
172 | - return $this->getModule()->getNamespace(); |
|
172 | + return $this->getModule()->getNamespace(); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | private $_modelNamespace = null; |
176 | 176 | |
177 | 177 | public function getModelNamespace() |
178 | 178 | { |
179 | - if ($this->_modelNamespace === null) { |
|
180 | - return $this->getModule()->getNamespace(); |
|
181 | - } |
|
179 | + if ($this->_modelNamespace === null) { |
|
180 | + return $this->getModule()->getNamespace(); |
|
181 | + } |
|
182 | 182 | |
183 | - return $this->_modelNamespace; |
|
183 | + return $this->_modelNamespace; |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | public function setModelNamespace($ns) |
187 | 187 | { |
188 | - $this->_modelNamespace = $ns; |
|
188 | + $this->_modelNamespace = $ns; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -200,18 +200,18 @@ discard block |
||
200 | 200 | |
201 | 201 | public function ensureBasePathAndNamespace() |
202 | 202 | { |
203 | - $nsItems = explode('\\', $this->getNamespace()); |
|
204 | - // if there are more namespace paths then one, it means there is space for a sub folder models |
|
205 | - if (count($nsItems) > 1) { |
|
206 | - $items = explode(DIRECTORY_SEPARATOR, $this->getBasePath()); |
|
207 | - $last = array_pop($items); |
|
208 | - // as now we assume we change directory to a subfolder, the removed folder name must be "admin". |
|
209 | - if ($last == 'admin') { |
|
210 | - array_pop($nsItems); |
|
211 | - $this->modelNamespace = implode('\\', $nsItems); |
|
212 | - $this->modelBasePath = implode(DIRECTORY_SEPARATOR, $items); |
|
213 | - } |
|
214 | - } |
|
203 | + $nsItems = explode('\\', $this->getNamespace()); |
|
204 | + // if there are more namespace paths then one, it means there is space for a sub folder models |
|
205 | + if (count($nsItems) > 1) { |
|
206 | + $items = explode(DIRECTORY_SEPARATOR, $this->getBasePath()); |
|
207 | + $last = array_pop($items); |
|
208 | + // as now we assume we change directory to a subfolder, the removed folder name must be "admin". |
|
209 | + if ($last == 'admin') { |
|
210 | + array_pop($nsItems); |
|
211 | + $this->modelNamespace = implode('\\', $nsItems); |
|
212 | + $this->modelBasePath = implode(DIRECTORY_SEPARATOR, $items); |
|
213 | + } |
|
214 | + } |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $this->apiEndpoint, |
423 | 423 | $this->getDbTableShema(), |
424 | 424 | $this->enableI18n |
425 | - ), |
|
425 | + ), |
|
426 | 426 | ]; |
427 | 427 | |
428 | 428 | foreach ($files as $file) { |