X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Finterfaces%2Fdatabase%2Fmiddleware%2Fclass_DatabaseConnector.php;h=43b5c1285401c3a200901ea748e9bf93b0725261;hb=1ee35e6d96c456b8e3499bd683f1647aa28bd501;hp=471fe1f5f813c9f9654bd97867f396a27cdd63b7;hpb=607a11e2c22949ea0647568c17d62a605595e83b;p=core.git diff --git a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php index 471fe1f5..43b5c128 100644 --- a/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php +++ b/inc/classes/interfaces/database/middleware/class_DatabaseConnector.php @@ -2,11 +2,11 @@ /** * An interface for middleware database classes * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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 @@ -21,7 +21,94 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -interface DatabaseConnector extends FrameworkDatabaseInterface { +interface DatabaseConnector extends FrameworkDatabase { + /** + * Get an instance of this class (Singleton) + * + * @return $selfInstance An instance of this class + */ + static function getSelfInstance (); + + /** + * Setter for database connection + * + * @param $login Login to database + * @param $pass Password (plain) + * @param $dbase Database to choose + * @param $host Hostname to use + * @return void + */ + function setConnectionData ($login, $pass, $dbase, $host='localhost'); + + /** + * Getter for connection data + * + * @return $connectData Connection data stored with this clas + */ + function getConnectionData (); + + /** + * Setter for the real database layer + * @param $dbLayer An instance of the real database layer + * @return void + */ + function setDatabaseLayer (DatabaseBackend $dbLayer); + + /** + * Getter for index key + * + * @return $indexKey Index key + */ + function getIndexKey (); + + /** + * Runs a 'select' statement on the database layer with given table name + * and criteria. If this doesn't fail the result will be returned + * + * @param $tableName Name of the 'table' we shall query + * @param $criteriaInstance An instance of a Criteria class + * @return $result The result as an array + */ + function doSelectByTableCriteria ($tableName, Criteria $criteriaInstance); + + /** + * Getter for last exception + * + * @return $exceptionInstance Last thrown exception + */ + function getLastException (); + + /** + * 'Inserts' a data set instance into a local file database folder + * + * @param $dataSetInstance A storeable data set + * @return void + */ + function queryInsertDataSet (StoreableCriteria $dataSetInstance); + + /** + * 'Updates' a data set instance with a database layer + * + * @param $dataSetInstance A storeable data set + * @return void + */ + function queryUpdateDataSet (StoreableCriteria $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 + */ + function getPrimaryKeyOfTable ($tableName); + + /** + * Removes non-public data from given array. + * + * @param $data An array with possible non-public data that needs to be removed. + * @return $data A cleaned up array with only public data. + */ + function removeNonPublicDataFromArray (array $data); } // [EOF]