-
-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathglobal_language_filter.php
More file actions
34 lines (27 loc) · 907 Bytes
/
global_language_filter.php
File metadata and controls
34 lines (27 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* This file is part of the Tmdb PHP API created by Michael Roterman.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Tmdb
* @author Michael Roterman <michael@wtfz.net>
* @copyright (c) 2013, Michael Roterman
* @version 4.0.0
*/
use Tmdb\Event\BeforeRequestEvent;
use Tmdb\Event\Listener\Request\LanguageFilterRequestListener;
use Tmdb\Repository\MovieRepository;
require_once '../vendor/autoload.php';
require_once 'apikey.php';
/** @var Tmdb\Client $client * */
$client = require_once('setup-client.php');
/** @var Symfony\Component\EventDispatcher\EventDispatcher $ed */
$ed = $client->getEventDispatcher();
$ed->addListener(
BeforeRequestEvent::class,
new LanguageFilterRequestListener('nl-NL')
);
$repository = new MovieRepository($client);
$movie = $repository->load(19995);