PEIP_ABS_Event_Pipe.php

Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of the PEIP package.
00005  * (c) 2010 Timo Michna <timomichna/yahoo.de>
00006  * 
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00022 abstract class PEIP_ABS_Event_Pipe  
00023     extends PEIP_Pipe {
00024 
00025     
00026     protected 
00027         $connections = array(); 
00028           
00029 
00030 
00031 
00032     
00039     protected function doListen($eventName, PEIP_INF_Connectable $connectable){
00040         if(!$connectable->hasListener($eventName, $this)){
00041             $connectable->connect($eventName, $this);
00042             $this->connections[spl_object_hash($connectable)] = $connectable;   
00043         }   
00044     }
00045     
00046     
00053     protected function doUnlisten($eventName, PEIP_INF_Connectable $connectable){
00054         if(!$connectable->hasListener($eventName, $this)){
00055             $connectable->disconnect($eventName, $this);
00056             unset($this->connections[spl_object_hash($connectable)]);   
00057         }   
00058     }
00059 
00060     
00065     public function doGetConnected(){
00066         return array_values($this->connections);
00067     }
00068     
00069 }

Generated on Mon Apr 12 11:39:00 2010 for PEIP by  doxygen 1.5.1