@@ -43,9 +43,11 @@ class FindFactory extends AbstractFactory
4343 */
4444 public function __construct (HttpClient $ httpClient )
4545 {
46- $ this ->movieFactory = new MovieFactory ($ httpClient );
47- $ this ->peopleFactory = new PeopleFactory ($ httpClient );
48- $ this ->tvFactory = new TvFactory ($ httpClient );
46+ $ this ->movieFactory = new MovieFactory ($ httpClient );
47+ $ this ->peopleFactory = new PeopleFactory ($ httpClient );
48+ $ this ->tvFactory = new TvFactory ($ httpClient );
49+ $ this ->tvSeasonFactory = new TvFactory ($ httpClient );
50+ $ this ->tvEpisodeFactory = new TvEpisodeFactory ($ httpClient );
4951
5052 parent ::__construct ($ httpClient );
5153 }
@@ -69,6 +71,14 @@ public function create(array $data = [])
6971 $ find ->setTvResults ($ this ->getTvFactory ()->createCollection ($ data ['tv_results ' ]));
7072 }
7173
74+ if (array_key_exists ('tv_season_results ' , $ data )) {
75+ $ find ->setTvSeasonResults ($ this ->getTvSeasonFactory ()->createCollection ($ data ['tv_season_results ' ]));
76+ }
77+
78+ if (array_key_exists ('tv_episode_results ' , $ data )) {
79+ $ find ->setTvEpisodeResults ($ this ->getTvSeasonFactory ()->createCollection ($ data ['tv_episode_results ' ]));
80+ }
81+
7282 return $ find ;
7383 }
7484
@@ -140,4 +150,42 @@ public function getTvFactory()
140150 {
141151 return $ this ->tvFactory ;
142152 }
153+
154+ /**
155+ * @return TvEpisodeFactory
156+ */
157+ public function getTvEpisodeFactory ()
158+ {
159+ return $ this ->tvEpisodeFactory ;
160+ }
161+
162+ /**
163+ * @param TvEpisodeFactory $tvEpisodeFactory
164+ * @return $this
165+ */
166+ public function setTvEpisodeFactory ($ tvEpisodeFactory )
167+ {
168+ $ this ->tvEpisodeFactory = $ tvEpisodeFactory ;
169+
170+ return $ this ;
171+ }
172+
173+ /**
174+ * @return TvFactory
175+ */
176+ public function getTvSeasonFactory ()
177+ {
178+ return $ this ->tvSeasonFactory ;
179+ }
180+
181+ /**
182+ * @param TvFactory $tvSeasonFactory
183+ * @return $this
184+ */
185+ public function setTvSeasonFactory ($ tvSeasonFactory )
186+ {
187+ $ this ->tvSeasonFactory = $ tvSeasonFactory ;
188+
189+ return $ this ;
190+ }
143191}
0 commit comments