@@ -197,15 +197,33 @@ private function resolveUrlReference($urlIn, $entityObjects)
197
197
{
198
198
$ urlOut = $ urlIn ;
199
199
$ matchedParams = [];
200
+ // Find all the params ({}) references
200
201
preg_match_all ("/[{](.+?)[}]/ " , $ urlIn , $ matchedParams );
201
202
202
203
if (!empty ($ matchedParams )) {
203
204
foreach ($ matchedParams [0 ] as $ paramKey => $ paramValue ) {
205
+ $ paramEntityParent = "" ;
206
+ $ matchedParent = [];
207
+ $ dataItem = $ matchedParams [1 ][$ paramKey ];
208
+ // Find all the parent property (Type.key) references, assuming there will be only one
209
+ // parent property reference within one param
210
+ preg_match_all ("/(.+?)\./ " , $ dataItem , $ matchedParent );
211
+
212
+ if (!empty ($ matchedParent ) && !empty ($ matchedParent [0 ])) {
213
+ $ paramEntityParent = $ matchedParent [1 ][0 ];
214
+ $ dataItem = preg_replace ('/^ ' .$ matchedParent [0 ][0 ].'/ ' , '' , $ dataItem );
215
+ }
216
+
204
217
foreach ($ entityObjects as $ entityObject ) {
205
- $ param = $ entityObject ->getDataByName (
206
- $ matchedParams [1 ][$ paramKey ],
207
- EntityDataObject::CEST_UNIQUE_VALUE
208
- );
218
+ $ param = null ;
219
+
220
+ if ($ paramEntityParent === "" || $ entityObject ->getType () == $ paramEntityParent ) {
221
+ $ param = $ entityObject ->getDataByName (
222
+ $ dataItem ,
223
+ EntityDataObject::CEST_UNIQUE_VALUE
224
+ );
225
+ }
226
+
209
227
if (null !== $ param ) {
210
228
$ urlOut = str_replace ($ paramValue , $ param , $ urlOut );
211
229
continue ;
0 commit comments