X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcriteria%2Fdataset%2Fclass_DataSetCriteria.php;h=99d544ec9d3b25f9a084249176edf90df70a4816;hb=1ee35e6d96c456b8e3499bd683f1647aa28bd501;hp=c7423cdbc96e0c7a4e0cdf0f2dd5fd59e608a165;hpb=0cd57c3885f00ad77fc599e53ed2f2d5e7ac267f;p=core.git diff --git a/inc/classes/main/criteria/dataset/class_DataSetCriteria.php b/inc/classes/main/criteria/dataset/class_DataSetCriteria.php index c7423cdb..99d544ec 100644 --- a/inc/classes/main/criteria/dataset/class_DataSetCriteria.php +++ b/inc/classes/main/criteria/dataset/class_DataSetCriteria.php @@ -2,12 +2,11 @@ /** * A set of data storeable in databases * - * @see DatabaseFrontendInterface - An interface for database frontends (front-end to the application) - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,11 +27,6 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { */ private $tableName = ''; - /** - * Table columns (criteria) to store - */ - private $tableColumns = array(); - /** * Unique key */ @@ -48,7 +42,7 @@ class DataSetCriteria extends BaseCriteria implements StoreableCriteria { * * @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()); } /**