|
|
@@ -26,6 +26,44 @@ EOT;
|
|
|
die();
|
|
|
}
|
|
|
|
|
|
+ public function objectStructureAction($namespace) { // objectStructAction
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ if (empty($namespace)) throw new Exception("Missing param namespace");
|
|
|
+ $item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
|
|
|
+ $this->objectStructView($item);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ //error_log('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ DBG::log($e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+//input param $item['namespace']='default_db/BI_audit_CEIDG_powiazania/BI_audit_CEIDG_powiazania'
|
|
|
+public function objectStructView($item) {
|
|
|
+ $namespace = $item['namespace'];
|
|
|
+
|
|
|
+ $thisGetLink = [ $this, 'getLink' ];
|
|
|
+
|
|
|
+ $getBackRefList=ACL::getBackRefList($item['namespace']);
|
|
|
+
|
|
|
+ echo "item";
|
|
|
+ print_r($item);
|
|
|
+ echo "thisGetLink";
|
|
|
+ print_r($thisGetLink);
|
|
|
+ echo "getBackRefList";
|
|
|
+
|
|
|
+ print_r($getBackRefList);
|
|
|
+
|
|
|
+
|
|
|
+ //$refTable = ACL::getRefTable($field['objectNamespace'], $field['fieldNamespace']);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
private function addChild($node, $name, $value = null) {
|
|
|
$child = $this->dom->createElement($name, $value);
|
|
|
$node->appendChild($child);
|
|
|
@@ -52,7 +90,11 @@ EOT;
|
|
|
if (in_array($ID, $this->path)) return;
|
|
|
$this->path[] = $ID;
|
|
|
$query = "select `REMOTE_TABLE`, `REMOTE_ID` from `BI_audit_ALL` where `ID` = {$ID}";
|
|
|
- if (!($row = DB::getPDO()->fetchFirst($query))) self::throwServiceException("Błąd danych");
|
|
|
+ if (!($row = DB::getPDO()->fetchFirst($query)))
|
|
|
+ {
|
|
|
+ objectStructureAction('default_db/BI_audit_CEIDG_pelnomocnicy/BI_audit_CEIDG_pelnomocnicy');
|
|
|
+ self::throwServiceException("Błąd danych");
|
|
|
+ }
|
|
|
if (!in_array($row['REMOTE_TABLE'], $this->tablesUsed)) $this->tablesUsed[] = $row['REMOTE_TABLE'];
|
|
|
if ($resolveDepth) {
|
|
|
$feature = $this->addChild($node, "default_db__x3A__{$row['REMOTE_TABLE']}:{$row['REMOTE_TABLE']}");
|