/** * Handle episode * * @param array $data * @return Episode */ private function handleEpisode(array $data) { $episode = new Episode(); if (array_key_exists('number', $data)) { $number = explode('x', $data['number']); if (array_key_exists(0, $number)) { $episode->setSeasonNumber($number[0]); } if (array_key_exists(1, $number)) { $episode->setNumber($number[1]); } } if (array_key_exists('title', $data)) { $episode->setTitle($data['title']); } if (array_key_exists('airdate', $data)) { $episode->setAirdate($data['airdate']); } if (array_key_exists('url', $data)) { $episode->setLink($data['url']); } return $episode; }
/** * Handle Episode * * @param array $data * @return Episode */ protected function handleEpisode(array $data) { $episode = new Episode(); if (array_key_exists('epnum', $data)) { $episode->setNumber($data['epnum']); } if (array_key_exists('title', $data)) { $episode->setTitle($data['title']); } if (array_key_exists('airdate', $data)) { $episode->setAirdate($data['airdate']); } if (array_key_exists('link', $data)) { $episode->setLink($data['link']); } if (array_key_exists('screencap', $data)) { $episode->setScreencap($data['screencap']); } return $episode; }