3 * An interface for front-end database classes. The classes should prepare the
4 * objects for saving in the database. So for server-bases database classes SQL
5 * queries shall be generated and send to the backend classes. In case of local
6 * file databases the object shall be serialized and (maybe) transparently
7 * compressed before they got saved to a local file.
9 * @author Roland Haeder <webmaster@ship-simu.org>
11 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
12 * @license GNU GPL 3.0 or any newer version
13 * @link http://www.ship-simu.org
15 * This program is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
30 * Loads data saved with saveObject from the database and re-creates a
31 * full object from it.
32 * If limitObject() was called before a new object ObjectContainer with
33 * all requested attributes will be returned instead.
35 * @return Object The fully re-created object or instance to
39 function loadObject ();
42 * Makes sure that the database connection is up and alive
46 function connectToDatabase ();
49 * Starts a SELECT query on the database by given return type, table name
52 * @param $resultType Result type ("array", "object" and "indexed" are valid)
53 * @param $tableName Name of the database table
54 * @param $criteria Search criteria class
55 * @return $resultData Result data of the query
56 * @throws UnsupportedCriteriaException If the criteria is unsupported
57 * @throws SqlException If an SQL error occurs
59 function querySelect ($resultType, $tableName, Criteria $criteriaInstance);
62 * "Inserts" a data set instance into a local file database folder
64 * @param $dataSetInstance A storeable data set
67 function insertDataSet (StoreableCriteria $dataSetInstance);