AntAclBase.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * SE/schema/ant-object/default_db.{rootTableName}/{name}/build.xml
  4. */
  5. class AntAclBase extends Core_AclBase {
  6. public $_zasobID = '';
  7. public $_rootTableName = '';
  8. public function __construct($zasobID = 0) {
  9. $this->_zasobID = $zasobID;
  10. }
  11. public function getName() { return $this->_name; }
  12. public function getNamespace() { return 'default_db/' . $this->getName(); }
  13. public function getSourceName() { return 'default_db'; }
  14. public function getRootTableName() { $this->_rootTableName; }
  15. public static function buildInstance($idZasob, $conf = []) {
  16. static $_cache;
  17. if (!$_cache) $_cache = array();
  18. if (array_key_exists($idZasob, $_cache)) {
  19. return $_cache[$idZasob];
  20. }
  21. if (empty($conf)) throw new Exception("Brak danych konfiguracyjnych do obiektu ant nr {$idZasob}");
  22. DBG::nicePrint($conf, 'AntAclBase::buildInstance $conf');
  23. $_cache[$idZasob] = new AntAclBase($idZasob);
  24. // TODO: define field by conf
  25. // TODO: $this->_rootTableName - from namespace
  26. // TODO: need file path
  27. return $_cache[$idZasob];
  28. }
  29. }