1: <?php
2:
3: namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity;
4:
5: use Doctrine\Common\Collections\ArrayCollection;
6:
7: /**
8: * Media.
9: */
10: class Media
11: {
12: /**
13: * @var int
14: */
15: private $id;
16:
17: /**
18: * @var string
19: */
20: private $media_url_https;
21:
22: /**
23: * @var string
24: */
25: private $url;
26:
27: /**
28: * @var string
29: */
30: private $display_url;
31:
32: /**
33: * @var string
34: */
35: private $expanded_url;
36:
37: /**
38: * @var ArrayCollection
39: */
40: private $tweets;
41:
42: public function __construct($id = null)
43: {
44: if (!is_null($id)) {
45: $this->setId($id);
46: }
47:
48: $this->tweets = new ArrayCollection();
49: }
50:
51: /**
52: * Set id.
53: *
54: * @param int $id
55: *
56: * @return Media
57: */
58: public function setId($id)
59: {
60: $this->id = $id;
61:
62: return $this;
63: }
64:
65: /**
66: * Get id.
67: *
68: * @return int
69: */
70: public function getId()
71: {
72: return $this->id;
73: }
74:
75: /**
76: * Set media_url_https.
77: *
78: * @param string $mediaUrlHttps
79: *
80: * @return Media
81: */
82: public function setMediaUrlHttps($mediaUrlHttps)
83: {
84: $this->media_url_https = $mediaUrlHttps;
85:
86: return $this;
87: }
88:
89: /**
90: * Get media_url_https.
91: *
92: * @return string
93: */
94: public function getMediaUrlHttps()
95: {
96: return $this->media_url_https;
97: }
98:
99: /**
100: * Set url.
101: *
102: * @param string $url
103: *
104: * @return Media
105: */
106: public function setUrl($url)
107: {
108: $this->url = $url;
109:
110: return $this;
111: }
112:
113: /**
114: * Get url.
115: *
116: * @return string
117: */
118: public function getUrl()
119: {
120: return $this->url;
121: }
122:
123: /**
124: * Set display_url.
125: *
126: * @param string $displayUrl
127: *
128: * @return Media
129: */
130: public function setDisplayUrl($displayUrl)
131: {
132: $this->display_url = $displayUrl;
133:
134: return $this;
135: }
136:
137: /**
138: * Get display_url.
139: *
140: * @return string
141: */
142: public function getDisplayUrl()
143: {
144: return $this->display_url;
145: }
146:
147: /**
148: * Set expanded_url.
149: *
150: * @param string $expandedUrl
151: *
152: * @return Media
153: */
154: public function setExpandedUrl($expandedUrl)
155: {
156: $this->expanded_url = $expandedUrl;
157:
158: return $this;
159: }
160:
161: /**
162: * Get expanded_url.
163: *
164: * @return string
165: */
166: public function getExpandedUrl()
167: {
168: return $this->expanded_url;
169: }
170:
171: /**
172: * Add a tweet.
173: *
174: * @param Tweet $tweet
175: *
176: * @return Media
177: */
178: public function addTweet(Tweet $tweet)
179: {
180: $this->tweets->add($tweet);
181:
182: return $this;
183: }
184:
185: /**
186: * Remove a tweet.
187: *
188: * @param Tweet $tweet
189: *
190: * @return Media
191: */
192: public function removeTweet(Tweet $tweet)
193: {
194: $this->tweets->removeElement($tweet);
195:
196: return $this;
197: }
198:
199: /**
200: * Get tweets.
201: *
202: * @return ArrayCollection
203: */
204: public function getTweets()
205: {
206: return $this->tweets;
207: }
208:
209: /**
210: * Call setter functions.
211: *
212: * @param \stdClass $mediaTmp
213: *
214: * @return Media
215: */
216: public function setValues(\stdClass $mediaTmp)
217: {
218: $this
219: ->setMediaUrlHttps($mediaTmp->media_url_https)
220: ->setUrl($mediaTmp->url)
221: ->setDisplayUrl($mediaTmp->display_url)
222: ->setExpandedUrl($mediaTmp->expanded_url);
223:
224: return $this;
225: }
226: }
227: