This commit is contained in:
Naomi 2013-08-20 17:23:48 -04:00
parent 007a7ee7ef
commit 84efdfd64a
2 changed files with 36 additions and 36 deletions

View file

@ -194,12 +194,12 @@ class PlayouthistoryController extends Zend_Controller_Action
$historyService->deletePlayedItem($history_id); $historyService->deletePlayedItem($history_id);
} }
public function deleteListItemsAction() public function deleteListItemsAction()
{ {
$history_ids = $this->_getParam('ids'); $history_ids = $this->_getParam('ids');
$historyService = new Application_Service_HistoryService(); $historyService = new Application_Service_HistoryService();
$historyService->deletePlayedItems($history_ids); $historyService->deletePlayedItems($history_ids);
} }
public function updateListItemAction() public function updateListItemAction()

View file

@ -826,23 +826,23 @@ class Application_Service_HistoryService
} }
} }
/* id is an id in cc_playout_history */ /* id is an id in cc_playout_history */
public function deletePlayedItems($ids) { public function deletePlayedItems($ids) {
$this->con->beginTransaction(); $this->con->beginTransaction();
try { try {
$records = CcPlayoutHistoryQuery::create()->findPks($ids, $this->con); $records = CcPlayoutHistoryQuery::create()->findPks($ids, $this->con);
$records->delete($this->con); $records->delete($this->con);
$this->con->commit(); $this->con->commit();
} }
catch (Exception $e) { catch (Exception $e) {
$this->con->rollback(); $this->con->rollback();
Logging::info($e); Logging::info($e);
throw $e; throw $e;
} }
} }
@ -863,19 +863,19 @@ class Application_Service_HistoryService
return $fields; return $fields;
} }
private function getPhpCasts() { private function getPhpCasts() {
$fields = array( $fields = array(
TEMPLATE_DATE => "strval", TEMPLATE_DATE => "strval",
TEMPLATE_TIME => "strval", TEMPLATE_TIME => "strval",
TEMPLATE_DATETIME => "strval", TEMPLATE_DATETIME => "strval",
TEMPLATE_STRING => "strval", TEMPLATE_STRING => "strval",
TEMPLATE_BOOLEAN => "intval", //boolval only exists in php 5.5+ wtf? TEMPLATE_BOOLEAN => "intval", //boolval only exists in php 5.5+ wtf?
TEMPLATE_INT => "intval", TEMPLATE_INT => "intval",
TEMPLATE_FLOAT => "floatval", TEMPLATE_FLOAT => "floatval",
); );
return $fields; return $fields;
} }
private function getSqlTypes() { private function getSqlTypes() {