Introduce setConfiguredLimit() to SearchCriteria class, this is much better than...
[core.git] / inc / classes / main / criteria / search / class_SearchCriteria.php
index 3a45b7488d41d986390fabc636cddb3998fb1bc9..c85d24412f9eb16be1e3e96b92655fdec957be4e 100644 (file)
@@ -97,6 +97,18 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                $this->limit = $limit;
        }
 
+       /**
+        * "Setter" for limit from a configuration entry
+        *
+        * @param       $configEntry    The configuration entry which hold a number as limit
+        * @return      void
+        */
+       public final function setConfiguredLimit ($configEntry) {
+               // Get the limit from config entry and set it
+               $limit = $this->getConfigInstance()->getConfigEntry($configEntry);
+               $this->setLimit($limit);
+       }
+
        /**
         * Getter for limit
         *