Completed
Push — master ( 6665fe...8b73c1 )
by Alexis
05:34
created

Entity/Media.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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 bigint
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 7
    public function __construct($id = null)
43
    {
44 7
        if (! is_null($id)) {
45 4
            $this->setId($id);
46 4
        }
47
        
48 7
        $this->tweets = new ArrayCollection();
49 7
    }
50
    
51
    /**
52
     * Set id
53
     *
54
     * @param bigint $id
55
     * @return Media 
56
     */
57 7
    public function setId($id)
58
    {
59 7
        $this->id = $id;
60
        
61 7
        return $this;
62
    }
63
    
64
    /**
65
     * Get id
66
     *
67
     * @return integer 
0 ignored issues
show
Should the return type not be bigint?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
68
     */
69 1
    public function getId()
70
    {
71 1
        return $this->id;
72
    }
73
    
74
    /**
75
     * Set media_url_https
76
     *
77
     * @param string $mediaUrlHttps
78
     * @return Media
79
     */
80 7
    public function setMediaUrlHttps($mediaUrlHttps)
81
    {
82 7
        $this->media_url_https = $mediaUrlHttps;
83
84 7
        return $this;
85
    }
86
    
87
    /**
88
     * Get media_url_https
89
     *
90
     * @return string 
91
     */
92 6
    public function getMediaUrlHttps()
93
    {
94 6
        return $this->media_url_https;
95
    }
96
    
97
    /**
98
     * Set url
99
     *
100
     * @param string $url
101
     * @return Media
102
     */
103 7
    public function setUrl($url)
104
    {
105 7
        $this->url = $url;
106
107 7
        return $this;
108
    }
109
    
110
    /**
111
     * Get url
112
     *
113
     * @return string 
114
     */
115 6
    public function getUrl()
116
    {
117 6
        return $this->url;
118
    }
119
    
120
    /**
121
     * Set display_url
122
     *
123
     * @param string $displayUrl
124
     * @return Media
125
     */
126 7
    public function setDisplayUrl($displayUrl)
127
    {
128 7
        $this->display_url = $displayUrl;
129
130 7
        return $this;
131
    }
132
    
133
    /**
134
     * Get display_url
135
     *
136
     * @return string 
137
     */
138 6
    public function getDisplayUrl()
139
    {
140 6
        return $this->display_url;
141
    }
142
    
143
    /**
144
     * Set expanded_url
145
     *
146
     * @param string $expandedUrl
147
     * @return Media
148
     */
149 7
    public function setExpandedUrl($expandedUrl)
150
    {
151 7
        $this->expanded_url = $expandedUrl;
152
153 7
        return $this;
154
    }
155
    
156
    /**
157
     * Get expanded_url
158
     *
159
     * @return string 
160
     */
161 6
    public function getExpandedUrl()
162
    {
163 6
        return $this->expanded_url;
164
    }
165
    
166
    /**
167
     * Add a tweet
168
     *
169
     * @return Media
170
     */
171 6
    public function addTweet(Tweet $tweet)
172
    {
173 6
        $this->tweets->add($tweet);
174
        
175 6
        return $this;
176
    }
177
    
178
    /**
179
     * Remove a tweet
180
     *
181
     * @return Media
182
     */
183 1
    public function removeTweet(Tweet $tweet)
184
    {
185 1
        $this->tweets->removeElement($tweet);
186
        
187 1
        return $this;
188
    }
189
    
190
    /**
191
     * Get tweets
192
     *
193
     * @return ArrayCollection
194
     */
195 2
    public function getTweets()
196
    {
197 2
        return $this->tweets;
198
    }
199
    
200
    /**
201
     * Call setter functions
202
     * 
203
     * @param \stdClass $mediaTmp
204
     */
205 3
    public function setValues(\stdClass $mediaTmp)
206
    {
207 3
        $this
208 3
            ->setMediaUrlHttps($mediaTmp->media_url_https)
209 3
            ->setUrl($mediaTmp->url)
210 3
            ->setDisplayUrl($mediaTmp->display_url)
211 3
            ->setExpandedUrl($mediaTmp->expanded_url)
212
        ;
213
        
214 3
        return $this;
215
    }
216
}
217