public function sendNews (Type\News $newsMessage)
    {
        // Build up items.
        $items = [];
        foreach ($newsMessage->getItems() as $newsItem) {
            $items[] = [
                'Title' => $newsItem->getTitle(),
                'Description' => $newsItem->getDescription(),
                'PicUrl' => $newsItem->getImageURL(),
                'Url' => $newsItem->getURL(),
            ];
        }

        $this->sendReply(
            $this->buildMessage(
                [
                    'MsgType' => $newsMessage->getType(),
                    'ArticleCount' => count($items),
                    'Articles' => [
                        'item' => $items,
                    ],
                ]
            )
        );
    }
public function sendNews (Type\News $newsMessage)
    {
        // Build up items.
        $items = [];
        foreach ($newsMessage->getItems() as $newsItem) {
            $items[] = [
                'Title' => $newsItem->getTitle(),
                'Description' => $newsItem->getDescription(),
                'PicUrl' => $newsItem->getImageURL(),
                'Url' => $newsItem->getURL(),
            ];
        }

        $this->sendReply(
            $this->buildMessage(
                [
                    'MsgType' => $newsMessage->getType(),
                    'ArticleCount' => count($items),
                    'Articles' => [
                        'item' => $items,
                    ],
                ]
            )
        );
    }
public function sendNews ( Type \ News $ newsMessage ) { // Build up items. $ items = [ ] ; foreach ( $ newsMessage -> getItems ( ) as $ newsItem ) { $ items [ ] = [ 'Title' => $ newsItem -> getTitle ( ) , 'Description' => $ newsItem -> getDescription ( ) , 'PicUrl' => $ newsItem -> getImageURL ( ) , 'Url' => $ newsItem -> getURL ( ) , ] ; } $ this -> sendReply ( $ this -> buildMessage ( [ 'MsgType' => $ newsMessage -> getType ( ) , 'ArticleCount' => count ( $ items ) , 'Articles' => [ 'item' => $ items , ] , ] ) ) ; }
Sends a new message reply.

@param Type\News $newsMessage

@throws Exception\AlreadySentException
Sends a new message reply .