Location: PHPKode > projects > FreeORM > FreeORM/databases/Database.php
<?php

/**
 * The abstract class Database.
 * 
 * @package		com.freeorm
 * @author		Yide Zou
 * @link		http://www.freeorm.com
 * @copyright	Copyright (c) 2010 Yide Zou <hide@address.com>. 
 * 				All Rights Reserved.
 * @license		This software is released under the terms of the GNU Lesser General Public License
 * 				A copy of which is available from http://www.gnu.org/copyleft/lesser.html
 */

abstract class Database 
{

	protected $logger;
	
	public function __construct($logger)
	{
		$this->logger = $logger;
	}
	
	
	/**
	 * Add `` for the keyword string
	 * @param $keyword the original string
	 * @return String with ``
	 */
	public function sqlquote($keyword)
	{
		if ($keyword)
			return "`$keyword`";
		else
			return '';
	}
	
	/**
	 * Execute a SQL
	 * @param $sql
	 * @return false if sql error
	 */
	public abstract function query($sql);
	
	/**
	 * Execute a query and return one object
	 * @param $sql
	 * @return an object, null if not found
	 */
	public abstract function loadObject($sql);
	
	/**
	 * Execute a query and return one object
	 * @param $sql
	 * @return an object list, return an empty array if not found
	 */
	public abstract function loadObjectList($sql);
	
	/**
	 * Commit the database transaction
	 * @return true if success.
	 */
	public abstract function commit();
	
	public abstract function close();
	
	/**
	 * @return last auto generated insert id
	 */
	public abstract function getInsertId();

}
Return current item: FreeORM