$segment->setIsNewRelease(false); $segment->setIsFrenchVocalMusic(false); $segment->setAdNumber(null); break; case 1: default: $segment->setName($name); $segment->setAuthor($author); $segment->setAlbum($album); $segment->setIsCanCon(false); $segment->setIsNewRelease(false); $segment->setIsFrenchVocalMusic(false); $segment->setAdNumber(null); break; } $errorsContainer = $segment->isValidForDraftSave($episode); if ($errorsContainer->doErrorsExist()) { $errorsList = $errorsContainer->getAllErrors(); outputErrorResponse(json_encode($errorsList)); } if ($editSegment) { $segment->setId($segmentId); manageSegmentEntries::editSegmentInDatabase($db, $segment); } else { manageSegmentEntries::saveNewSegmentToDatabase($db, $segment); } $episode = new Episode($db, $episodeId); $segmentList = $episode->getSegments(); $db = null; outputSuccessResponse($segmentList); } catch (PDOException $e) {