/**
  * @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);
 }
 public static function addSegmentToDatabasePlaylist($dbConn, $playlistId, $segmentId)
 {
     $columnNames = array(self::PLAYLIST_COLUMN_NAME, self::SEGMENT_COLUMN_NAME);
     $values = array($playlistId, $segmentId);
     return writeToDatabase::writeEntryToDatabase($dbConn, self::PLAYLIST_SEGMENTS_TABLE_NAME, $columnNames, $values);
 }
 /**
  * @param PDO $dbConn
  *
  * @param Segment $segmentObject
  *
  * @return int
  */
 public static function saveNewSegmentToDatabase($dbConn, $segmentObject)
 {
     list($columnNames, $values) = self::processSegmentForWrite($segmentObject);
     $segmentId = writeToDatabase::writeEntryToDatabase($dbConn, self::TABLE_NAME, $columnNames, $values);
     managePlaylistEntries::addSegmentToDatabasePlaylist($dbConn, $segmentObject->getPlaylistId(), $segmentId);
     return $segmentId;
 }