Przeglądaj źródła

updated WPS getRelations response and fixed ACL::fetchRefs

Piotr Labudda 8 lat temu
rodzic
commit
4f04df3af2
2 zmienionych plików z 10 dodań i 1 usunięć
  1. 2 1
      SE/se-lib/ACL.php
  2. 8 0
      SE/se-lib/Api/Process/P5/GetRelations.php

+ 2 - 1
SE/se-lib/ACL.php

@@ -453,11 +453,12 @@ class ACL {
 			return DB::getPDO()->fetchValue(" select count(*) as cnt from `{$refTable}` where PRIMARY_KEY = :primary_key and A_STATUS not in ('DELETED') ", [ ':primary_key' => $primaryKey ]);
 		}
 
-		return DB::getPDO()->fetchAll("
+		return DB::getPDO()->fetchValuesList("
 			select REMOTE_PRIMARY_KEY
 			from `{$refConf->tableName}`
 			where PRIMARY_KEY = :primaryKey
 				and A_STATUS not in ('DELETED')
+			group by REMOTE_PRIMARY_KEY
 		", [ ':primaryKey' => $primaryKey ]);
 		// TODO: order by SORT_PRIO
 	}

+ 8 - 0
SE/se-lib/Api/Process/P5/GetRelations.php

@@ -30,6 +30,14 @@ class Api_Process_P5_GetRelations { // TODO: extends Api_ProcessBase
 			'type' => "success",
 			'msg' => "done",
 			'body' => [
+				'relationSource' => [
+					'namespace' => Api_WfsNs::toNamespace($typeName),
+					'primaryKey' => $primaryKey,
+					'featureID' => Api_WfsNs::toTypeName($typeName) . ".{$primaryKey}",
+				],
+				'relationTarget' => [
+					'typeName' => Api_WfsNs::toTypeName($remoteTypeName),
+				],
 				'total' => $totalRelations,
 				'relations' => $listRelations,
 				// 'total' => $total,