]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/database/class_BaseDatabaseWrapper.php
Added more methods (required).
[core.git] / inc / classes / main / database / class_BaseDatabaseWrapper.php
index 1f8ad0325598aa8b173eca959c41b3acdabb8a3d..da4fa274322b02beb56d38ea1af863128af981a0 100644 (file)
@@ -149,7 +149,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
 
                // Does this key exists in cache?
-               if ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1)) {
+               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
                        // Debug message
                        /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE));
 
@@ -221,6 +221,20 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                // Return value
                return $primaryKey;
        }
+
+       /**
+        * Removes non-public data from given array.
+        *
+        * @param       $data   An array with possible non-public data that needs to be removed.
+        * @return      $data   A cleaned up array with only public data.
+        */
+       public function removeNonPublicDataFromArray (array $data) {
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('WRAPPER[' . $this->__toString() . ']: Calling this->getDatabaseInstance()->removeNonPublicDataFromArray(data) ...');
+               $data = $this->getDatabaseInstance()->removeNonPublicDataFromArray($data);
+
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('WRAPPER[' . $this->__toString() . ']: data[]=' . gettype($data));
+               return $data;
+       }
 }
 
 // [EOF]