]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/criteria/dataset/class_DataSetCriteria.php
Renamed frontend to backend because it is a backend ...
[core.git] / inc / classes / main / criteria / dataset / class_DataSetCriteria.php
index f342606e89de681a876c35553d509fa7c219e5f0..869a2e1c39af4cf4fdba1c51cfa76efa86acff3a 100644 (file)
@@ -2,10 +2,9 @@
 /**
  * A set of data storeable in databases
  *
- * @see                        DatabaseFrontendInterface - An interface for database frontends (front-end to the application)
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -26,29 +25,24 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
        /**
         * Table name
         */
-       private $tableName = "";
-
-       /**
-        * Table columns (criteria) to store
-        */
-       private $tableColumns = array();
+       private $tableName = '';
 
        /**
         * Unique key
         */
-       private $uniqueKey = "";
+       private $uniqueKey = '';
 
        /**
         * Primary key
         */
-       private $primaryKey = "";
+       private $primaryKey = '';
 
        /**
         * Protected constructor
         *
         * @return      void
         */
-       protected function __construct() {
+       protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -59,7 +53,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * @param       $tableName                      Name of the table
         * @return      $criteriaInstance       An instance of this criteria
         */
-       public final static function createDataSetCriteria ($tableName) {
+       public static final function createDataSetCriteria ($tableName) {
                // Get a new instance
                $criteriaInstance = new DataSetCriteria();
 
@@ -70,30 +64,6 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
                return $criteriaInstance;
        }
 
-       /**
-        * Add criteria
-        *
-        * @param       $criteriaKey    Criteria key
-        * @param       $criteriaValue  Criteria value
-        * @return      void
-        */
-       public function addCriteria ($criteriaKey, $criteriaValue) {
-               $this->tableColumns[(string) $criteriaKey] = $criteriaValue;
-       }
-
-       /**
-        * Add configured criteria
-        *
-        * @param       $criteriaKey    Criteria key
-        * @param       $configEntry    Configuration entry
-        * @return      void
-        */
-       public function addConfiguredCriteria ($criteriaKey, $configEntry) {
-               // Add configuration entry as criteria
-               $value = $this->getConfigInstance()->readConfig($configEntry);
-               $this->addCriteria($criteriaKey, $value);
-       }
-
        /**
         * Setter for table name
         *
@@ -138,16 +108,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria {
         * @return      $uniqueValue    Value of the unique key
         */
        public final function getUniqueValue () {
-               return $this->tableColumns[$this->getUniqueKey()];
-       }
-
-       /**
-        * Getter for criteria array
-        *
-        * @return      $tableColumns
-        */
-       public final function getCriteriaArray () {
-               return $this->tableColumns;
+               return $this->getCriteriaElemnent($this->getUniqueKey());
        }
 
        /**