فهرست منبع

added p5:links in WfsBiAudit

Piotr Labudda 8 سال پیش
والد
کامیت
1fc786f9b9
1فایلهای تغییر یافته به همراه20 افزوده شده و 0 حذف شده
  1. 20 0
      SE/se-lib/Route/WfsBiAudit.php

+ 20 - 0
SE/se-lib/Route/WfsBiAudit.php

@@ -270,6 +270,10 @@ public function objectStructView($item) {
 				} else if (is_array($value) && false !== strpos($fieldName, ':')) {
 					$this->addRootXmlnsTablePrefix($fieldName);
 
+					// <default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person xlink:href="https://biuro.biall-net.pl/wfs/default_db/BI_audit_KRS_person#BI_audit_KRS_person.366064"/>
+					// <p5:links>
+					//  <p5:next p5:typeName="default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person" ...
+					// </p5:links>
 					foreach ($value as $refKey => $refValue) {
 						if (is_array($refValue) && 1 === count($refValue) && !empty($refValue['xlink'])) {
 							list($refPrefix, $refBaseName) = explode(':', $fieldName);
@@ -278,6 +282,22 @@ public function objectStructView($item) {
 							$this->addAttribute($xlink, 'xlink:href', $refValue['xlink']); // "https://biuro.biall-net.pl/wfs/default_db/{$refBaseTable}#{$refBaseName}.{$row['REMOTE_ID']}");
 						} else if (is_array($refValue) && empty($refValue)) {
 							// skip empty array
+						} else if (is_array($refValue) && 1 === count($refValue) && !empty($refValue['p5:links'])) {
+							$p5LinkNode = $this->addChild($dataNode, 'p5:links');
+							foreach ($refValue['p5:links'] as $p5LinkKey => $p5LinkValue) {
+								if ('p5:next' === $p5LinkKey) {
+									$p5NextLinkNode = $this->addChild($p5LinkNode, 'p5:next', $p5LinkValue['value']);
+									foreach ($p5LinkValue as $p5NextKey => $p5NextValue) {
+										if ('@' === $p5NextKey[0]) {
+											$this->addAttribute($p5NextLinkNode, "p5:" . substr($p5NextKey, 1), $p5NextValue);
+										} else {
+											// skip
+										}
+									}
+								} else {
+									$this->addChild($dataNode, $fieldName, "<!-- TODO 'p5:links/{$p5LinkKey}': " . str_replace('&', '&amp;', var_export($p5LinkValue, true)) . " -->");
+								}
+							}
 						} else {
 							$this->addChild($dataNode, $fieldName, "<!-- TODO add info ref ({$refKey}): " . str_replace('&', '&amp;', var_export($refValue, true)) . " -->");
 						}