]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/result/class_DatabaseResult.php
Made lower to upper case:
[core.git] / inc / classes / main / result / class_DatabaseResult.php
index dd2159395a56f349c991c4aba409ed1ca2bf1ef5..f1a8b90e87b3d3ce20e2bb8fd9c3543ed2fa6081 100644 (file)
@@ -124,14 +124,14 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        public function next () {
                // Default is not valid
-               $nextValid = false;
+               $nextValid = FALSE;
 
                // Is the result valid?
                if ($this->valid()) {
                        // Next entry found, so count one up and cache it
                        $this->currentPos++;
                        $this->currentRow = $this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][$this->currentPos];
-                       $nextValid = true;
+                       $nextValid = TRUE;
                } // END - if
 
                // Return the result
@@ -181,18 +181,28 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        public function valid () {
                // By default nothing is valid
-               $isValid = false;
+               $isValid = FALSE;
 
                // Check if 
                if (($this->ifStatusIsOkay()) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][($this->currentPos + 1)])) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][0]))) {
                        // All fine!
-                       $isValid = true;
+                       $isValid = TRUE;
                } // END - if
 
                // Return the result
                return $isValid;
        }
 
+       /**
+        * Returns count of entries
+        *
+        * @return      $isValid Whether the next/rewind entry is valid
+        */
+       public function count () {
+               // Return it
+               return count($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS]);
+       }
+
        /**
         * Determines whether the status of the query was fine (BaseDatabaseBackend::RESULT_OKAY)
         *
@@ -318,10 +328,11 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        /**
         * Adds registration elements to a given dataset instance
         *
-        * @param       $criteriaInstance       An instance of a storeable criteria
+        * @param       $criteriaInstance       An instance of a StoreableCriteria class
+        * @param       $requestInstance        An instance of a Requestable class
         * @return      void
         */
-       public function addElementsToDataSet (StoreableCriteria $criteriaInstance) {
+       public function addElementsToDataSet (StoreableCriteria $criteriaInstance, Requestable $requestInstance = NULL) {
                // Walk only through out-dated columns
                foreach ($this->outDated as $key => $dummy) {
                        // Does this key exist?
@@ -341,7 +352,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        public function find ($key) {
                // By default nothing is found
-               $found = false;
+               $found = FALSE;
 
                // Rewind the pointer
                $this->rewind();
@@ -357,7 +368,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
                        // Is the element there?
                        if (isset($currentEntry[$key])) {
                                // Okay, found!
-                               $found = true;
+                               $found = TRUE;
 
                                // So "cache" it
                                $this->foundValue = $currentEntry[$key];