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_Message_Splitter 00023 extends PEIP_Pipe { 00024 00025 00032 public function __construct(PEIP_INF_Channel $inputChannel, PEIP_INF_Channel $outputChannel = NULL){ 00033 $this->setInputChannel($inputChannel); 00034 if(is_object($outputChannel)){ 00035 $this->setOutputChannel($outputChannel); 00036 } 00037 } 00038 00039 00045 public function doReply(PEIP_INF_Message $message){ 00046 $res = $this->split($message); 00047 if(is_array($res)){ 00048 foreach($res as $msg){ 00049 $this->replyMessage($msg); 00050 } 00051 }else{ 00052 $this->replyMessage($res); 00053 } 00054 00055 } 00056 00057 00063 abstract public function split(PEIP_INF_Message $message); 00064 00065 } 00066