IM-733 Create Development timetable for Airtime Development

IM-777
Database structure for new History Feature
This commit is contained in:
Naomi 2013-07-03 15:20:40 -04:00
parent 328c1f3cac
commit 9f7e85b273

View file

@ -5,10 +5,10 @@ class Application_Service_HistoryService
private $con; private $con;
private $timezone; private $timezone;
public function __construct() public function __construct()
{ {
$this->con = isset($con) ? $con : Propel::getConnection(CcPlayoutHistoryPeer::DATABASE_NAME); $this->con = isset($con) ? $con : Propel::getConnection(CcPlayoutHistoryPeer::DATABASE_NAME);
$this->timezone = date_default_timezone_get(); $this->timezone = date_default_timezone_get();
} }
public function insertPlayedItem($schedId) { public function insertPlayedItem($schedId) {
@ -37,14 +37,14 @@ class Application_Service_HistoryService
//$metadata["end"] = $ends->format('H:i:s'); //$metadata["end"] = $ends->format('H:i:s');
$metadata["showname"] = $show->getDbName(); $metadata["showname"] = $show->getDbName();
$history = new CcPlayoutHistory(); $history = new CcPlayoutHistory();
$history->setDbFileId($fileId); $history->setDbFileId($fileId);
$history->setDbStarts($item->getDbStarts(null)); $history->setDbStarts($item->getDbStarts(null));
$history->setDbEnds($item->getDbEnds(null)); $history->setDbEnds($item->getDbEnds(null));
foreach ($metadata as $key => $val) { foreach ($metadata as $key => $val) {
$meta = new CcPlayoutHistoryMetaData(); $meta = new CcPlayoutHistoryMetaData();
$meta->setDbKey($key); $meta->setDbKey($key);
$meta->setDbValue($val); $meta->setDbValue($val);
$history->addCcPlayoutHistoryMetaData($meta); $history->addCcPlayoutHistoryMetaData($meta);
@ -55,9 +55,9 @@ class Application_Service_HistoryService
$this->con->commit(); $this->con->commit();
} }
catch (Exception $e) { catch (Exception $e) {
$this->con->rollback(); $this->con->rollback();
throw $e; throw $e;
} }
} }