浏览代码

Testowa funkcja do pobierania objektow z CEIDG

Mariusz Muszyński 8 年之前
父节点
当前提交
9542ab7e9f
共有 1 个文件被更改,包括 59 次插入0 次删除
  1. 59 0
      SE/se-lib/Route/TestCeidg.php

+ 59 - 0
SE/se-lib/Route/TestCeidg.php

@@ -0,0 +1,59 @@
+<?php
+
+Lib::loadClass('RouteBase');
+Lib::loadClass('P5');
+Lib::loadClass('Core_AclHelper');
+
+class Route_TestCeidg extends RouteBase {
+
+  public function defaultAction() {
+    UI::gora();
+		UI::startContainer();
+    try {
+      echo UI::h('a', [
+        'class' => "btn btn-primary",
+        'href' => Router::getRoute('Storage')->getLink('objectStruct', ['idStorage'=>36, 'namespace'=>'default_db/BI_audit_CEIDG/BI_audit_CEIDG']),
+      ], "Storage BI_audit_CEIDG");
+
+      $refTableCom = ACL::getRefTable('default_db/BI_audit_CEIDG/BI_audit_CEIDG', 'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania');
+      $refTablePer = ACL::getRefTable('default_db/BI_audit_CEIDG/BI_audit_CEIDG', 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy');
+      echo UI::h('pre', [], "
+        Tabela `{$refTableCom}`: 'default_db/BI_audit_CEIDG/BI_audit_CEIDG' ref do 'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania'
+        Tablea `{$refTablePer}`: 'default_db/BI_audit_CEIDG/BI_audit_CEIDG' ref do 'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy'
+      ");
+
+      $ceidgItems = ACL::getAclByNamespace('default_db/BI_audit_CEIDG/BI_audit_CEIDG')->buildQuery([
+        'cols' => [ // TODO:? propertyName = []
+          'ID',
+          'identyfikatorWpisu',
+          'imie',
+          'nazwisko',
+          'nip',
+          'regon',
+          'firma',
+          'miejscowosc',
+          'ulica',
+          'budynek',
+          'lokal',
+          'kodPocztowy',
+          'poczta',
+          'kraj',
+          'gmina',
+          'powiat',
+          'wojewodztwo',
+          'default_db__x3A__BI_audit_CEIDG_powiazania:BI_audit_CEIDG_powiazania/*', // TODO: '/**' recursive - deep limit?
+          'default_db__x3A__BI_audit_CEIDG_pelnomocnicy:BI_audit_CEIDG_pelnomocnicy/*', // TODO: '/**' recursive - deep limit?
+        ]
+      ])->getItems([
+        'limit' => 10
+      ]);
+      DBG::nicePrint($ceidgItems, '$ceidgItems - limit 10');
+    } catch (Exception $e) {
+      DBG::log($e);
+      UI::alert('danger', $e->getMessage());
+    }
+    UI::endContainer();
+    UI::dol();
+  }
+
+}