Преглед изворни кода

fixed missing getItem in AntAclBase

Piotr Labudda пре 8 година
родитељ
комит
6381250c9a
1 измењених фајлова са 7 додато и 3 уклоњено
  1. 7 3
      SE/se-lib/AntAclBase.php

+ 7 - 3
SE/se-lib/AntAclBase.php

@@ -243,9 +243,9 @@ class AntAclBase extends Core_AclBase {
 		$instanceTable = ACL::getInstanceTable($this->_namespace);
 		$sqlPrimaryKey = $this->getSqlPrimaryKeyField();
 		return DB::getPDO()->fetchValue(" -- getTotal({$this->_namespace})
-		select count(1)
-		from `{$this->_rootTableName}` t
-		join `{$instanceTable}` i on(i.pk = t.{$sqlPrimaryKey} and i.idInstance = {$idInstance})
+			select count(1)
+			from `{$this->_rootTableName}` t
+			join `{$instanceTable}` i on(i.pk = t.{$sqlPrimaryKey} and i.idInstance = {$idInstance})
 		");
 	}
 	public function getItems($params = []) {
@@ -283,6 +283,10 @@ class AntAclBase extends Core_AclBase {
 			->execute();
 	}
 
+	public function getItem($primaryKey, $params = []) {
+		return $this->buildQuery($params)->getItem($primaryKey);
+	}
+
 	public static function buildInstance($idZasob, $conf = []) {
 		static $_cache;
 		if (!$_cache) $_cache = array();