コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
 /**
  * @param Segment $segmentObject
  * @return array
  */
 private static function processSegmentForWrite($segmentObject)
 {
     $startDateString = formatDateStringForDatabaseWrite($segmentObject->getStartTime());
     $columnNames = array(self::START_TIME_COLUMN_NAME, self::DURATION_COLUMN_NAME, self::SEGMENT_NAME_COLUMN_NAME, self::AUTHOR_COLUMN_NAME, self::ALBUM_COLUMN_NAME, self::CATEGORY_COLUMN_NAME, self::CAN_CON_COLUMN_NAME, self::NEW_RELEASE_COLUMN_NAME, self::FRENCH_VOCAL_MUSIC_COLUMN_NAME);
     $values = array($startDateString, $segmentObject->getDuration(), $segmentObject->getName(), $segmentObject->getAuthor(), $segmentObject->getAlbum(), $segmentObject->getCategory(), $segmentObject->isCanCon(), $segmentObject->isNewRelease(), $segmentObject->isFrenchVocalMusic());
     return array($columnNames, $values);
 }