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; 14 15use Tmdb\Model\AbstractModel; 16 17/** 18 * Class Video 19 * @package Tmdb\Model\Common 20 */ 21class Video extends AbstractModel 22{ 23 /** 24 * @var string 25 */ 26 private $id; 27 28 /** 29 * @var string 30 */ 31 private $iso6391; 32 33 /** 34 * @var mixed 35 */ 36 private $key; 37 38 /** 39 * @var string 40 */ 41 private $name; 42 43 /** 44 * @var string 45 */ 46 private $site; 47 48 /** 49 * @var int 50 */ 51 private $size; 52 53 /** 54 * @var string 55 */ 56 private $type; 57 58 /** 59 * Holds the format of the url 60 * 61 * @var string 62 */ 63 private $url_format; 64 65 public static $properties = [ 66 'id', 67 'iso_639_1', 68 'key', 69 'name', 70 'site', 71 'size', 72 'type' 73 ]; 74 75 /** 76 * @param string $id 77 * @return $this 78 */ 79 public function setId($id) 80 { 81 $this->id = $id; 82 83 return $this; 84 } 85 86 /** 87 * @return string 88 */ 89 public function getId() 90 { 91 return $this->id; 92 } 93 94 /** 95 * @param string $iso6391 96 * @return $this 97 */ 98 public function setIso6391($iso6391) 99 { 100 $this->iso6391 = $iso6391; 101 102 return $this; 103 } 104 105 /** 106 * @return string 107 */ 108 public function getIso6391() 109 { 110 return $this->iso6391; 111 } 112 113 /** 114 * @param mixed $key 115 * @return $this 116 */ 117 public function setKey($key) 118 { 119 $this->key = $key; 120 121 return $this; 122 } 123 124 /** 125 * @return mixed 126 */ 127 public function getKey() 128 { 129 return $this->key; 130 } 131 132 /** 133 * @param string $name 134 * @return $this 135 */ 136 public function setName($name) 137 { 138 $this->name = $name; 139 140 return $this; 141 } 142 143 /** 144 * @return string 145 */ 146 public function getName() 147 { 148 return $this->name; 149 } 150 151 /** 152 * @param string $site 153 * @return $this 154 */ 155 public function setSite($site) 156 { 157 $this->site = $site; 158 159 return $this; 160 } 161 162 /** 163 * @return string 164 */ 165 public function getSite() 166 { 167 return $this->site; 168 } 169 170 /** 171 * @param int $size 172 * @return $this 173 */ 174 public function setSize($size) 175 { 176 $this->size = $size; 177 178 return $this; 179 } 180 181 /** 182 * @return int 183 */ 184 public function getSize() 185 { 186 return $this->size; 187 } 188 189 /** 190 * @param string $type 191 * @return $this 192 */ 193 public function setType($type) 194 { 195 $this->type = $type; 196 197 return $this; 198 } 199 200 /** 201 * @return string 202 */ 203 public function getType() 204 { 205 return $this->type; 206 } 207 208 /** 209 * @param string $url_format 210 * @return $this 211 */ 212 public function setUrlFormat($url_format) 213 { 214 $this->url_format = $url_format; 215 216 return $this; 217 } 218 219 /** 220 * @return string 221 */ 222 public function getUrlFormat() 223 { 224 return $this->url_format; 225 } 226 227 /** 228 * Retrieve the url to the source 229 * 230 * @return string 231 */ 232 public function getUrl() 233 { 234 return sprintf($this->getUrlFormat(), $this->getKey()); 235 } 236} 237