CC-3277 : Overbooking a show to include 24+ hours of audio
truncating time values greater that the max allowed for time without timezone
This commit is contained in:
parent
438340ff9a
commit
1080bf692f
airtime_mvc/application/models/airtime
|
@ -5,7 +5,7 @@
|
|||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_show_instances' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
|
@ -15,4 +15,25 @@
|
|||
*/
|
||||
class CcShowInstances extends BaseCcShowInstances {
|
||||
|
||||
public function computeDbTimeFilled(PropelPDO $con)
|
||||
{
|
||||
$stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1');
|
||||
$stmt->bindValue(':p1', $this->getDbId());
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchColumn();
|
||||
|
||||
//$result is in the form H:i:s.u
|
||||
//patch fix for the current problem of > 23:59:59.99 for a show content
|
||||
//which causes problems with a time without timezone column type
|
||||
|
||||
try {
|
||||
$dt = new DateTime($result);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
$result = "23:59:59";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
} // CcShowInstances
|
||||
|
|
Loading…
Reference in New Issue