Location: PHPKode > scripts > SigSlots > sigslots/sigslots.php
<?php

/**
 * SigSlots PHP Library
 * @version 1.0
 * @author Xander Guzman <hide@address.com>
 * @copyright Xander Guzman, 2007
 * @license GPL - Use it any way you want but keep my credit somewhere. If you truely found this library useful or have suggestions
 *          let me know. The more interest there is in my lirbaries the more I am willing to create them.
 * @desc Based off the C++ OpenSource Project SigSlots basically translated to PHP(5.x+). It allows you to work with a complex 
 *       Event system in a simple manner. For details please see MyEventTest.php for an example of implimentation.
 */

require_once("signals.php");

/**
 * This class that gets inherited from when you want an object to be able to emit/receive signals.
 *
 */
class SigSlots
{
	/**
	 * Registers a Class method as a slot
	 *
	 * @param string $Signal
	 * @param callback $Callback
	 */
	protected function RegisterSlot($Signal,$Callback)
	{
		Signals::GetInstance()->RegisterSlot($Signal,$Callback,$this);
	}
	
	/**
	 * Registers a Signal
	 *
	 * @param string $Signal
	 */
	protected function RegisterSignal($Signal)
	{
		Signals::GetInstance()->RegisterSignal($Signal);
	}
	
	/**
	 * Emits a signal.
	 *
	 * @param string $Signal
	 * @param array $arguments
	 */
	protected function EmitSignal($Signal,$arguments)
	{
		Signals::GetInstance()->Emit($Signal,$arguments);
	}
}

?>
Return current item: SigSlots