AntAclBase.php 993 B

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