Przeglądaj źródła

fixed query perf for the_geom fields in TableAcl

Piotr Labudda 8 lat temu
rodzic
commit
6d6e67cc71
1 zmienionych plików z 9 dodań i 2 usunięć
  1. 9 2
      SE/se-lib/TableAcl.php

+ 9 - 2
SE/se-lib/TableAcl.php

@@ -1582,8 +1582,9 @@ class TableAcl extends Core_AclBase {
 	}
 
 	public function isGeomField($fldName) {
-		$ds = $this->getDataSource();
-		return $ds->isGeomField($fldName);
+		return ('the_geom' === $fldName);
+		// $ds = $this->getDataSource();
+		// return $ds->isGeomField($fldName);
 	}
 
 	public function getGeomFieldType($fieldName) {
@@ -1933,6 +1934,12 @@ class TableAcl extends Core_AclBase {
 	}
 
 	public function getXsdFieldType($fieldName) {// @returns string - xsd type, TODO: throw Exception when field not found
+		static $_xsdStruct = [];
+		if (array_key_exists($fieldName, $_xsdStruct)) return $_xsdStruct[$fieldName];
+		$_xsdStruct[$fieldName] = $this->_getXsdFieldType($fieldName);
+		return $_xsdStruct[$fieldName];
+	}
+	public function _getXsdFieldType($fieldName) {// @returns string - xsd type, TODO: throw Exception when field not found
 		if ($this->loadSchema()) {
 			$schemaType = $this->_schemaClass->getType($fieldName);
 			if ($schemaType) return $schemaType;