/** * @param PDO $dbConn * @param Episode $episodeObject * @return null */ public static function saveNewEpisode($dbConn, $episodeObject) { $startDateTimeObject = formatDateStringForDatabaseWrite($episodeObject->getStartTime()); $endDateTimeObject = formatDateStringForDatabaseWrite($episodeObject->getEndTime()); $columnNames = array(self::PLAYLIST_COLUMN_NAME, self::PROGRAM_COLUMN_NAME, self::PROGRAMMER_COLUMN_NAME, self::START_TIME_COLUMN_NAME, self::END_TIME_COLUMN_NAME, self::IS_PRERECORD_COLUMN_NAME, self::PRERECORD_COLUMN_NAME, self::IS_DRAFT_COLUMN_NAME); $values = array($episodeObject->getPlaylist()->getId(), $episodeObject->getProgram()->getId(), $episodeObject->getProgrammer()->getId(), $startDateTimeObject, $endDateTimeObject, $episodeObject->isPrerecord(), $episodeObject->getPrerecordDate(), true); return writeToDatabase::writeEntryToDatabase($dbConn, self::TABLE_NAME, $columnNames, $values); }