Source for file Database.class.php
Documentation is available at Database.class.php
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library 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 Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* The name of this database.
* Carries the databasetable's objects of this database.
* Carryies the view's objects of this database.
* Refers to the databasehost in which this database lies.
* The last stored databasequery.
* @var string $last_query
* Carries the name of a function which has to be invoked on a connection
* @var function $error_callback
* @author Daniel Plücken <daniel@debakel.net>
function Database( $name, $parent = "" )
"<h3>You have to give a name to this database!</h3>"
. "<b>Use following Syntax:<b><br><br>\r\n"
. " \x24db = new Database( \x24name );\r\n"
* Sets the name of the function that should be invoked on a connection error.
* The function to call back has to have two parameter. The first parameter is
* for the error code. The second one contains the errordescription.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $function_name_str
* Adds a databasetable's reference to this object of a database.
* @author Daniel Plücken <daniel@debakel.net>
$dbt_obj->setParent( $this );
is_a( $dbt_obj, "ABSTDatabaseTable" )
$dbt_obj->setParent( $this );
"<h3>The parameter does not refer to "
. "a valid object of a databasetable!</h3>"
* Adds a view's reference to this object of a database.
* @author Daniel Plücken <daniel@debakel.net>
* @param object $view_obj
$this->view[] = $view_obj;
is_a( $view_obj, "View" )
$this->view[] = $view_obj;
"<h3>The parameter does not refer to "
. "a valid object of a database view!</h3>"
* Returns the array of references to the databasetables.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the array of references to the views.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the databasename.
* @author Daniel Plücken <daniel@debakel.net>
* Returns the databasename. This method is an alias for the method
* @author Daniel Plücken <daniel@debakel.net>
* Returns the last stored database query.
* @author Daniel Plücken <daniel@debakel.net>
* Sets the parent of this object.
* @author Daniel Plücken <daniel@debakel.net>
is_a( $obj_ref, "ABSTDatabaseHost" )
"<h3>The given parameter is not a reference "
. "of an object of a databasehost!</h3>"
* Returns the id of the connection resource to the database host.
{ return $this->parent->getResourceID(); }
} // End of class Database
|