Location: PHPKode > projects > Entier Studio > entierstudio/framework/datasource.manager.php
<?php
/**
 * Entier Studio
 *
 * LICENSE
 *
 *	Copyright 2006 Entier Studio team.
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 *
 * @package    entier.framework
 * @copyright  Copyright (c) 2006 Entier Studio team. All rights reserved.
 * @version	   $Id: datasource.manager.php 83 2008-01-18 22:24:14Z yannromefort $
 */
//-----------------------------------------------------------------------------
//	namespace
if (!defined("DefDataSourceManager")) {
    //-------------------------------------------------------------------------
    //	Define
    define("DefDataSourceManager", "1");
    //-------------------------------------------------------------------------
    //	Include
    @require_once (FRAMEWORK_DIR . "datasource.php");
    @require_once (FRAMEWORK_DIR . "model.element.php");
    //-------------------------------------------------------------------------
    //	Class
    class DataSourceManager extends DataSource {
        //---------------------------------------------------------------------
        //	Attributes
        
        /**
         * Data Source
         * @var	object
         */
        var $m_Source = NULL;
        /**
         * Error code
         * @var	integer
         */
        var $m_Error = NULL;
        //---------------------------------------------------------------------
        //	Constructor
        
        /**
         * DataSourceManager constructor
         *
         */
        function DataSourceManager() {
        }
        //---------------------------------------------------------------------
        //	Properties        
        /**
         * FIXME overrided DataSource property (should be removed)
         * @return	object
         */
        function getDataHandler() {
            //
            return ($this);
        }
        /**
         * overrided DataSource property
         * @return	integer
         */
        function errorNumber() {
            //
            return ($this->m_Error);
        }
        //---------------------------------------------------------------------
        //	Methods
        //	DataSourceManager interface        
        /**
         * Open a datasource connection if needed
		 * @access	public
         * @return	boolean
         */
        function openSource() {
            //
            if (($this->m_Source->isConnectionOpen() == false) && ($this->m_Source->openConnection() == false))
			    return (false);
            //
            return (true);
        }
        /**
		 * redundant closeConnection for an homogeneous interface purpose
         * @access	public
         * @return	boolean
         */
        function closeSource() {
            //
            return ($this->m_Source->closeConnection());
        }
        /**
         * Perform a database element lookup
         * @param	string	Target element name
         * @param	string	Target element type
         * @return	boolean	Return flag
         */
        function selectObject($name = "", $type = "") {
            //
            return (false);
        }
        /**
         * Perform a datasource element creation
         * @param	string	Target element name
         * @param	string	Target element type
         * @param	Array	Target element parameters
         * @return	boolean	Return flag
         */
        function createObject($name = "", $type = "", $make = NULL) {
            //
            return (false);
        }
        /**
         * Perform a datasource element update
         * @param	string	Target element name
         * @param	string	Target element type
         * @param	Array	Target element parameters
         * @return	boolean	Return flag
         */
        function UpdateObject($name = "", $type = "", $make = NULL) {
            //
            return (false);
        }
        /**
         * Perform a datasource element deletion
         * @param	string	Target element name
         * @param	string	Target element type
         * @return	boolean	Return flag
         */
        function DeleteObject($name = "", $type = "") {
            //
            return (false);
        }
    };
    //	Class
    //-------------------------------------------------------------------------    
}
//	namespace
//-----------------------------------------------------------------------------
?>
Return current item: Entier Studio