Let's see if this works better.
authorRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 14:53:34 +0000 (16:53 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 7 Apr 2015 14:53:34 +0000 (16:53 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/criteria/update/class_UpdateCriteria.php

index 9898c1174c1b2f9d3a353117496bbda67d0c05ac..86e67857b732e7d4fe148a13b4a2d4556a26cf48 100644 (file)
@@ -160,7 +160,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
         */
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
         * @return      void
         */
-       public function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') {
+       public final function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') {
                // Make sure no 'my-' or 'my_' passes this point
                assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
                // Make sure no 'my-' or 'my_' passes this point
                assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
index 9e9d6b45bcf2abbc8570bf681051afe1a042fde5..df4470a7211914120079ee322d2eaa65b6cf44d0 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class UpdateCriteria extends BaseCriteria implements LocalUpdateCriteria {
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class UpdateCriteria extends BaseCriteria implements LocalUpdateCriteria {
-       /**
-        * Criteria to handle
-        */
-       private $updateCriteria = array();
-
-       /**
-        * Limitation for the update
-        */
-       private $limit = 0;
-
-       /**
-        * Skip these entries before using them
-        */
-       private $skip = 0;
-
        /**
         * Protected constructor
         *
        /**
         * Protected constructor
         *
@@ -62,40 +47,13 @@ class UpdateCriteria extends BaseCriteria implements LocalUpdateCriteria {
                return $criteriaInstance;
        }
 
                return $criteriaInstance;
        }
 
-       /**
-        * Add criteria, this method converts dashes to underscores because dashes
-        * are not valid for criteria keys.
-        *
-        * @param       $criteriaKey    Criteria key
-        * @param       $criteriaValue  Criteria value
-        * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
-        * @return      void
-        */
-       public function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') {
-               $this->updateCriteria[$criteriaKey] = $criteriaValue;
-       }
-
-       /**
-        * Add configured criteria
-        *
-        * @param       $criteriaKey    Criteria key
-        * @param       $configEntry    Configuration entry
-        * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
-        * @return      void
-        */
-       public function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default') {
-               // Add the configuration entry as a criteria
-               $value = $this->getConfigInstance()->getConfigEntry($configEntry);
-               $this->addCriteria($criteriaKey, $value);
-       }
-
        /**
         * Getter for update criteria array
         *
         * @return      $updateCriteria         Array holding the update criteria
         */
        public final function getUpdateCriteria () {
        /**
         * Getter for update criteria array
         *
         * @return      $updateCriteria         Array holding the update criteria
         */
        public final function getUpdateCriteria () {
-               return $this->updateCriteria;
+               return $this->getCriteriaArray();
        }
 }
 
        }
 }