From 1a1d06d568bb70f935c2ddbc5b41f965949c8650 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 8 Mar 2016 11:07:51 +0100 Subject: [PATCH] Add getEpisodeByAirDate function to Client.php --- src/Moinax/TvDb/Client.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Moinax/TvDb/Client.php b/src/Moinax/TvDb/Client.php index 1377860..28ca395 100644 --- a/src/Moinax/TvDb/Client.php +++ b/src/Moinax/TvDb/Client.php @@ -296,6 +296,20 @@ public function getEpisodeById($episodeId, $language = null) return new Episode($data->Episode); } + + /** + * @param $serieId + * @param $airdate + * @param null $language + * + * @return Episode + */ + public function getEpisodeByAirDate($serieId, $airdate, $language = null) + { + $language = $language ? : $this->defaultLanguage; + $data = $this->fetchXml('GetEpisodeByAirDate.php?apikey=' . $this->apiKey . '&seriesid=' . $serieId . '&airdate=' . $airdate . '&language=' . $language ); + return new Episode($data->Episode); + } /** * Get updates list based on previous time you got data @@ -513,4 +527,4 @@ public static function removeEmptyIndexes($array) sort($array); return $array; } -} \ No newline at end of file +}