00001 <?php
00002
00003
00004
00005
00006
00007
00008
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 }