Added functionality for deleting saved images when the show is deleted, updating the show image, and returning the showId to be used by ShowController

This commit is contained in:
Duncan Sommerville 2014-09-16 18:24:22 -04:00
parent f73432931c
commit f5a607ad90
1 changed files with 13 additions and 4 deletions

View File

@ -251,6 +251,9 @@ class Application_Service_ShowService
Logging::info("EXCEPTION: Show ".$action." failed.");
Logging::info($e->getMessage());
}
// Added to pass along to the RESTful ShowController
return $this->ccShow->getDbId();
}
/**
@ -732,6 +735,7 @@ SQL;
$con = Propel::getConnection();
$con->beginTransaction();
try {
if (!$currentUser->isAdminOrPM()) {
throw new Exception("Permission denied");
}
@ -743,6 +747,10 @@ SQL;
}
$showId = $ccShowInstance->getDbShowId();
if (!Rest_ShowController::deleteFileFromStor($showId)) {
throw new Exception("Error deleting show images");
}
if ($singleInstance) {
$ccShowInstances = array($ccShowInstance);
} else {
@ -1515,6 +1523,7 @@ SQL;
$ccShow->setDbLiveStreamUsingCustomAuth($showData['cb_custom_auth'] == 1);
$ccShow->setDbLiveStreamUser($showData['custom_username']);
$ccShow->setDbLiveStreamPass($showData['custom_password']);
$ccShow->setDbImagePath($showData['image_path']);
//Here a user has edited a show and linked it.
//We need to grab the existing show instances ids and fill their content