Merge branch 'master' of dev.sourcefabric.org:airtime

This commit is contained in:
Martin Konecny 2013-04-30 15:00:45 -04:00
commit decb12f6b8
38 changed files with 4077 additions and 786 deletions

View file

@ -385,6 +385,7 @@ SELECT showt.name AS show_name,
showt.color AS show_color,
showt.background_color AS show_background_color,
showt.id AS show_id,
showt.linked AS linked,
si.starts AS si_starts,
si.ends AS si_ends,
si.time_filled AS si_time_filled,
@ -961,7 +962,7 @@ SQL;
Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute');
}
public static function createNewFormSections($p_view)
/*public static function createNewFormSections($p_view)
{
$formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho();
@ -1006,7 +1007,7 @@ SQL;
$p_view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$p_view->rebroadcast = $formRebroadcast;
$p_view->addNewShow = true;
}
}*/
/* This function is responsible for handling the case where an individual
* show instance in a repeating show was edited (via the context menu in the Calendar).
@ -1089,7 +1090,7 @@ SQL;
* Another clean-up is to move all the form manipulation to the proper form class.....
* -Martin
*/
public static function addUpdateShow($data, $controller, $validateStartDate,
/*public static function addUpdateShow($data, $controller, $validateStartDate,
$originalStartDate=null, $update=false, $instanceId=null)
{
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
@ -1141,13 +1142,13 @@ SQL;
$data["add_show_duration"] = $hValue.":".$mValue;
$formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
$formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
$formRecord->removeDecorator('DtDdWrapper');
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
$formRebroadcast->removeDecorator('DtDdWrapper');
$formRecord->removeDecorator('DtDdWrapper');
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
$formRebroadcast->removeDecorator('DtDdWrapper');
$record = $formRecord->isValid($data);
@ -1157,18 +1158,18 @@ SQL;
if ($repeats) {
$repeats = $formRepeats->checkReliantFields($data);
}
$formAbsoluteRebroadcast->reset();
//make it valid, results don't matter anyways.
$rebroadAb = 1;
$formAbsoluteRebroadcast->reset();
//make it valid, results don't matter anyways.
$rebroadAb = 1;
if ($data["add_show_rebroadcast"]) {
$rebroad = $formRebroadcast->isValid($data);
if ($rebroad) {
$rebroad = $formRebroadcast->checkReliantFields($data);
}
} else {
$rebroad = 1;
if ($data["add_show_rebroadcast"]) {
$rebroad = $formRebroadcast->isValid($data);
if ($rebroad) {
$rebroad = $formRebroadcast->checkReliantFields($data);
}
} else {
$rebroad = 1;
}
} else {
$repeats = 1;
$formRebroadcast->reset();
@ -1221,15 +1222,14 @@ SQL;
$controller->view->who = $formWho;
$controller->view->style = $formStyle;
$controller->view->live = $formLive;
$controller->view->rr = $formRecord;
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$controller->view->rebroadcast = $formRebroadcast;
$controller->view->rr = $formRecord;
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$controller->view->rebroadcast = $formRebroadcast;
//$controller->view->addNewShow = !$editShow;
//$controller->view->form = $controller->view->render('schedule/add-show-form.phtml');
return false;
}
}
}*/
public static function checkOverlappingShows($show_start, $show_end,
$update=false, $instanceId=null, $showId=null)
@ -1258,19 +1258,19 @@ WHERE (ends <= :show_end1
AND date(starts) >= (date(:show_end3) - INTERVAL '2 days')
AND modified_instance = FALSE
SQL;
if (is_null($showId)) {
$sql .= <<<SQL
if (is_null($showId)) {
$sql .= <<<SQL
AND id != :instanceId
ORDER BY ends
SQL;
$params[':instanceId'] = $instanceId;
} else {
$sql .= <<<SQL
$params[':instanceId'] = $instanceId;
} else {
$sql .= <<<SQL
AND show_id != :showId
ORDER BY ends
SQL;
$params[':showId'] = $showId;
}
$params[':showId'] = $showId;
}
$rows = Application_Common_Database::prepareAndExecute($sql, $params, 'all');
} else {
$sql = <<<SQL

View file

@ -45,13 +45,40 @@ class Application_Model_Scheduler
$this->checkUserPermissions = $value;
}
private function validateItemMove($itemsToMove, $destination)
{
$destinationInstanceId = $destination["instance"];
$destinationCcShowInstance = CcShowInstancesQuery::create()
->findPk($destinationInstanceId);
$isDestinationLinked = $destinationCcShowInstance->getCcShow()->isLinked();
foreach ($itemsToMove as $itemToMove) {
$sourceInstanceId = $itemToMove["instance"];
$ccShowInstance = CcShowInstancesQuery::create()
->findPk($sourceInstanceId);
//does the item being moved belong to a linked show
$isSourceLinked = $ccShowInstance->getCcShow()->isLinked();
if ($isDestinationLinked && !$isSourceLinked) {
throw new Exception("Cannot move items into linked shows");
} elseif (!$isDestinationLinked && $isSourceLinked) {
throw new Exception("Cannot move items out of linked shows");
} elseif ($isSourceLinked && $sourceInstanceId != $destinationInstanceId) {
throw new Exception(_("Cannot move items out of linked shows"));
}
}
}
/*
* make sure any incoming requests for scheduling are ligit.
*
* @param array $items, an array containing pks of cc_schedule items.
*/
private function validateRequest($items)
private function validateRequest($items, $addAction=false)
{
//$items is where tracks get inserted (they are schedule locations)
$nowEpoch = floatval($this->nowDT->format("U.u"));
for ($i = 0; $i < count($items); $i++) {
@ -59,9 +86,11 @@ class Application_Model_Scheduler
//could be added to the beginning of a show, which sends id = 0;
if ($id > 0) {
//schedule_id of where we are inserting after?
$schedInfo[$id] = $items[$i]["instance"];
}
//format is instance_id => timestamp
$instanceInfo[$items[$i]["instance"]] = $items[$i]["timestamp"];
}
@ -104,7 +133,7 @@ class Application_Model_Scheduler
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));
}
if ($instance->getDbRecord()) {
throw new Exception(_("You cannot add files to recording shows."));
}
@ -121,6 +150,28 @@ class Application_Model_Scheduler
Logging::info("ts {$ts} last sched {$lastSchedTs}");
throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName()));
}
/*
* Does the afterItem belong to a show that is linked AND
* currently playing?
* If yes, throw an exception
*/
if ($addAction) {
$ccShow = $instance->getCcShow();
if ($ccShow->isLinked()) {
//get all the linked shows instances and check if
//any of them are currently playing
$ccShowInstances = $ccShow->getCcShowInstancess();
$timeNowUTC = gmdate("Y-m-d H:i:s");
foreach ($ccShowInstances as $ccShowInstance) {
if ($ccShowInstance->getDbStarts() <= $timeNowUTC &&
$ccShowInstance->getDbEnds() > $timeNowUTC) {
throw new Exception(_("Content in linked shows must be scheduled before or after any one is broadcasted"));
}
}
}
}
}
}
@ -380,135 +431,227 @@ class Application_Model_Scheduler
$schedule->save($this->con);
}
/*
* @param array $scheduledIds
* @param array $fileIds
* @param array $playlistIds
/**
*
* Enter description here ...
* @param $scheduleItems
* cc_schedule items, where the items get inserted after
* @param $filesToInsert
* array of schedule item info, what gets inserted into cc_schedule
* @param $adjustSched
*/
private function insertAfter($scheduleItems, $schedFiles, $adjustSched = true, $mediaItems = null)
private function insertAfter($scheduleItems, $mediaItems, $filesToInsert=null, $adjustSched=true, $moveAction=false)
{
try {
$affectedShowInstances = array();
//dont want to recalculate times for moved items.
//dont want to recalculate times for moved items
//only moved items have a sched_id
$excludeIds = array();
foreach ($schedFiles as $file) {
if (isset($file["sched_id"])) {
$excludeIds[] = intval($file["sched_id"]);
}
}
$startProfile = microtime(true);
$temp = array();
$instance = null;
/* Items in shows are ordered by position number. We need to know
* the position when adding/moving items in linked shows so they are
* added or moved in the correct position
*/
$pos = 0;
foreach ($scheduleItems as $schedule) {
$id = intval($schedule["id"]);
// if mediaItmes is passed in, we want to create contents
// at the time of insert. This is for dyanmic blocks or
// playlist that contains dynamic blocks
if ($mediaItems != null) {
$schedFiles = array();
foreach ($mediaItems as $media) {
$schedFiles = array_merge($schedFiles, $this->retrieveMediaFiles($media["id"], $media["type"]));
/* Find out if the show where the cursor position (where an item will
* be inserted) is located is linked or not. If the show is linked,
* we need to make sure there isn't another cursor selection in one of it's
* linked shows. If there is that will cause a duplication, in the least,
* of inserted items
*/
if ($id != 0) {
$ccSchedule = CcScheduleQuery::create()->findPk($schedule["id"]);
$ccShowInstance = CcShowInstancesQuery::create()->findPk($ccSchedule->getDbInstanceId());
$ccShow = $ccShowInstance->getCcShow();
if ($ccShow->isLinked()) {
$unique = $ccShow->getDbId() . $ccSchedule->getDbPosition();
if (!in_array($unique, $temp)) {
$temp[] = $unique;
} else {
continue;
}
}
} else {
$ccShowInstance = CcShowInstancesQuery::create()->findPk($schedule["instance"]);
$ccShow = $ccShowInstance->getccShow();
if ($ccShow->isLinked()) {
$unique = $ccShow->getDbId() . "a";
if (!in_array($unique, $temp)) {
$temp[] = $unique;
} else {
continue;
}
}
}
if ($id !== 0) {
$schedItem = CcScheduleQuery::create()->findPK($id, $this->con);
$instance = $schedItem->getCcShowInstances($this->con);
$schedItemEndDT = $schedItem->getDbEnds(null);
$nextStartDT = $this->findNextStartTime($schedItemEndDT, $instance);
}
//selected empty row to add after
else {
/* If the show where the cursor position is located is linked
* we need to insert the items for each linked instance belonging
* to that show
*/
$instances = $this->getInstances($schedule["instance"]);
foreach($instances as $instance) {
if ($id !== 0) {
$schedItem = CcScheduleQuery::create()->findPK($id, $this->con);
/* We use the selected cursor's position to find the same
* positions in every other linked instance
*/
$pos = $schedItem->getDbPosition();
$instance = CcShowInstancesQuery::create()->findPK($schedule["instance"], $this->con);
$ccSchedule = CcScheduleQuery::create()
->filterByDbInstanceId($instance->getDbId())
->filterByDbPosition($pos)
->findOne();
$showStartDT = $instance->getDbStarts(null);
$nextStartDT = $this->findNextStartTime($showStartDT, $instance);
}
//$schedItemEndDT = $schedItem->getDbEnds(null);
$schedItemEndDT = $ccSchedule->getDbEnds(null);
$nextStartDT = $this->findNextStartTime($schedItemEndDT, $instance);
if (!in_array($instance->getDbId(), $affectedShowInstances)) {
$affectedShowInstances[] = $instance->getDbId();
}
$pos++;
}
//selected empty row to add after
else {
$showStartDT = $instance->getDbStarts(null);
$nextStartDT = $this->findNextStartTime($showStartDT, $instance);
if ($adjustSched === true) {
$pstart = microtime(true);
$followingSchedItems = CcScheduleQuery::create()
->filterByDBStarts($nextStartDT->format("Y-m-d H:i:s.u"), Criteria::GREATER_EQUAL)
->filterByDbInstanceId($instance->getDbId())
->filterByDbId($excludeIds, Criteria::NOT_IN)
->orderByDbStarts()
->find($this->con);
$pend = microtime(true);
Logging::debug("finding all following items.");
Logging::debug(floatval($pend) - floatval($pstart));
}
foreach ($schedFiles as $file) {
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
//item existed previously and is being moved.
//need to keep same id for resources if we want REST.
if (isset($file['sched_id'])) {
$sched = CcScheduleQuery::create()->findPK($file['sched_id'], $this->con);
} else {
$sched = new CcSchedule();
//show is empty so start position counter at 0
$pos = 0;
}
// default fades are in seconds
// we need to convert to '00:00:00' format
$file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']);
$file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']);
$sched->setDbStarts($nextStartDT)
->setDbEnds($endTimeDT)
->setDbCueIn($file['cuein'])
->setDbCueOut($file['cueout'])
->setDbFadeIn($file['fadein'])
->setDbFadeOut($file['fadeout'])
->setDbClipLength($file['cliplength'])
->setDbInstanceId($instance->getDbId());
switch ($file["type"]) {
case 0:
$sched->setDbFileId($file['id']);
break;
case 1:
$sched->setDbStreamId($file['id']);
break;
default: break;
if (!in_array($instance->getDbId(), $affectedShowInstances)) {
$affectedShowInstances[] = $instance->getDbId();
}
$sched->save($this->con);
/*
* $adjustSched is true if there are schedule items
* following the item just inserted, per show instance
*/
if ($adjustSched === true) {
$nextStartDT = $endTimeDT;
}
$pstart = microtime(true);
if ($adjustSched === true) {
$initalStartDT = clone $nextStartDT;
$pstart = microtime(true);
$pend = microtime(true);
Logging::debug("finding all following items.");
Logging::debug(floatval($pend) - floatval($pstart));
}
//recalculate the start/end times after the inserted items.
foreach ($followingSchedItems as $item) {
if (is_null($filesToInsert)) {
$filesToInsert = array();
foreach ($mediaItems as $media) {
$filesToInsert = array_merge($filesToInsert, $this->retrieveMediaFiles($media["id"], $media["type"]));
}
}
foreach ($filesToInsert as $file) {
//item existed previously and is being moved.
//need to keep same id for resources if we want REST.
if (isset($file['sched_id'])) {
$sched = CcScheduleQuery::create()->findPk($file["sched_id"]);
$endTimeDT = $this->findEndTime($nextStartDT, $item->getDbClipLength());
$excludeIds[] = intval($sched->getDbId());
$file["cliplength"] = $sched->getDbClipLength();
$file["cuein"] = $sched->getDbCueIn();
$file["cueout"] = $sched->getDbCueOut();
$file["fadein"] = $sched->getDbFadeIn();
$file["fadeout"] = $sched->getDbFadeOut();
} else {
$sched = new CcSchedule();
}
$endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']);
// default fades are in seconds
// we need to convert to '00:00:00' format
$file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']);
$file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']);
$sched->setDbStarts($nextStartDT)
->setDbEnds($endTimeDT)
->setDbCueIn($file['cuein'])
->setDbCueOut($file['cueout'])
->setDbFadeIn($file['fadein'])
->setDbFadeOut($file['fadeout'])
->setDbClipLength($file['cliplength'])
->setDbPosition($pos);
//->setDbInstanceId($instance->getDbId());
if (!$moveAction) {
$sched->setDbInstanceId($instance->getDbId());
}
switch ($file["type"]) {
case 0:
$sched->setDbFileId($file['id']);
break;
case 1:
$sched->setDbStreamId($file['id']);
break;
default: break;
}
$sched->save($this->con);
$item->setDbStarts($nextStartDT);
$item->setDbEnds($endTimeDT);
$item->save($this->con);
$nextStartDT = $endTimeDT;
$pos++;
}//all files have been inserted/moved
// update is_scheduled flag for each cc_file
foreach ($filesToInsert as $file) {
$db_file = CcFilesQuery::create()->findPk($file['id'], $this->con);
$db_file->setDbIsScheduled(true);
$db_file->save($this->con);
}
/* Reset files to insert so we can get a new set of files. We have
* to do this in case we are inserting a dynamic block
*/
if (!$moveAction) {
$filesToInsert = null;
}
$pend = microtime(true);
Logging::debug("adjusting all following items.");
Logging::debug(floatval($pend) - floatval($pstart));
}
}
/* If we are adjusting start and end times for items
* after the insert location, we need to exclude the
* schedule item we just inserted because it has correct
* start and end times*/
$excludeIds[] = $sched->getDbId();
if ($adjustSched === true) {
$followingSchedItems = CcScheduleQuery::create()
->filterByDBStarts($initalStartDT->format("Y-m-d H:i:s.u"), Criteria::GREATER_EQUAL)
->filterByDbInstanceId($instance->getDbId())
->filterByDbId($excludeIds, Criteria::NOT_IN)
->orderByDbStarts()
->find($this->con);
$pstart = microtime(true);
//recalculate the start/end times after the inserted items.
foreach ($followingSchedItems as $item) {
$endTimeDT = $this->findEndTime($nextStartDT, $item->getDbClipLength());
$item->setDbStarts($nextStartDT);
$item->setDbEnds($endTimeDT);
$item->setDbPosition($pos);
$item->save($this->con);
$nextStartDT = $endTimeDT;
$pos++;
}
$pend = microtime(true);
Logging::debug("adjusting all following items.");
Logging::debug(floatval($pend) - floatval($pstart));
}
}//for each instance
}//for each schedule location
$endProfile = microtime(true);
Logging::debug("finished adding scheduled items.");
@ -525,13 +668,6 @@ class Application_Model_Scheduler
$instance->updateScheduleStatus($this->con);
}
// update is_scheduled flag for each cc_file
foreach ($schedFiles as $file) {
$db_file = CcFilesQuery::create()->findPk($file['id'], $this->con);
$db_file->setDbIsScheduled(true);
$db_file->save($this->con);
}
$endProfile = microtime(true);
Logging::debug("updating show instances status.");
Logging::debug(floatval($endProfile) - floatval($startProfile));
@ -552,46 +688,53 @@ class Application_Model_Scheduler
}
}
private function getInstances($instanceId)
{
$ccShowInstance = CcShowInstancesQuery::create()->findPk($instanceId);
$ccShow = $ccShowInstance->getCcShow();
if ($ccShow->isLinked()) {
return $ccShow->getCcShowInstancess();
} else {
return array($ccShowInstance);
}
}
/*
* @param array $scheduleItems
* @param array $mediaItems
* @param array $scheduleItems (schedule_id and instance_id it belongs to)
* @param array $mediaItems (file|block|playlist|webstream)
*/
public function scheduleAfter($scheduleItems, $mediaItems, $adjustSched = true)
{
$this->con->beginTransaction();
$schedFiles = array();
try {
$this->validateRequest($scheduleItems, true);
$this->validateRequest($scheduleItems);
$requireDynamicContentCreation = false;
foreach ($mediaItems as $media) {
if ($media['type'] == "playlist") {
$pl = new Application_Model_Playlist($media['id']);
if ($pl->hasDynamicBlock()) {
$requireDynamicContentCreation = true;
break;
}
} else if ($media['type'] == "block") {
$bl = new Application_Model_Block($media['id']);
if (!$bl->isStatic()) {
$requireDynamicContentCreation = true;
break;
}
}
}
if ($requireDynamicContentCreation) {
$this->insertAfter($scheduleItems, $schedFiles, $adjustSched, $mediaItems);
} else {
foreach ($mediaItems as $media) {
$schedFiles = array_merge($schedFiles, $this->retrieveMediaFiles($media["id"], $media["type"]));
}
$this->insertAfter($scheduleItems, $schedFiles, $adjustSched);
}
/*
* create array of arrays
* array of schedule item info
* (sched_id is the cc_schedule id and is set if an item is being
* moved because it is already in cc_schedule)
* [0] = Array(
* id => 1,
* cliplength => 00:04:32,
* cuein => 00:00:00,
* cueout => 00:04:32,
* fadein => 00.5,
* fadeout => 00.5,
* sched_id => ,
* type => 0)
* [1] = Array(
* id => 2,
* cliplength => 00:05:07,
* cuein => 00:00:00,
* cueout => 00:05:07,
* fadein => 00.5,
* fadeout => 00.5,
* sched_id => ,
* type => 0)
*/
$this->insertAfter($scheduleItems, $mediaItems, null, $adjustSched);
$this->con->commit();
@ -615,6 +758,7 @@ class Application_Model_Scheduler
try {
$this->validateItemMove($selectedItems, $afterItems[0]);
$this->validateRequest($selectedItems);
$this->validateRequest($afterItems);
@ -668,7 +812,7 @@ class Application_Model_Scheduler
$startProfile = microtime(true);
$this->insertAfter($afterItems, $movedData, $adjustSched);
$this->insertAfter($afterItems, null, $movedData, $adjustSched, true);
$endProfile = microtime(true);
Logging::debug("inserting after removing gaps.");
@ -692,7 +836,7 @@ class Application_Model_Scheduler
}
}
public function removeItems($scheduledItems, $adjustSched = true)
public function removeItems($scheduledItems, $adjustSched = true, $cancelShow=false)
{
$showInstances = array();
$this->con->beginTransaction();
@ -713,6 +857,31 @@ class Application_Model_Scheduler
$instance = $removedItem->getCcShowInstances($this->con);
//check if instance is linked and if so get the schedule items
//for all linked instances so we can delete them too
if (!$cancelShow && $instance->getCcShow()->isLinked()) {
//returns all linked instances if linked
$ccShowInstances = $this->getInstances($instance->getDbId());
$instanceIds = array();
foreach ($ccShowInstances as $ccShowInstance) {
$instanceIds[] = $ccShowInstance->getDbId();
}
/*
* Find all the schedule items that are in the same position
* as the selected item by the user.
* The position of each track is the same across each linked instance
*/
$itemsToDelete = CcScheduleQuery::create()
->filterByDbPosition($removedItem->getDbPosition())
->filterByDbInstanceId($instanceIds, Criteria::IN)
->find();
foreach ($itemsToDelete as $item) {
if (!$removedItems->contains($item)) {
$removedItems->append($item);
}
}
}
//check to truncate the currently playing item instead of deleting it.
if ($removedItem->isCurrentItem($this->epochNow)) {
@ -816,7 +985,7 @@ class Application_Model_Scheduler
$remove[$i]["id"] = $items[$i]->getDbId();
}
$this->removeItems($remove, false);
$this->removeItems($remove, false, true);
}
} else {
$rebroadcasts = $instance->getCcShowInstancessRelatedByDbId(null, $this->con);

View file

@ -1113,11 +1113,13 @@ SQL;
*/
public static function create($data)
{
$startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']);
$utcStartDateTime = clone $startDateTime;
$utcStartDateTime->setTimezone(new DateTimeZone('UTC'));
/*$startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']);*/
// these are not used
/*$utcStartDateTime = clone $startDateTime;
$utcStartDateTime->setTimezone(new DateTimeZone('UTC'));*/
if ($data['add_show_no_end']) {
/*if ($data['add_show_no_end']) {
$endDate = NULL;
} elseif ($data['add_show_repeats']) {
$endDateTime = new DateTime($data['add_show_end_date']);
@ -1129,28 +1131,29 @@ SQL;
//$endDateTime->setTimezone(new DateTimeZone('UTC'));
$endDateTime->add(new DateInterval("P1D"));
$endDate = $endDateTime->format("Y-m-d");
}
}*/
//What we are doing here is checking if the show repeats or if
//any repeating days have been checked. If not, then by default
//the "selected" DOW is the initial day.
//DOW in local time.
$startDow = date("w", $startDateTime->getTimestamp());
/*$startDow = date("w", $startDateTime->getTimestamp());
if (!$data['add_show_repeats']) {
$data['add_show_day_check'] = array($startDow);
} elseif ($data['add_show_repeats'] && $data['add_show_day_check'] == "") {
$data['add_show_day_check'] = array($startDow);
}
}*/
//find repeat type or set to a non repeating show.
$repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;
/*$repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;*/
if ($data['add_show_id'] == -1) {
/*if ($data['add_show_id'] == -1) {
$ccShow = new CcShow();
} else {
$ccShow = CcShowQuery::create()->findPK($data['add_show_id']);
}
$ccShow->setDbName($data['add_show_name']);
}*/
/*$ccShow->setDbName($data['add_show_name']);
$ccShow->setDbDescription($data['add_show_description']);
$ccShow->setDbUrl($data['add_show_url']);
$ccShow->setDbGenre($data['add_show_genre']);
@ -1160,25 +1163,26 @@ SQL;
$ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1);
$ccShow->setDbLiveStreamUser($data['custom_username']);
$ccShow->setDbLiveStreamPass($data['custom_password']);
$ccShow->save();
$ccShow->save();*/
$showId = $ccShow->getDbId();
/*$showId = $ccShow->getDbId();*/
$isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0;
/*$isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0;*/
if ($data['add_show_id'] != -1) {
/*if ($data['add_show_id'] != -1) {
$show = new Application_Model_Show($showId);
//CC-4150 CULPRIT
$show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType);
}
}*/
//check if we are adding or updating a show, and if updating
//erase all the show's show_days information first.
if ($data['add_show_id'] != -1) {
/*if ($data['add_show_id'] != -1) {
CcShowDaysQuery::create()->filterByDbShowId($data['add_show_id'])->delete();
}
}*/
//don't set day for monthly repeat type, it's invalid.
if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) {
/*if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) {
$showDay = new CcShowDays();
$showDay->setDbFirstShow($startDateTime->format("Y-m-d"));
$showDay->setDbLastShow($endDate);
@ -1215,19 +1219,19 @@ SQL;
$showDay->save();
}
}
}
}*/
//check if we are adding or updating a show, and if updating
//erase all the show's future show_rebroadcast information first.
if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) {
/*if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) {
CcShowRebroadcastQuery::create()
->filterByDbShowId($data['add_show_id'])
->delete();
}
}*/
//adding rows to cc_show_rebroadcast
/* TODO: Document magic constant 10 and define it properly somewhere
--RG */
if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) {
/*if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) {
for ($i=1; $i<=10; $i++) {
if ($data['add_show_rebroadcast_date_'.$i]) {
$showRebroad = new CcShowRebroadcast();
@ -1264,14 +1268,14 @@ SQL;
$showRebroad->save();
}
}
}
}*/
//check if we are adding or updating a show, and if updating
//erase all the show's show_rebroadcast information first.
if ($data['add_show_id'] != -1) {
/*if ($data['add_show_id'] != -1) {
CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete();
}
if (is_array($data['add_show_hosts'])) {
}*/
/*if (is_array($data['add_show_hosts'])) {
//add selected hosts to cc_show_hosts table.
foreach ($data['add_show_hosts'] as $host) {
$showHost = new CcShowHosts();
@ -1279,9 +1283,9 @@ SQL;
$showHost->setDbHost($host);
$showHost->save();
}
}
}*/
if ($data['add_show_id'] != -1) {
/*if ($data['add_show_id'] != -1) {
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
$con->beginTransaction();
@ -1306,12 +1310,12 @@ SQL;
Logging::info("Couldn't update schedule status.");
Logging::info($e->getMessage());
}
}
}*/
Application_Model_Show::populateShowUntil($showId);
Application_Model_RabbitMq::PushSchedule();
/*Application_Model_Show::populateShowUntil($showId);
Application_Model_RabbitMq::PushSchedule();*/
return $showId;
/*return $showId;*/
}
/**
@ -1321,7 +1325,7 @@ SQL;
*
* @param int $p_showId
*/
public static function populateShowUntil($p_showId)
/*public static function populateShowUntil($p_showId)
{
$con = Propel::getConnection();
$date = Application_Model_Preference::GetShowsPopulatedUntil();
@ -1342,7 +1346,7 @@ SQL;
foreach ($res as $showDaysRow) {
Application_Model_Show::populateShow($showDaysRow, $p_populateUntilDateTime);
}
}
}*/
/**
* We are going to use cc_show_days as a template, to generate Show Instances. This function
@ -1355,7 +1359,7 @@ SQL;
* @param DateTime $p_populateUntilDateTime
* DateTime object in UTC time.
*/
private static function populateShow($p_showDaysRow, $p_populateUntilDateTime)
/*private static function populateShow($p_showDaysRow, $p_populateUntilDateTime)
{
// TODO : use constants instead of int values here? or maybe php will
// get enum types by the time somebody gets around to fix this. -- RG
@ -1369,7 +1373,7 @@ SQL;
Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P1M');
}
Application_Model_RabbitMq::PushSchedule();
}
}*/
/**
* Creates a single show instance. If the show is recorded, it may have multiple
@ -1382,7 +1386,7 @@ SQL;
*/
private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime)
{
$show_id = $p_showRow["show_id"];
/*$show_id = $p_showRow["show_id"];
$first_show = $p_showRow["first_show"]; //non-UTC
$start_time = $p_showRow["start_time"]; //non-UTC
$duration = $p_showRow["duration"];
@ -1393,41 +1397,42 @@ SQL;
//start & end UTC DateTimes for the show.
list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start, $duration, $timezone);
if ($utcStartDateTime->getTimestamp() < $p_populateUntilDateTime->getTimestamp()) {
$currentUtcTimestamp = gmdate("Y-m-d H:i:s");
$currentUtcTimestamp = gmdate("Y-m-d H:i:s");*/
$show = new Application_Model_Show($show_id);
/*$show = new Application_Model_Show($show_id);
if ($show->hasInstance()) {
$ccShowInstance = $show->getInstance();
$newInstance = false;
} else {
}*/ /*else {
$ccShowInstance = new CcShowInstances();
$newInstance = true;
}
}*/
if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) {
/*if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) {
$ccShowInstance->setDbShowId($show_id);
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
$ccShowInstance->setDbRecord($record);
$ccShowInstance->save();
}
}*/
$show_instance_id = $ccShowInstance->getDbId();
$showInstance = new Application_Model_ShowInstance($show_instance_id);
/* $show_instance_id = $ccShowInstance->getDbId();
$showInstance = new Application_Model_ShowInstance($show_instance_id);*/
if (!$newInstance) {
/*if (!$newInstance) {
$showInstance->correctScheduleStartTimes();
}
}*/
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
/*$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
$rebroadcasts = Application_Common_Database::prepareAndExecute($sql,
array( ':show_id' => $show_id ), 'all');
array( ':show_id' => $show_id ), 'all');*/
if ($showInstance->isRecorded()) {
/*if ($showInstance->isRecorded()) {
//only do this for editing
$showInstance->deleteRebroadcasts();
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
}
}
}*/
/*}*/
}
/**
@ -1444,7 +1449,7 @@ SQL;
*/
private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval)
{
$show_id = $p_showDaysRow["show_id"];
/*$show_id = $p_showDaysRow["show_id"];
$next_pop_date = $p_showDaysRow["next_pop_date"];
$first_show = $p_showDaysRow["first_show"]; //non-UTC
$last_show = $p_showDaysRow["last_show"]; //non-UTC
@ -1464,21 +1469,23 @@ SQL;
$utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone);
//convert $last_show into a UTC DateTime object, or null if there is no last show.
$utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;
$utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;*/
$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
/*$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id";
$rebroadcasts = Application_Common_Database::prepareAndExecute( $sql,
array( ':show_id' => $show_id ), 'all');
$show = new Application_Model_Show($show_id);
$show = new Application_Model_Show($show_id);*/
while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp()
&& (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){
/*while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp()
&& (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){*/
list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone);
/*list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone);*/
if ($show->hasInstanceOnDate($utcStartDateTime)) {
//determine if we are adding a new show
//or editing a show
/* if ($show->hasInstanceOnDate($utcStartDateTime)) {
$ccShowInstance = $show->getInstanceOnDate($utcStartDateTime);
if ($ccShowInstance->getDbModifiedInstance()) {
@ -1491,12 +1498,12 @@ SQL;
} else {
$ccShowInstance = new CcShowInstances();
$newInstance = true;
}
}*/
/* When editing the start/end time of a repeating show, we don't want to
* change shows that started in the past. So check the start time.
*/
if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) {
/*if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) {
$ccShowInstance->setDbShowId($show_id);
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
@ -1506,21 +1513,22 @@ SQL;
$show_instance_id = $ccShowInstance->getDbId();
$showInstance = new Application_Model_ShowInstance($show_instance_id);
$showInstance = new Application_Model_ShowInstance($show_instance_id);*/
/* If we are updating a show then make sure that the scheduled content within
* the show is updated to the correct time. */
if (!$newInstance) {
// don't we already do this in deletePossiblyInvalidInstances???
/*if (!$newInstance) {
$showInstance->correctScheduleStartTimes();
}
}*/
$showInstance->deleteRebroadcasts();
/*$showInstance->deleteRebroadcasts();
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone);
list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone);*/
}
/*}*/
Application_Model_Show::setNextPop($start, $show_id, $day);
/*Application_Model_Show::setNextPop($start, $show_id, $day);*/
}
private static function advanceRepeatingDate($p_interval, $start, $timezone)
@ -1574,7 +1582,7 @@ SQL;
*/
private static function createUTCStartEndDateTime($p_start, $p_duration, $p_timezone=null, $p_offset=null)
{
$timezone = $p_timezone ? $p_timezone : date_default_timezone_get();
/*$timezone = $p_timezone ? $p_timezone : date_default_timezone_get();
$startDateTime = new DateTime($p_start, new DateTimeZone($timezone));
if (isset($p_offset)) {
@ -1588,7 +1596,7 @@ SQL;
list($hours, $mins) = array_slice($duration, 0, 2);
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
return array($startDateTime, $endDateTime);
return array($startDateTime, $endDateTime);*/
}
/* Create rebroadcast instances for a created show marked for recording
@ -1614,7 +1622,7 @@ SQL;
{
//Y-m-d
//use only the date part of the show start time stamp for the offsets to work properly.
$date = explode(" ", $p_startTime);
/*$date = explode(" ", $p_startTime);
$start_date = $date[0];
foreach ($p_rebroadcasts as $rebroadcast) {
@ -1636,7 +1644,7 @@ SQL;
$newRebroadcastInstance->setDbOriginalShow($p_showInstanceId);
$newRebroadcastInstance->save();
}
}
}*/
}
/**
@ -1656,7 +1664,8 @@ SQL;
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
//if application is requesting shows past our previous populated until date, generate shows up until this point.
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) {
Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp);
$service_show = new Application_Service_ShowService();
$ccShow = $service_show->delegateInstanceCreation(null, $end_timestamp, true);
Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp);
}

View file

@ -19,6 +19,7 @@ class Application_Model_ShowBuilder
private $contentDT;
private $epoch_now;
private $currentShow;
private $currentShowId;
private $showInstances = array();
@ -27,6 +28,7 @@ class Application_Model_ShowBuilder
"footer" => false,
"empty" => false,
"allowed" => false,
"linked_allowed" => true,
"id" => 0,
"instance" => "",
"starts" => "",
@ -85,6 +87,18 @@ class Application_Model_ShowBuilder
return;
}
if ($this->currentShow) {
$this->currentShowId = $p_item["show_id"];
}
/* If any linked show instance is currently playing
* we have to disable editing, or else the times
* will not make sense for shows scheduled in the future
*/
if ($p_item["linked"] && $p_item["show_id"] == $this->currentShowId) {
$row["linked_allowed"] = false;
}
if ($this->user->canSchedule($p_item["show_id"]) == true) {
$row["allowed"] = true;
}
@ -174,7 +188,7 @@ class Application_Model_ShowBuilder
private function makeHeaderRow($p_item)
{
$row = $this->defaultRowArray;
$this->isAllowed($p_item, $row);
//$this->isAllowed($p_item, $row);
$this->getRowTimestamp($p_item, $row);
$this->getItemColor($p_item, $row);
@ -217,6 +231,8 @@ class Application_Model_ShowBuilder
$this->currentShow = false;
}
$this->isAllowed($p_item, $row);
$row["header"] = true;
$row["starts"] = $showStartDT->format("Y-m-d H:i");
$row["startDate"] = $showStartDT->format("Y-m-d");

View file

@ -391,7 +391,7 @@ SQL;
* @param int $plId
* Playlist ID.
*/
public function addPlaylistToShow($pl_id, $checkUserPerm = true)
/*public function addPlaylistToShow($pl_id, $checkUserPerm = true)
{
$ts = intval($this->_showInstance->getDbLastScheduled("U")) ? : 0;
$id = $this->_showInstance->getDbId();
@ -401,7 +401,7 @@ SQL;
array(array("id" => 0, "instance" => $id, "timestamp" => $ts)),
array(array("id" => $pl_id, "type" => "playlist"))
);
}
}*/
/**
* Add a media file as the last item in the show.
@ -427,12 +427,12 @@ SQL;
* @param array $plIds
* An array of playlist IDs.
*/
public function scheduleShow($plIds)
/*public function scheduleShow($plIds)
{
foreach ($plIds as $plId) {
$this->addPlaylistToShow($plId);
}
}
}*/
public function clearShow()
{

View file

@ -15,4 +15,171 @@
*/
class CcShow extends BaseCcShow {
public function getCcShowDays(){
return CcShowDaysQuery::create()->filterByDbShowId($this->getDbId())->find();
}
/**
* Gets an array of CcShowDays objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this CcShow is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelCollection|array CcShowDays[] List of CcShowDays objects
* @throws PropelException
*/
public function getFirstCcShowDay($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcShowDayss || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowDayss) {
// return empty collection
$this->initCcShowDayss();
} else {
$collCcShowDayss = CcShowDaysQuery::create(null, $criteria)
->filterByCcShow($this)
->orderByDbFirstShow()
->limit(1)
->find($con);
if (null !== $criteria) {
return $collCcShowDayss;
}
$this->collCcShowDayss = $collCcShowDayss;
}
}
return $this->collCcShowDayss[0];
}
/**
* Gets an array of CcShowInstances objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this CcShow is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects
* @throws PropelException
*/
public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcShowInstancess || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowInstancess) {
// return empty collection
$this->initCcShowInstancess();
} else {
$collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria)
->filterByCcShow($this)
->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN)
->filterByDbModifiedInstance(false)
->find($con);
if (null !== $criteria) {
return $collCcShowInstancess;
}
$this->collCcShowInstancess = $collCcShowInstancess;
}
}
return $this->collCcShowInstancess;
}
public function isRecorded()
{
$ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($this->getDbId())
->filterByDbRecord(1)
->filterByDbModifiedInstance(false)
->findOne();
return (!is_null($ccShowInstances));
}
public function isRebroadcast()
{
$ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($this->getDbId())
->filterByDbRebroadcast(1)
->filterByDbModifiedInstance(false)
->findOne();
return (!is_null($ccShowInstances));
}
public function getRebroadcastsRelative()
{
return CcShowRebroadcastQuery::create()
->filterByDbShowId($this->getDbId())
->orderByDbDayOffset()
->find();
}
public function getRebroadcastsAbsolute()
{
return CcShowInstancesQuery::create()
->filterByDbShowId($this->getDbId())
->filterByDbRebroadcast(1)
->filterByDbModifiedInstance(false)
->orderByDbStarts()
->find();
}
public function isLinked()
{
return $this->getDbLinked();
}
public function isLinkable()
{
return $this->getDbIsLinkable();
}
/**
* Gets an array of CcShowInstances objects which contain a foreign key that references this object.
*
* If the $criteria is not null, it is used to always fetch the results from the database.
* Otherwise the results are fetched from the database the first time, then cached.
* Next time the same method is called without $criteria, the cached collection is returned.
* If this CcShow is new, it will return
* an empty collection or the current collection; the criteria is ignored on a new object.
*
* @param Criteria $criteria optional Criteria object to narrow the query
* @param PropelPDO $con optional connection object
* @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects
* @throws PropelException
*/
public function getCcShowInstancess($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcShowInstancess || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowInstancess) {
// return empty collection
$this->initCcShowInstancess();
} else {
$collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria)
->filterByCcShow($this)
->filterByDbModifiedInstance(false)
->filterByDbStarts(gmdate("Y-m-d H:i:s"), criteria::GREATER_THAN)
->orderByDbId()
->find($con);
if (null !== $criteria) {
return $collCcShowInstancess;
}
$this->collCcShowInstancess = $collCcShowInstancess;
}
}
return $this->collCcShowInstancess;
}
public function getInstanceIds() {
$instanceIds = array();
foreach ($this->getCcShowInstancess() as $ccShowInstance) {
$instanceIds[] = $ccShowInstance->getDbId();
}
return $instanceIds;
}
} // CcShow

View file

@ -15,4 +15,54 @@
*/
class CcShowDays extends BaseCcShowDays {
public function isRepeating()
{
return $this->getDbRepeatType() != -1;
}
public function getUTCStartDateAndTime()
{
$dt = new DateTime(
"{$this->getDbFirstShow()} {$this->getDbStartTime()}",
new DateTimeZone($this->getDbTimezone())
);
$dt->setTimezone(new DateTimeZone("UTC"));
return $dt;
}
public function getLocalStartDateAndTime()
{
$dt = new DateTime(
"{$this->getDbFirstShow()} {$this->getDbStartTime()}",
new DateTimeZone($this->getDbTimezone())
);
return $dt;
}
/**
*
* Enter description here ...
* @param DateTime $startDateTime first show in user's local time
*/
public function getLocalEndDateAndTime($showStart)
{
$startDateTime = clone $showStart;
$duration = explode(":", $this->getDbDuration());
return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M'));
}
public function isShowStartInPast()
{
return $this->getUTCStartDateAndTime()->format("Y-m-d H:i:s") < gmdate("Y-m-d H:i:s");
}
public function formatDuration()
{
$info = explode(':',$this->getDbDuration());
return str_pad(intval($info[0]),2,'0',STR_PAD_LEFT).'h '.str_pad(intval($info[1]),2,'0',STR_PAD_LEFT).'m';
}
} // CcShowDays

View file

@ -175,4 +175,20 @@ class CcShowInstances extends BaseCcShowInstances {
return true;
}
public function isRecorded()
{
return $this->getDbRecord() == 1 ? true : false;
}
public function isRebroadcast()
{
return $this->getDbRebroadcast() == 1 ? true : false;
}
public function getLocalStartDateTime()
{
$startDT = $this->getDbStarts(null);
return $startDT->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone()));
}
} // CcShowInstances

View file

@ -15,4 +15,16 @@
*/
class CcSubjs extends BaseCcSubjs {
public function isAdminOrPM()
{
return $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER;
}
public function isHostOfShow($showId)
{
return CcShowHostsQuery::create()
->filterByDbShow($showId)
->filterByDbHost($this->getDbId())
->count() > 0;
}
} // CcSubjs

View file

@ -52,6 +52,7 @@ class CcScheduleTableMap extends TableMap {
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
$this->addColumn('PLAYOUT_STATUS', 'DbPlayoutStatus', 'SMALLINT', true, null, 1);
$this->addColumn('BROADCASTED', 'DbBroadcasted', 'SMALLINT', true, null, 0);
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', true, null, 0);
// validators
} // initialize()

View file

@ -0,0 +1,70 @@
<?php
/**
* This class defines the structure of the 'cc_show_stamp' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.airtime.map
*/
class CcShowStampTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcShowStampTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('cc_show_stamp');
$this->setPhpName('CcShowStamp');
$this->setClassname('CcShowStamp');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_show_stamp_id_seq');
// columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null);
$this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null);
$this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null);
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', true, null, null);
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('FADE_IN', 'DbFadeIn', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('FADE_OUT', 'DbFadeOut', 'VARCHAR', false, null, '00:00:00');
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcWebstream', 'CcWebstream', RelationMap::MANY_TO_ONE, array('stream_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
} // buildRelations()
} // CcShowStampTableMap

View file

@ -49,6 +49,8 @@ class CcShowTableMap extends TableMap {
$this->addColumn('LIVE_STREAM_USING_CUSTOM_AUTH', 'DbLiveStreamUsingCustomAuth', 'BOOLEAN', false, null, false);
$this->addColumn('LIVE_STREAM_USER', 'DbLiveStreamUser', 'VARCHAR', false, 255, null);
$this->addColumn('LIVE_STREAM_PASS', 'DbLiveStreamPass', 'VARCHAR', false, 255, null);
$this->addColumn('LINKED', 'DbLinked', 'BOOLEAN', true, null, false);
$this->addColumn('IS_LINKABLE', 'DbIsLinkable', 'BOOLEAN', true, null, true);
// validators
} // initialize()

View file

@ -0,0 +1,68 @@
<?php
/**
* This class defines the structure of the 'cc_stamp_contents' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.airtime.map
*/
class CcStampContentsTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcStampContentsTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('cc_stamp_contents');
$this->setPhpName('CcStampContents');
$this->setClassname('CcStampContents');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_stamp_contents_id_seq');
// columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addForeignKey('STAMP_ID', 'DbStampId', 'INTEGER', 'cc_stamp', 'ID', true, null, null);
$this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null);
$this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null);
$this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null);
$this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null);
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('FADE_IN', 'DbFadeIn', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('FADE_OUT', 'DbFadeOut', 'VARCHAR', false, null, '00:00:00');
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcStamp', 'CcStamp', RelationMap::MANY_TO_ONE, array('stamp_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcWebstream', 'CcWebstream', RelationMap::MANY_TO_ONE, array('stream_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null);
} // buildRelations()
} // CcStampContentsTableMap

View file

@ -0,0 +1,58 @@
<?php
/**
* This class defines the structure of the 'cc_stamp' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.airtime.map
*/
class CcStampTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcStampTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('cc_stamp');
$this->setPhpName('CcStamp');
$this->setClassname('CcStamp');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_stamp_id_seq');
// columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null);
$this->addColumn('LINKED', 'DbLinked', 'BOOLEAN', true, null, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
$this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'stamp_id', ), 'CASCADE', null);
} // buildRelations()
} // CcStampTableMap

View file

@ -114,6 +114,13 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
*/
protected $broadcasted;
/**
* The value for the position field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $position;
/**
* @var CcShowInstances
*/
@ -162,6 +169,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->media_item_played = false;
$this->playout_status = 1;
$this->broadcasted = 0;
$this->position = 0;
}
/**
@ -406,6 +414,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return $this->broadcasted;
}
/**
* Get the [position] column value.
*
* @return int
*/
public function getDbPosition()
{
return $this->position;
}
/**
* Set the value of [id] column.
*
@ -816,6 +834,26 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return $this;
} // setDbBroadcasted()
/**
* Set the value of [position] column.
*
* @param int $v new value
* @return CcSchedule The current object (for fluent API support)
*/
public function setDbPosition($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->position !== $v || $this->isNew()) {
$this->position = $v;
$this->modifiedColumns[] = CcSchedulePeer::POSITION;
}
return $this;
} // setDbPosition()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -850,6 +888,10 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return false;
}
if ($this->position !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@ -886,6 +928,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->instance_id = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null;
$this->playout_status = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null;
$this->broadcasted = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
$this->position = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null;
$this->resetModified();
$this->setNew(false);
@ -894,7 +937,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 14; // 14 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 15; // 15 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcSchedule object", $e);
@ -1315,6 +1358,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
case 13:
return $this->getDbBroadcasted();
break;
case 14:
return $this->getDbPosition();
break;
default:
return null;
break;
@ -1353,6 +1399,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$keys[11] => $this->getDbInstanceId(),
$keys[12] => $this->getDbPlayoutStatus(),
$keys[13] => $this->getDbBroadcasted(),
$keys[14] => $this->getDbPosition(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcShowInstances) {
@ -1437,6 +1484,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
case 13:
$this->setDbBroadcasted($value);
break;
case 14:
$this->setDbPosition($value);
break;
} // switch()
}
@ -1475,6 +1525,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if (array_key_exists($keys[11], $arr)) $this->setDbInstanceId($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbPlayoutStatus($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDbBroadcasted($arr[$keys[13]]);
if (array_key_exists($keys[14], $arr)) $this->setDbPosition($arr[$keys[14]]);
}
/**
@ -1500,6 +1551,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if ($this->isColumnModified(CcSchedulePeer::INSTANCE_ID)) $criteria->add(CcSchedulePeer::INSTANCE_ID, $this->instance_id);
if ($this->isColumnModified(CcSchedulePeer::PLAYOUT_STATUS)) $criteria->add(CcSchedulePeer::PLAYOUT_STATUS, $this->playout_status);
if ($this->isColumnModified(CcSchedulePeer::BROADCASTED)) $criteria->add(CcSchedulePeer::BROADCASTED, $this->broadcasted);
if ($this->isColumnModified(CcSchedulePeer::POSITION)) $criteria->add(CcSchedulePeer::POSITION, $this->position);
return $criteria;
}
@ -1574,6 +1626,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$copyObj->setDbInstanceId($this->instance_id);
$copyObj->setDbPlayoutStatus($this->playout_status);
$copyObj->setDbBroadcasted($this->broadcasted);
$copyObj->setDbPosition($this->position);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1906,6 +1959,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->instance_id = null;
$this->playout_status = null;
$this->broadcasted = null;
$this->position = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View file

@ -26,7 +26,7 @@ abstract class BaseCcSchedulePeer {
const TM_CLASS = 'CcScheduleTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 14;
const NUM_COLUMNS = 15;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -73,6 +73,9 @@ abstract class BaseCcSchedulePeer {
/** the column name for the BROADCASTED field */
const BROADCASTED = 'cc_schedule.BROADCASTED';
/** the column name for the POSITION field */
const POSITION = 'cc_schedule.POSITION';
/**
* An identiy map to hold any loaded instances of CcSchedule objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
@ -89,12 +92,12 @@ abstract class BaseCcSchedulePeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbStreamId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbStreamId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::STREAM_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'STREAM_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'stream_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbStreamId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', 'DbPosition', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbStreamId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', 'dbPosition', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::STREAM_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, self::POSITION, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'STREAM_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', 'POSITION', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'stream_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', 'position', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
);
/**
@ -104,12 +107,12 @@ abstract class BaseCcSchedulePeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbClipLength' => 5, 'DbFadeIn' => 6, 'DbFadeOut' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbMediaItemPlayed' => 10, 'DbInstanceId' => 11, 'DbPlayoutStatus' => 12, 'DbBroadcasted' => 13, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbClipLength' => 5, 'dbFadeIn' => 6, 'dbFadeOut' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbMediaItemPlayed' => 10, 'dbInstanceId' => 11, 'dbPlayoutStatus' => 12, 'dbBroadcasted' => 13, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::CLIP_LENGTH => 5, self::FADE_IN => 6, self::FADE_OUT => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::MEDIA_ITEM_PLAYED => 10, self::INSTANCE_ID => 11, self::PLAYOUT_STATUS => 12, self::BROADCASTED => 13, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'CLIP_LENGTH' => 5, 'FADE_IN' => 6, 'FADE_OUT' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'MEDIA_ITEM_PLAYED' => 10, 'INSTANCE_ID' => 11, 'PLAYOUT_STATUS' => 12, 'BROADCASTED' => 13, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'stream_id' => 4, 'clip_length' => 5, 'fade_in' => 6, 'fade_out' => 7, 'cue_in' => 8, 'cue_out' => 9, 'media_item_played' => 10, 'instance_id' => 11, 'playout_status' => 12, 'broadcasted' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbClipLength' => 5, 'DbFadeIn' => 6, 'DbFadeOut' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbMediaItemPlayed' => 10, 'DbInstanceId' => 11, 'DbPlayoutStatus' => 12, 'DbBroadcasted' => 13, 'DbPosition' => 14, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbClipLength' => 5, 'dbFadeIn' => 6, 'dbFadeOut' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbMediaItemPlayed' => 10, 'dbInstanceId' => 11, 'dbPlayoutStatus' => 12, 'dbBroadcasted' => 13, 'dbPosition' => 14, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::CLIP_LENGTH => 5, self::FADE_IN => 6, self::FADE_OUT => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::MEDIA_ITEM_PLAYED => 10, self::INSTANCE_ID => 11, self::PLAYOUT_STATUS => 12, self::BROADCASTED => 13, self::POSITION => 14, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'CLIP_LENGTH' => 5, 'FADE_IN' => 6, 'FADE_OUT' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'MEDIA_ITEM_PLAYED' => 10, 'INSTANCE_ID' => 11, 'PLAYOUT_STATUS' => 12, 'BROADCASTED' => 13, 'POSITION' => 14, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'stream_id' => 4, 'clip_length' => 5, 'fade_in' => 6, 'fade_out' => 7, 'cue_in' => 8, 'cue_out' => 9, 'media_item_played' => 10, 'instance_id' => 11, 'playout_status' => 12, 'broadcasted' => 13, 'position' => 14, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
);
/**
@ -195,6 +198,7 @@ abstract class BaseCcSchedulePeer {
$criteria->addSelectColumn(CcSchedulePeer::INSTANCE_ID);
$criteria->addSelectColumn(CcSchedulePeer::PLAYOUT_STATUS);
$criteria->addSelectColumn(CcSchedulePeer::BROADCASTED);
$criteria->addSelectColumn(CcSchedulePeer::POSITION);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STARTS');
@ -210,6 +214,7 @@ abstract class BaseCcSchedulePeer {
$criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.PLAYOUT_STATUS');
$criteria->addSelectColumn($alias . '.BROADCASTED');
$criteria->addSelectColumn($alias . '.POSITION');
}
}

View file

@ -20,6 +20,7 @@
* @method CcScheduleQuery orderByDbInstanceId($order = Criteria::ASC) Order by the instance_id column
* @method CcScheduleQuery orderByDbPlayoutStatus($order = Criteria::ASC) Order by the playout_status column
* @method CcScheduleQuery orderByDbBroadcasted($order = Criteria::ASC) Order by the broadcasted column
* @method CcScheduleQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
*
* @method CcScheduleQuery groupByDbId() Group by the id column
* @method CcScheduleQuery groupByDbStarts() Group by the starts column
@ -35,6 +36,7 @@
* @method CcScheduleQuery groupByDbInstanceId() Group by the instance_id column
* @method CcScheduleQuery groupByDbPlayoutStatus() Group by the playout_status column
* @method CcScheduleQuery groupByDbBroadcasted() Group by the broadcasted column
* @method CcScheduleQuery groupByDbPosition() Group by the position column
*
* @method CcScheduleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -73,6 +75,7 @@
* @method CcSchedule findOneByDbInstanceId(int $instance_id) Return the first CcSchedule filtered by the instance_id column
* @method CcSchedule findOneByDbPlayoutStatus(int $playout_status) Return the first CcSchedule filtered by the playout_status column
* @method CcSchedule findOneByDbBroadcasted(int $broadcasted) Return the first CcSchedule filtered by the broadcasted column
* @method CcSchedule findOneByDbPosition(int $position) Return the first CcSchedule filtered by the position column
*
* @method array findByDbId(int $id) Return CcSchedule objects filtered by the id column
* @method array findByDbStarts(string $starts) Return CcSchedule objects filtered by the starts column
@ -88,6 +91,7 @@
* @method array findByDbInstanceId(int $instance_id) Return CcSchedule objects filtered by the instance_id column
* @method array findByDbPlayoutStatus(int $playout_status) Return CcSchedule objects filtered by the playout_status column
* @method array findByDbBroadcasted(int $broadcasted) Return CcSchedule objects filtered by the broadcasted column
* @method array findByDbPosition(int $position) Return CcSchedule objects filtered by the position column
*
* @package propel.generator.airtime.om
*/
@ -576,6 +580,37 @@ abstract class BaseCcScheduleQuery extends ModelCriteria
return $this->addUsingAlias(CcSchedulePeer::BROADCASTED, $dbBroadcasted, $comparison);
}
/**
* Filter the query on the position column
*
* @param int|array $dbPosition The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByDbPosition($dbPosition = null, $comparison = null)
{
if (is_array($dbPosition)) {
$useMinMax = false;
if (isset($dbPosition['min'])) {
$this->addUsingAlias(CcSchedulePeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbPosition['max'])) {
$this->addUsingAlias(CcSchedulePeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::POSITION, $dbPosition, $comparison);
}
/**
* Filter the query by a related CcShowInstances object
*

View file

@ -95,6 +95,20 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/
protected $live_stream_pass;
/**
* The value for the linked field.
* Note: this column has a database default value of: false
* @var boolean
*/
protected $linked;
/**
* The value for the is_linkable field.
* Note: this column has a database default value of: true
* @var boolean
*/
protected $is_linkable;
/**
* @var array CcShowInstances[] Collection to store aggregation of CcShowInstances objects.
*/
@ -142,6 +156,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->genre = '';
$this->live_stream_using_airtime_auth = false;
$this->live_stream_using_custom_auth = false;
$this->linked = false;
$this->is_linkable = true;
}
/**
@ -264,6 +280,26 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->live_stream_pass;
}
/**
* Get the [linked] column value.
*
* @return boolean
*/
public function getDbLinked()
{
return $this->linked;
}
/**
* Get the [is_linkable] column value.
*
* @return boolean
*/
public function getDbIsLinkable()
{
return $this->is_linkable;
}
/**
* Set the value of [id] column.
*
@ -484,6 +520,46 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this;
} // setDbLiveStreamPass()
/**
* Set the value of [linked] column.
*
* @param boolean $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbLinked($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->linked !== $v || $this->isNew()) {
$this->linked = $v;
$this->modifiedColumns[] = CcShowPeer::LINKED;
}
return $this;
} // setDbLinked()
/**
* Set the value of [is_linkable] column.
*
* @param boolean $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbIsLinkable($v)
{
if ($v !== null) {
$v = (boolean) $v;
}
if ($this->is_linkable !== $v || $this->isNew()) {
$this->is_linkable = $v;
$this->modifiedColumns[] = CcShowPeer::IS_LINKABLE;
}
return $this;
} // setDbIsLinkable()
/**
* Indicates whether the columns in this object are only set to default values.
*
@ -514,6 +590,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return false;
}
if ($this->linked !== false) {
return false;
}
if ($this->is_linkable !== true) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@ -547,6 +631,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->live_stream_using_custom_auth = ($row[$startcol + 8] !== null) ? (boolean) $row[$startcol + 8] : null;
$this->live_stream_user = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null;
$this->live_stream_pass = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
$this->linked = ($row[$startcol + 11] !== null) ? (boolean) $row[$startcol + 11] : null;
$this->is_linkable = ($row[$startcol + 12] !== null) ? (boolean) $row[$startcol + 12] : null;
$this->resetModified();
$this->setNew(false);
@ -555,7 +641,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->ensureConsistency();
}
return $startcol + 11; // 11 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 13; // 13 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcShow object", $e);
@ -959,6 +1045,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
case 10:
return $this->getDbLiveStreamPass();
break;
case 11:
return $this->getDbLinked();
break;
case 12:
return $this->getDbIsLinkable();
break;
default:
return null;
break;
@ -993,6 +1085,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$keys[8] => $this->getDbLiveStreamUsingCustomAuth(),
$keys[9] => $this->getDbLiveStreamUser(),
$keys[10] => $this->getDbLiveStreamPass(),
$keys[11] => $this->getDbLinked(),
$keys[12] => $this->getDbIsLinkable(),
);
return $result;
}
@ -1057,6 +1151,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
case 10:
$this->setDbLiveStreamPass($value);
break;
case 11:
$this->setDbLinked($value);
break;
case 12:
$this->setDbIsLinkable($value);
break;
} // switch()
}
@ -1092,6 +1192,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if (array_key_exists($keys[8], $arr)) $this->setDbLiveStreamUsingCustomAuth($arr[$keys[8]]);
if (array_key_exists($keys[9], $arr)) $this->setDbLiveStreamUser($arr[$keys[9]]);
if (array_key_exists($keys[10], $arr)) $this->setDbLiveStreamPass($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setDbLinked($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbIsLinkable($arr[$keys[12]]);
}
/**
@ -1114,6 +1216,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH)) $criteria->add(CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH, $this->live_stream_using_custom_auth);
if ($this->isColumnModified(CcShowPeer::LIVE_STREAM_USER)) $criteria->add(CcShowPeer::LIVE_STREAM_USER, $this->live_stream_user);
if ($this->isColumnModified(CcShowPeer::LIVE_STREAM_PASS)) $criteria->add(CcShowPeer::LIVE_STREAM_PASS, $this->live_stream_pass);
if ($this->isColumnModified(CcShowPeer::LINKED)) $criteria->add(CcShowPeer::LINKED, $this->linked);
if ($this->isColumnModified(CcShowPeer::IS_LINKABLE)) $criteria->add(CcShowPeer::IS_LINKABLE, $this->is_linkable);
return $criteria;
}
@ -1185,6 +1289,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$copyObj->setDbLiveStreamUsingCustomAuth($this->live_stream_using_custom_auth);
$copyObj->setDbLiveStreamUser($this->live_stream_user);
$copyObj->setDbLiveStreamPass($this->live_stream_pass);
$copyObj->setDbLinked($this->linked);
$copyObj->setDbIsLinkable($this->is_linkable);
if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of
@ -1787,6 +1893,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->live_stream_using_custom_auth = null;
$this->live_stream_user = null;
$this->live_stream_pass = null;
$this->linked = null;
$this->is_linkable = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();

View file

@ -26,7 +26,7 @@ abstract class BaseCcShowPeer {
const TM_CLASS = 'CcShowTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 11;
const NUM_COLUMNS = 13;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -64,6 +64,12 @@ abstract class BaseCcShowPeer {
/** the column name for the LIVE_STREAM_PASS field */
const LIVE_STREAM_PASS = 'cc_show.LIVE_STREAM_PASS';
/** the column name for the LINKED field */
const LINKED = 'cc_show.LINKED';
/** the column name for the IS_LINKABLE field */
const IS_LINKABLE = 'cc_show.IS_LINKABLE';
/**
* An identiy map to hold any loaded instances of CcShow objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
@ -80,12 +86,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::GENRE, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, self::LIVE_STREAM_USING_AIRTIME_AUTH, self::LIVE_STREAM_USING_CUSTOM_AUTH, self::LIVE_STREAM_USER, self::LIVE_STREAM_PASS, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', 'DbLiveStreamUsingAirtimeAuth', 'DbLiveStreamUsingCustomAuth', 'DbLiveStreamUser', 'DbLiveStreamPass', 'DbLinked', 'DbIsLinkable', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', 'dbLiveStreamUsingAirtimeAuth', 'dbLiveStreamUsingCustomAuth', 'dbLiveStreamUser', 'dbLiveStreamPass', 'dbLinked', 'dbIsLinkable', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::GENRE, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, self::LIVE_STREAM_USING_AIRTIME_AUTH, self::LIVE_STREAM_USING_CUSTOM_AUTH, self::LIVE_STREAM_USER, self::LIVE_STREAM_PASS, self::LINKED, self::IS_LINKABLE, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', 'LIVE_STREAM_USING_AIRTIME_AUTH', 'LIVE_STREAM_USING_CUSTOM_AUTH', 'LIVE_STREAM_USER', 'LIVE_STREAM_PASS', 'LINKED', 'IS_LINKABLE', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', 'live_stream_using_airtime_auth', 'live_stream_using_custom_auth', 'live_stream_user', 'live_stream_pass', 'linked', 'is_linkable', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
);
/**
@ -95,12 +101,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::GENRE => 3, self::DESCRIPTION => 4, self::COLOR => 5, self::BACKGROUND_COLOR => 6, self::LIVE_STREAM_USING_AIRTIME_AUTH => 7, self::LIVE_STREAM_USING_CUSTOM_AUTH => 8, self::LIVE_STREAM_USER => 9, self::LIVE_STREAM_PASS => 10, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, 'DbLiveStreamUsingAirtimeAuth' => 7, 'DbLiveStreamUsingCustomAuth' => 8, 'DbLiveStreamUser' => 9, 'DbLiveStreamPass' => 10, 'DbLinked' => 11, 'DbIsLinkable' => 12, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, 'dbLiveStreamUsingAirtimeAuth' => 7, 'dbLiveStreamUsingCustomAuth' => 8, 'dbLiveStreamUser' => 9, 'dbLiveStreamPass' => 10, 'dbLinked' => 11, 'dbIsLinkable' => 12, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::GENRE => 3, self::DESCRIPTION => 4, self::COLOR => 5, self::BACKGROUND_COLOR => 6, self::LIVE_STREAM_USING_AIRTIME_AUTH => 7, self::LIVE_STREAM_USING_CUSTOM_AUTH => 8, self::LIVE_STREAM_USER => 9, self::LIVE_STREAM_PASS => 10, self::LINKED => 11, self::IS_LINKABLE => 12, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, 'LIVE_STREAM_USING_AIRTIME_AUTH' => 7, 'LIVE_STREAM_USING_CUSTOM_AUTH' => 8, 'LIVE_STREAM_USER' => 9, 'LIVE_STREAM_PASS' => 10, 'LINKED' => 11, 'IS_LINKABLE' => 12, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, 'live_stream_using_airtime_auth' => 7, 'live_stream_using_custom_auth' => 8, 'live_stream_user' => 9, 'live_stream_pass' => 10, 'linked' => 11, 'is_linkable' => 12, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, )
);
/**
@ -183,6 +189,8 @@ abstract class BaseCcShowPeer {
$criteria->addSelectColumn(CcShowPeer::LIVE_STREAM_USING_CUSTOM_AUTH);
$criteria->addSelectColumn(CcShowPeer::LIVE_STREAM_USER);
$criteria->addSelectColumn(CcShowPeer::LIVE_STREAM_PASS);
$criteria->addSelectColumn(CcShowPeer::LINKED);
$criteria->addSelectColumn(CcShowPeer::IS_LINKABLE);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME');
@ -195,6 +203,8 @@ abstract class BaseCcShowPeer {
$criteria->addSelectColumn($alias . '.LIVE_STREAM_USING_CUSTOM_AUTH');
$criteria->addSelectColumn($alias . '.LIVE_STREAM_USER');
$criteria->addSelectColumn($alias . '.LIVE_STREAM_PASS');
$criteria->addSelectColumn($alias . '.LINKED');
$criteria->addSelectColumn($alias . '.IS_LINKABLE');
}
}

View file

@ -17,6 +17,8 @@
* @method CcShowQuery orderByDbLiveStreamUsingCustomAuth($order = Criteria::ASC) Order by the live_stream_using_custom_auth column
* @method CcShowQuery orderByDbLiveStreamUser($order = Criteria::ASC) Order by the live_stream_user column
* @method CcShowQuery orderByDbLiveStreamPass($order = Criteria::ASC) Order by the live_stream_pass column
* @method CcShowQuery orderByDbLinked($order = Criteria::ASC) Order by the linked column
* @method CcShowQuery orderByDbIsLinkable($order = Criteria::ASC) Order by the is_linkable column
*
* @method CcShowQuery groupByDbId() Group by the id column
* @method CcShowQuery groupByDbName() Group by the name column
@ -29,6 +31,8 @@
* @method CcShowQuery groupByDbLiveStreamUsingCustomAuth() Group by the live_stream_using_custom_auth column
* @method CcShowQuery groupByDbLiveStreamUser() Group by the live_stream_user column
* @method CcShowQuery groupByDbLiveStreamPass() Group by the live_stream_pass column
* @method CcShowQuery groupByDbLinked() Group by the linked column
* @method CcShowQuery groupByDbIsLinkable() Group by the is_linkable column
*
* @method CcShowQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -64,6 +68,8 @@
* @method CcShow findOneByDbLiveStreamUsingCustomAuth(boolean $live_stream_using_custom_auth) Return the first CcShow filtered by the live_stream_using_custom_auth column
* @method CcShow findOneByDbLiveStreamUser(string $live_stream_user) Return the first CcShow filtered by the live_stream_user column
* @method CcShow findOneByDbLiveStreamPass(string $live_stream_pass) Return the first CcShow filtered by the live_stream_pass column
* @method CcShow findOneByDbLinked(boolean $linked) Return the first CcShow filtered by the linked column
* @method CcShow findOneByDbIsLinkable(boolean $is_linkable) Return the first CcShow filtered by the is_linkable column
*
* @method array findByDbId(int $id) Return CcShow objects filtered by the id column
* @method array findByDbName(string $name) Return CcShow objects filtered by the name column
@ -76,6 +82,8 @@
* @method array findByDbLiveStreamUsingCustomAuth(boolean $live_stream_using_custom_auth) Return CcShow objects filtered by the live_stream_using_custom_auth column
* @method array findByDbLiveStreamUser(string $live_stream_user) Return CcShow objects filtered by the live_stream_user column
* @method array findByDbLiveStreamPass(string $live_stream_pass) Return CcShow objects filtered by the live_stream_pass column
* @method array findByDbLinked(boolean $linked) Return CcShow objects filtered by the linked column
* @method array findByDbIsLinkable(boolean $is_linkable) Return CcShow objects filtered by the is_linkable column
*
* @package propel.generator.airtime.om
*/
@ -412,6 +420,40 @@ abstract class BaseCcShowQuery extends ModelCriteria
return $this->addUsingAlias(CcShowPeer::LIVE_STREAM_PASS, $dbLiveStreamPass, $comparison);
}
/**
* Filter the query on the linked column
*
* @param boolean|string $dbLinked The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByDbLinked($dbLinked = null, $comparison = null)
{
if (is_string($dbLinked)) {
$linked = in_array(strtolower($dbLinked), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
}
return $this->addUsingAlias(CcShowPeer::LINKED, $dbLinked, $comparison);
}
/**
* Filter the query on the is_linkable column
*
* @param boolean|string $dbIsLinkable The value to use as filter.
* Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByDbIsLinkable($dbIsLinkable = null, $comparison = null)
{
if (is_string($dbIsLinkable)) {
$is_linkable = in_array(strtolower($dbIsLinkable), array('false', 'off', '-', 'no', 'n', '0')) ? false : true;
}
return $this->addUsingAlias(CcShowPeer::IS_LINKABLE, $dbIsLinkable, $comparison);
}
/**
* Filter the query by a related CcShowInstances object
*