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\Repository;
14
15use Tmdb\Factory\CertificationFactory;
16
17/**
18 * Class CertificationRepository
19 * @package Tmdb\Repository
20 * @see http://docs.themoviedb.apiary.io/#certifications
21 */
22class CertificationRepository extends AbstractRepository
23{
24    /**
25     * Get the list of supported certifications for movies.
26     *
27     * These can be used in conjunction with the certification_country
28     * and certification.lte parameters when using discover.
29     *
30     * @param $parameters
31     * @param $headers
32     * @return \Tmdb\Model\Common\GenericCollection
33     */
34    public function getMovieList(array $parameters = [], array $headers = [])
35    {
36        $data  = $this->getApi()->getMovieList($this->parseQueryParameters($parameters), $headers);
37
38        return $this->getFactory()->createCollection($data);
39    }
40
41    /**
42     * Get the list of supported certifications for tv shows.
43     *
44     * These can be used in conjunction with the certification_country
45     * and certification.lte parameters when using discover.
46     *
47     * @param $parameters
48     * @param $headers
49     * @return \Tmdb\Model\Common\GenericCollection
50     */
51    public function getTvList(array $parameters = [], array $headers = [])
52    {
53        $data  = $this->getApi()->getTvList($this->parseQueryParameters($parameters), $headers);
54
55        return $this->getFactory()->createCollection($data);
56    }
57
58    /**
59     * Return the Collection API Class
60     *
61     * @return \Tmdb\Api\Certifications
62     */
63    public function getApi()
64    {
65        return $this->getClient()->getCertificationsApi();
66    }
67
68    /**
69     * @return CertificationFactory
70     */
71    public function getFactory()
72    {
73        return new CertificationFactory($this->getClient()->getHttpClient());
74    }
75}
76