Location: PHPKode > scripts > ooeLite > ooelite/ooeInheritance.class.php
<?php
/**
* Classe que retorna o metodos de outra classe 
* para emular  multiple Inheritance 
* @author Marcelo Soares da Costa
* @email phpmafia at yahoo dot com dot br
* @copyright Marcelo Soares da Costa © 2008. 
* @license FreeBSD http://www.freebsd.org/copyright/freebsd-license.html
* @version 2.0
* @access public
* @package OOE
* @data 2009-06-25
*/
################################################################################
class ooeInheritance {
	private static $this;
	private static $parent;
	private $constructor;

	/**
	*
	* o construtor nao pode ser privado ou protegido
	* por contexto, mas não pode ser instanciado diretamente
	* @access public
	* @return Exception
	* 
	*/
	function __construct() {
		if (get_class($this) == __CLASS__) {
			throw new Exception("you can't instantiate this class");
		}
	}

	/**
	*
	* Referencia um unico objeto de uma classe
	* @access protected
	* @return object
	* 
	*/
	protected static function callClassParent($parent,$constructor=null) {
		if (!isset (self :: $parent)) {
			return self :: $parent = new $parent($constructor);
		} else {
			return $parent = new $parent ($constructor);
		}
	}

	/**
	*
	* Previne que o clone de uma instância
	* @access public
	* 
	*/
	public function __clone() {
		throw new Exception("Clone is not allowed.");
	}
}
?>
Return current item: ooeLite