PEIP_Content_Type_Selector.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 
00021 class PEIP_Content_Type_Selector
00022     implements PEIP_INF_Message_Selector {
00023             
00024     protected 
00025         $type;
00026         
00027     protected static 
00028         $types = array(
00029             'string' => 'is_string',
00030             'int' => 'is_int',
00031             'float' => 'is_float',
00032             'numeric' => 'is_numeric',
00033             'bool' => 'is_bool',
00034             'boolean' => 'is_bool',
00035             'array' => 'is_array',
00036             'scalar' => 'is_scalar',
00037             'object' => 'is_object',
00038             'resource' => 'is_resource'
00039         );
00040         
00041     
00047     public function __construct($type){
00048         $this->type = $type;
00049     }       
00050             
00051     
00057     public function acceptMessage(PEIP_INF_Message $message){
00058         return call_user_func(self::$types[$this->type], $message->getContent());
00059     }           
00060     
00061 } 
00062 

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