|
|
@@ -0,0 +1,23 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+class AclQueryItems {
|
|
|
+
|
|
|
+ public function __construct($acl) {
|
|
|
+ $this->_acl = $acl;
|
|
|
+ $this->_params = [];
|
|
|
+ $this->_source = 'default_db';
|
|
|
+ }
|
|
|
+ public function setParams($params) { $this->_params = $params; }
|
|
|
+ public function setSource($sourceName) { $this->_source = $sourceName; }
|
|
|
+ public function setRawSql($sql) { $this->_sql = $sql; }
|
|
|
+ public function fetchAll() {
|
|
|
+ return array_map(array($this, 'buildFeatureFromSqlRow'), DB::getPDO($this->_source)->fetchAll($this->_sql));
|
|
|
+ }
|
|
|
+ public function buildFeatureFromSqlRow($item) {
|
|
|
+ if (method_exists($this->_acl, 'buildFeatureFromSqlRow')) {
|
|
|
+ return $this->_acl->buildFeatureFromSqlRow($item, $this->_params);
|
|
|
+ }
|
|
|
+ return $item;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|