Source for file PMO_Dbms.php
Documentation is available at PMO_Dbms.php
* This file contains the PMO_Dbms interface.
* This file is part of the PhpMyObject project,
* an Object-Relational Mapping (ORM) system.
* For questions, help, comments, discussion, etc., please join our
* forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770}
* or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
* PhpMyObject is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* 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 {@link http://www.gnu.org/licenses/}.
* @author Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
* @link http://pmo.developpez.com/
* @since PhpMyObject v0.1x
* @copyright Copyright (C) 2007-2008 Nicolas Boiteux
* @license GPLv3 {@link http://www.gnu.org/licenses/gpl}
* This interface defines the methods a class must implement
* to provide a working Dbms driver class.
* The implementatio must create a PMO_MyDbms object or if it already
* exists, return a reference of this object instance
* @param object $object a optional PDO object to use.
static function factory(PDO $object = null);
* The implementation must create a data link with the database
* @param array $authdb an array containing the needed connection info
public function connect(array $authdb);
* The implementation must return the DB link or DB object
* @return object|resource either a Dbms object or a resource link
* The implementation must set a DB link or DD object
* @param object|resource$object
public function setDB($object);
* The implementation must implement a method that will
* execute an SQL query and return true if everything is ok
* or thow an eception if no result is found
* @param string $query the SQL query to execute
* @return bool true if results are found
* @throws Exception if no result is found
public function query($query);
* the implemetation must returns the query results
* the implementation must an array containing the table properties
* query database for a description of the $table schems
* @param sint $table the table name to work on
* the implementation must return the last inserted primary key value
* the implementation must load data from the database
* and fill the passed in PMO_Object with it
public function load(PMO_Object $object);
* the implementation must update the data corresponding to the
* PMO_Object in database All primary keys must be fill.
public function update(PMO_Object $object);
* the implementation must delete data corresponding to the PMO_Object
* in database All primary key must be fill.
public function delete(PMO_Object $object);
* the implementation must insert new data in database
* corresponding to the PMO_Object
* all primary keys must be fill.
public function insert(PMO_Object $object);
* the implementation must start a transaction
* the implementation must rollback an already stated transaction
* the implemetation ust commit the started transaction
|