<?php
	/**
	* This class is responsible for setting the Database parameters.
	* Adapters such as MySQL and MySQLi use this class to open a connection with the database. 
	* All new adapters must <strong>extend</strong> this class in order to negotiate with the 
	* database server.<br />
	* <strong>Note:</strong> This class is <tt>ABSTRACT</tt> and thus cannot be instantiated.
	*
	* @copyright Trusto Tech 2015-2016
	* @author  Taha Sayyad <info@trustotech.com>
	* @package System\Database
	*/
	abstract class DBConnectionParameters {

		/**
		* @var string Holds the database server's hostname
		*/
		private $_DBhostname;

		/**
		* @var string Holds the database server's username
		*/
		private $_DBusername;

		/**
		* @var string Holds the database server's password
		*/
		private $_DBpassword;
		
		/**
		* @var string Holds the database name
		*/
		private $DBname;

		/**
		* Set the hostname of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @param string @hostname Database hostname
		*/
		protected function _setDBHostname($hostname) {
			$this->_DBhostname = $hostname;
		}

		/**
		* Get the hostname of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @return string Database hostname
		*/
		public function _getDBHostname() {
			return $this->_DBhostname;
		}

		/**
		* Set the username of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @param string @username Database username
		*/
		protected function _setDBUsername($username) {
			$this->_DBusername = $username;
		}

		/**
		* Get the username of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @return string Database username
		*/
		public function _getDBUsername() {
			return $this->_DBusername;
		}

		/**
		* Set the password of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @param string @password Database password
		*/
		protected function _setDBPassword($password) {
			$this->_DBpassword = $password;
		}

		/**
		* Get the password of the database server
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @return string Database password
		*/
		public function _getDBPassword() {
			return $this->_DBpassword;
		}

		/**
		* Set the database name
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @param string @dbname Database name
		*/
		protected function _setDBName($dbname) {
			$this->_DBname = $dbname;
		}

		/**
		* Get the database name
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @return string Database name
		*/
		public function _getDBName() {
			return $this->_DBname;
		}

		/**
		* This method must be called from all adapters that extends this class. It sets the database parameters.<br />
		* DB_HOST, DB_USER, DB_PASS, and DB_NAME are predefined constants.
		*
		* @author  Taha Sayyad <info@trustotech.com>
		* @uses self::_setDBHostname(DB_HOST)
		* @uses self::_setDBUsername(DB_USER)
		* @uses self::_setDBPassword(DB_PASS)
		* @uses self::_setDBName(DB_NAME)
		*/
		protected function _setParameters() {
			self::_setDBHostname(DB_HOST);
			self::_setDBUsername(DB_USER);
			self::_setDBPassword(DB_PASS);
			self::_setDBName(DB_NAME);
		}

	}