*
* @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, this is free software
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Registerable {
/**
protected function __construct() {
// Call parent constructor
parent::__construct(__CLASS__);
-
- // Set description
- $this->setObjectDescription("Datenbank-Mittelschicht");
-
- // Create an unique ID
- $this->generateUniqueId();
}
// Create new database connection layer
// Ask the database layer
$this->dbLayer->queryInsertDataSet($dataSetInstance);
}
+
+ /**
+ * "Updates" a data set instance with a database layer
+ *
+ * @param $dataSetInstance A storeable data set
+ * @return void
+ */
+ public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
+ // Connect to the database
+ $this->dbLayer->connectToDatabase();
+
+ // Ask the database layer
+ $this->dbLayer->queryUpdateDataSet($dataSetInstance);
+ }
+
+ /**
+ * Getter for primary key column of specified table name
+ *
+ * @param $tableName Name of table we need the primary key column from
+ * @return $primaryKey Primary key column of requested table
+ */
+ public function getPrimaryKeyOfTable ($tableName) {
+ // Connect to the database
+ $this->dbLayer->connectToDatabase();
+
+ // Ask the database layer
+ $primaryKey = $this->dbLayer->getPrimaryKeyOfTable($tableName);
+
+ // Return the value
+ return $primaryKey;
+ }
}
// [EOF]