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\Timezone;
14
15use Tmdb\Model\AbstractModel;
16use Tmdb\Model\Collection\Timezones;
17
18/**
19 * Class Timezone
20 * @package Tmdb\Model\Certification
21 */
22class CountryTimezone extends AbstractModel
23{
24    /**
25     * @var string
26     */
27    private $iso31661;
28
29    /**
30     * @var Timezones
31     */
32    private $timezones;
33
34    public function __construct()
35    {
36        $this->timezones = new Timezones();
37    }
38
39    /**
40     * @param  \Tmdb\Model\Collection\Timezones $timezones
41     * @return $this
42     */
43    public function setTimezones($timezones)
44    {
45        $this->timezones = $timezones;
46
47        return $this;
48    }
49
50    /**
51     * @return \Tmdb\Model\Collection\Timezones
52     */
53    public function getTimezones()
54    {
55        return $this->timezones;
56    }
57
58    /**
59     * @param  string $iso31661
60     * @return $this
61     */
62    public function setIso31661($iso31661)
63    {
64        $this->iso31661 = $iso31661;
65
66        return $this;
67    }
68
69    /**
70     * @return string
71     */
72    public function getIso31661()
73    {
74        return $this->iso31661;
75    }
76
77    /**
78     * Verify if a country supports a certain timezone
79     *
80     * @param $timezone
81     * @return boolean
82     */
83    public function supports($timezone)
84    {
85        return false !== $this->timezones->hasValue($timezone);
86    }
87
88    /**
89     * @return string
90     */
91    public function __toString()
92    {
93        return $this->iso31661;
94    }
95}
96