1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Twitter\Object; |
4
|
|
|
|
5
|
|
|
use Twitter\TwitterSerializable; |
6
|
|
|
|
7
|
|
|
class TwitterEntities implements TwitterSerializable |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @var TwitterHashtag[] |
11
|
|
|
*/ |
12
|
|
|
private $hashtags; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var TwitterSymbol[] |
16
|
|
|
*/ |
17
|
|
|
private $symbols; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @var TwitterUrl[] |
21
|
|
|
*/ |
22
|
|
|
private $urls; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var TwitterUserMention[] |
26
|
|
|
*/ |
27
|
|
|
private $userMentions; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var TwitterMedia[] |
31
|
|
|
*/ |
32
|
|
|
private $media; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var TwitterExtendedEntity[] |
36
|
|
|
*/ |
37
|
|
|
private $extendedEntities; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Constructor. |
41
|
|
|
*/ |
42
|
18 |
|
public function __construct() |
43
|
|
|
{ |
44
|
18 |
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return TwitterExtendedEntity[] |
48
|
|
|
*/ |
49
|
9 |
|
public function getExtendedEntities() |
50
|
|
|
{ |
51
|
9 |
|
return $this->extendedEntities; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return TwitterHashtag[] |
56
|
|
|
*/ |
57
|
9 |
|
public function getHashtags() |
58
|
|
|
{ |
59
|
9 |
|
return $this->hashtags; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return TwitterMedia[] |
64
|
|
|
*/ |
65
|
9 |
|
public function getMedia() |
66
|
|
|
{ |
67
|
9 |
|
return $this->media; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return TwitterSymbol[] |
72
|
|
|
*/ |
73
|
9 |
|
public function getSymbols() |
74
|
|
|
{ |
75
|
9 |
|
return $this->symbols; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return TwitterUrl[] |
80
|
|
|
*/ |
81
|
9 |
|
public function getUrls() |
82
|
|
|
{ |
83
|
9 |
|
return $this->urls; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return TwitterUserMention[] |
88
|
|
|
*/ |
89
|
9 |
|
public function getUserMentions() |
90
|
|
|
{ |
91
|
9 |
|
return $this->userMentions; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Static constructor. |
96
|
|
|
* |
97
|
|
|
* @param TwitterHashtag[] $hashtags |
98
|
|
|
* @param TwitterUserMention[] $userMentions |
99
|
|
|
* @param TwitterUrl[] $urls |
100
|
|
|
* @param TwitterMedia[] $media |
101
|
|
|
* @param TwitterSymbol[] $symbols |
102
|
|
|
* @param TwitterExtendedEntity[] $extendedEntities |
103
|
|
|
* |
104
|
|
|
* @return TwitterEntities |
105
|
|
|
*/ |
106
|
18 |
|
public static function create( |
107
|
|
|
array $hashtags = [], |
108
|
|
|
array $userMentions = [], |
109
|
|
|
array $urls = [], |
110
|
|
|
array $media = [], |
111
|
|
|
array $symbols = [], |
112
|
|
|
array $extendedEntities = [] |
113
|
|
|
) { |
114
|
18 |
|
$obj = new self(); |
115
|
|
|
|
116
|
18 |
|
$obj->extendedEntities = $extendedEntities; |
117
|
18 |
|
$obj->hashtags = $hashtags; |
118
|
18 |
|
$obj->media = $media; |
119
|
18 |
|
$obj->symbols = $symbols; |
120
|
18 |
|
$obj->urls = $urls; |
121
|
18 |
|
$obj->userMentions = $userMentions; |
122
|
|
|
|
123
|
18 |
|
return $obj; |
124
|
|
|
} |
125
|
|
|
} |
126
|
|
|
|