2019-01-29 05:56:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wechat\Work;
|
|
|
|
|
2019-02-19 07:58:00 +00:00
|
|
|
use Wechat\Work\MessageInterface;
|
2019-01-29 05:56:25 +00:00
|
|
|
|
2019-02-19 07:58:00 +00:00
|
|
|
class Message
|
|
|
|
{
|
2019-01-29 05:56:25 +00:00
|
|
|
|
2019-02-19 07:58:00 +00:00
|
|
|
/**
|
|
|
|
* @var Work
|
|
|
|
*/
|
|
|
|
protected $work;
|
2019-01-29 05:56:25 +00:00
|
|
|
|
2019-02-19 07:58:00 +00:00
|
|
|
public function __construct($work)
|
2019-01-29 05:56:25 +00:00
|
|
|
{
|
2019-02-19 07:58:00 +00:00
|
|
|
$this->work = $work;
|
2019-01-29 05:56:25 +00:00
|
|
|
}
|
|
|
|
|
2019-02-19 07:58:00 +00:00
|
|
|
public function send($msg)
|
2019-01-29 05:56:25 +00:00
|
|
|
{
|
2019-02-19 07:58:00 +00:00
|
|
|
$request = $this->work->transformForJsonRequest('message/send',
|
|
|
|
$msg->toArray());
|
|
|
|
return $this->work->request($request);
|
2019-01-29 05:56:25 +00:00
|
|
|
}
|
|
|
|
}
|