-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathAt.php
52 lines (45 loc) · 916 Bytes
/
At.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace DingTalkRobot;
/**
* Class At
* @package DingTalkRobot
*/
class At
{
/**
* @var array
*/
private $data = array();
/**
* 选填
* 被@人的手机号(在content里添加@人的手机号)
* 可链式调用设置多个
* @param $mobile
* @return $this
*/
public function setMobile($mobile)
{
if ($mobile) {
$this->data['atMobiles'][] = $mobile;
}
return $this;
}
/**
* 选填
* 设置 @ 所有人时,@ 单独手机号会失效
* @param bool $isAtAll @所有人时:true,否则为:false
* @return $this
*/
public function setAtAll($isAtAll)
{
$this->data['isAtAll'] = (bool)$isAtAll;
return $this;
}
/**
* @return array 获取设置的 @ 数据
*/
public function get()
{
return $this->data;
}
}