Ver Fonte

added AclBase::getDatabaseID()

Piotr Labudda há 8 anos atrás
pai
commit
ebce24bf38
2 ficheiros alterados com 4 adições e 0 exclusões
  1. 2 0
      SE/se-lib/AntAclBase.php
  2. 2 0
      SE/se-lib/Core/AclBase.php

+ 2 - 0
SE/se-lib/AntAclBase.php

@@ -13,6 +13,7 @@ class AntAclBase extends Core_AclBase {
     $this->_name = '';
     $this->_namespace = '';
     $this->_rootTableName = '';
+    $this->_db = 0; // database id zasobu
     $this->_rootNamespace = '';
     $this->_primaryKey = '';
     $this->_fields = [];
@@ -202,6 +203,7 @@ class AntAclBase extends Core_AclBase {
     $acl = new AntAclBase($idZasob);
     $acl->_name = $conf['name'];
     $acl->_rootTableName = $conf['_rootTableName'];
+    $acl->_db = $conf['idDatabase'];
     $acl->_namespace = $conf['namespace'];
     $acl->_rootNamespace = str_replace('__x3A__', '/', $conf['nsPrefix']);
     $acl->_fields = $conf['field']; // TODO: lazyLoading - use getFields() in all functions - TODO: use ACL::getObjectFields

+ 2 - 0
SE/se-lib/Core/AclBase.php

@@ -15,6 +15,7 @@ Lib::loadClass('ACL');
 class Core_AclBase {
 
   public $_zasobID = 0;
+  public $_db = 0; // database id zasobu
   public $_rootTableName = null;
 
   public function getNamespace() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
@@ -27,6 +28,7 @@ class Core_AclBase {
   // TODO: get more xsd restrictions like minOccurs, maxOccurs, nillable and restrictions
 
   public function getID() { return $this->_zasobID; }
+  public function getDatabaseID() { return $this->_db; }
   public function init($force = false) { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function isInitialized() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
   public function hasField($fieldName) {// TODO: fix use Core_AclFields or ACL::getObjectFields($namespace) - use cache - one place to store structure