X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcriteria%2Fdataset%2Fclass_DataSetCriteria.php;h=1c03be5d3f043040a749ebc00501270f9d01d28d;hp=f342606e89de681a876c35553d509fa7c219e5f0;hb=d26e71af1e28dc1429823bdec244df6303f9b2fb;hpb=08b1d39fa38b86cca6a0a6c968162d30ca171ae5 diff --git a/inc/classes/main/criteria/dataset/class_DataSetCriteria.php b/inc/classes/main/criteria/dataset/class_DataSetCriteria.php index f342606e..1c03be5d 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, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 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 @@ -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()); } /**