PEIP_Event.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 
00024 class PEIP_Event 
00025     extends 
00026         PEIP_Generic_Message 
00027     implements 
00028         PEIP_INF_Event {
00029             
00030     protected
00031         $value      = null,
00032         $processed  = false,
00033         $subject    = null,
00034         $name       = '',
00035         $parameters = null;
00036 
00052     public function __construct($subject, $name, array $parameters = array())
00053   {
00054     parent::__construct($subject, new ArrayObject($parameters));
00055   
00056     $this->name = $name;
00057     //$this->parameters = $parameters;
00058   }
00059 
00070     public function getName(){
00071     return $this->name;
00072   }
00073 
00085     public function setReturnValue($value){
00086     $this->value = $value;
00087   }
00088 
00099     public function getReturnValue(){
00100     return $this->value;
00101   }
00102 
00114     public function setProcessed($processed){
00115     $this->processed = (boolean) $processed;
00116   }
00117 
00128     public function isProcessed(){
00129     return $this->processed;
00130   }
00131 
00132 
00146     public function offsetExists($name)
00147   {
00148     return array_key_exists($name, $this->parameters);
00149   }
00150 
00164     public function offsetGet($name)
00165   {
00166     if (!array_key_exists($name, $this->parameters))
00167     {
00168       throw new InvalidArgumentException(sprintf('The event "%s" has no "%s" parameter.', $this->name, $name));
00169     }
00170 
00171     return $this->parameters[$name];
00172   }
00173 
00174 }
00175     
00176 

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