Channel.php 821 Bytes
<?php
namespace Plugin\DataProcess\WebChannel;
class Channel
{
    public static $formatChannel = array(
        'boys' => '\Plugin\DataProcess\WebChannel\Channel\Kids',
        'girls' => '\Plugin\DataProcess\WebChannel\Channel\Girls',
        'kids' => '\Plugin\DataProcess\WebChannel\Channel\Kids'
    );
    public static function getFormat($channel, $data)
    {
        //通用处理器
        $result = Process::getContent($data, $channel);
        $channelResult = array();
        if(isset(self::$formatChannel[$channel]))
        {
            $class = self::$formatChannel[$channel];
            $channelResult = $class::format($data);
        }
        //组合数据
        $result = $result + $channelResult;
        ksort($result);
        return array_values($result);
    }
}