1<?php
2/**
3 * This file is part of the Tmdb PHP API created by Michael Roterman.
4 *
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
7 *
8 * @package Tmdb
9 * @author Michael Roterman <michael@wtfz.net>
10 * @copyright (c) 2013, Michael Roterman
11 * @version 0.0.1
12 */
13namespace Tmdb\Model\Common\Trailer;
14
15use Tmdb\Model\Common\AbstractTrailer;
16
17/**
18 * Class Youtube
19 * @package Tmdb\Model\Common\Trailer
20 */
21class Youtube extends AbstractTrailer
22{
23    const URL = 'http://www.youtube.com/watch?v=%s';
24
25    private $name;
26    private $size;
27    private $source;
28    private $type;
29
30    public static $properties = [
31        'name',
32        'size',
33        'source',
34        'type'
35    ];
36
37    /**
38     * Retrieve the url to the source
39     *
40     * @return string
41     */
42    public function getUrl()
43    {
44        return sprintf(self::URL, $this->source);
45    }
46
47    /**
48     * @param  string $name
49     * @return $this
50     */
51    public function setName($name)
52    {
53        $this->name = $name;
54
55        return $this;
56    }
57
58    /**
59     * @return string
60     */
61    public function getName()
62    {
63        return $this->name;
64    }
65
66    /**
67     * @param  string $size
68     * @return $this
69     */
70    public function setSize($size)
71    {
72        $this->size = $size;
73
74        return $this;
75    }
76
77    /**
78     * @return string
79     */
80    public function getSize()
81    {
82        return $this->size;
83    }
84
85    /**
86     * @param  string $source
87     * @return $this
88     */
89    public function setSource($source)
90    {
91        $this->source = $source;
92
93        return $this;
94    }
95
96    /**
97     * @return string
98     */
99    public function getSource()
100    {
101        return $this->source;
102    }
103
104    /**
105     * @param  string $type
106     * @return $this
107     */
108    public function setType($type)
109    {
110        $this->type = $type;
111
112        return $this;
113    }
114
115    /**
116     * @return string
117     */
118    public function getType()
119    {
120        return $this->type;
121    }
122}
123