-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
37 lines (26 loc) · 901 Bytes
/
test.php
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
35
36
37
<?php
require_once 'vendor/autoload.php';
$token = new \Tmdb\ApiToken("API_KEY");
$client = new \Tmdb\Client($token);
$configRepository = new \Tmdb\Repository\ConfigurationRepository($client);
$config = $configRepository->load();
$imageHelper = new \Tmdb\Helper\ImageHelper($config);
$repository = new \Tmdb\Repository\MovieRepository($client);
$collection = $repository->getTopRated(array('page' => 1));
/* echo $collection->getTotalPages();
echo $collection->getTotalResults(); */
/* var_dump($collection); */
foreach ($collection as $item) {
echo $item->getposterPath();
echo $item->getId();
echo $item->getTitle();
echo $item->getOverview();
echo $item->getReleaseDate()->format('Y-m-d');
}
/* foreach ($collection as $item) {
$dates = $item->getReleaseDate();
foreach ($dates as $date) {
echo $date;
}
} */
/* echo $collection->getResults(); */