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

This commit is contained in:
mkonecny 2011-02-07 12:37:12 -05:00
commit 6c860dcff5
49 changed files with 4814 additions and 1773 deletions

View File

@ -4,7 +4,7 @@ require_once (__DIR__."/configs/navigation.php");
require_once (__DIR__."/configs/ACL.php"); require_once (__DIR__."/configs/ACL.php");
require_once 'propel/runtime/lib/Propel.php'; require_once 'propel/runtime/lib/Propel.php';
Propel::init(__DIR__."/configs/propel-config.php"); Propel::init(__DIR__."/configs/airtime-conf.php");
//DateTime in PHP 5.3.0+ need a default timezone set. //DateTime in PHP 5.3.0+ need a default timezone set.
$tz = ini_get('date.timezone') ? ini_get('date.timezone') : 'UTC'; $tz = ini_get('date.timezone') ? ini_get('date.timezone') : 'UTC';

View File

@ -1,6 +1,6 @@
<?php <?php
// This file generated by Propel 1.5.2 convert-conf target // This file generated by Propel 1.5.2 convert-conf target
// from XML runtime conf file /home/naomi/dev-campcaster/campcaster/build/runtime-conf.xml // from XML runtime conf file /home/naomiaro/dev-campcaster/campcaster/build/runtime-conf.xml
$conf = array ( $conf = array (
'datasources' => 'datasources' =>
array ( array (

View File

@ -36,6 +36,13 @@ return array (
'BaseCcShowPeer' => 'airtime/om/BaseCcShowPeer.php', 'BaseCcShowPeer' => 'airtime/om/BaseCcShowPeer.php',
'BaseCcShow' => 'airtime/om/BaseCcShow.php', 'BaseCcShow' => 'airtime/om/BaseCcShow.php',
'BaseCcShowQuery' => 'airtime/om/BaseCcShowQuery.php', 'BaseCcShowQuery' => 'airtime/om/BaseCcShowQuery.php',
'CcShowInstancesTableMap' => 'airtime/map/CcShowInstancesTableMap.php',
'CcShowInstancesPeer' => 'airtime/CcShowInstancesPeer.php',
'CcShowInstances' => 'airtime/CcShowInstances.php',
'CcShowInstancesQuery' => 'airtime/CcShowInstancesQuery.php',
'BaseCcShowInstancesPeer' => 'airtime/om/BaseCcShowInstancesPeer.php',
'BaseCcShowInstances' => 'airtime/om/BaseCcShowInstances.php',
'BaseCcShowInstancesQuery' => 'airtime/om/BaseCcShowInstancesQuery.php',
'CcShowDaysTableMap' => 'airtime/map/CcShowDaysTableMap.php', 'CcShowDaysTableMap' => 'airtime/map/CcShowDaysTableMap.php',
'CcShowDaysPeer' => 'airtime/CcShowDaysPeer.php', 'CcShowDaysPeer' => 'airtime/CcShowDaysPeer.php',
'CcShowDays' => 'airtime/CcShowDays.php', 'CcShowDays' => 'airtime/CcShowDays.php',
@ -50,13 +57,6 @@ return array (
'BaseCcShowHostsPeer' => 'airtime/om/BaseCcShowHostsPeer.php', 'BaseCcShowHostsPeer' => 'airtime/om/BaseCcShowHostsPeer.php',
'BaseCcShowHosts' => 'airtime/om/BaseCcShowHosts.php', 'BaseCcShowHosts' => 'airtime/om/BaseCcShowHosts.php',
'BaseCcShowHostsQuery' => 'airtime/om/BaseCcShowHostsQuery.php', 'BaseCcShowHostsQuery' => 'airtime/om/BaseCcShowHostsQuery.php',
'CcShowScheduleTableMap' => 'airtime/map/CcShowScheduleTableMap.php',
'CcShowSchedulePeer' => 'airtime/CcShowSchedulePeer.php',
'CcShowSchedule' => 'airtime/CcShowSchedule.php',
'CcShowScheduleQuery' => 'airtime/CcShowScheduleQuery.php',
'BaseCcShowSchedulePeer' => 'airtime/om/BaseCcShowSchedulePeer.php',
'BaseCcShowSchedule' => 'airtime/om/BaseCcShowSchedule.php',
'BaseCcShowScheduleQuery' => 'airtime/om/BaseCcShowScheduleQuery.php',
'CcPlaylistTableMap' => 'airtime/map/CcPlaylistTableMap.php', 'CcPlaylistTableMap' => 'airtime/map/CcPlaylistTableMap.php',
'CcPlaylistPeer' => 'airtime/CcPlaylistPeer.php', 'CcPlaylistPeer' => 'airtime/CcPlaylistPeer.php',
'CcPlaylist' => 'airtime/CcPlaylist.php', 'CcPlaylist' => 'airtime/CcPlaylist.php',

View File

@ -1,116 +0,0 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
return array (
'CcAccessTableMap' => 'airtime/map/CcAccessTableMap.php',
'CcAccessPeer' => 'airtime/CcAccessPeer.php',
'CcAccess' => 'airtime/CcAccess.php',
'CcAccessQuery' => 'airtime/CcAccessQuery.php',
'BaseCcAccessPeer' => 'airtime/om/BaseCcAccessPeer.php',
'BaseCcAccess' => 'airtime/om/BaseCcAccess.php',
'BaseCcAccessQuery' => 'airtime/om/BaseCcAccessQuery.php',
'CcBackupTableMap' => 'airtime/map/CcBackupTableMap.php',
'CcBackupPeer' => 'airtime/CcBackupPeer.php',
'CcBackup' => 'airtime/CcBackup.php',
'CcBackupQuery' => 'airtime/CcBackupQuery.php',
'BaseCcBackupPeer' => 'airtime/om/BaseCcBackupPeer.php',
'BaseCcBackup' => 'airtime/om/BaseCcBackup.php',
'BaseCcBackupQuery' => 'airtime/om/BaseCcBackupQuery.php',
'CcFilesTableMap' => 'airtime/map/CcFilesTableMap.php',
'CcFilesPeer' => 'airtime/CcFilesPeer.php',
'CcFiles' => 'airtime/CcFiles.php',
'CcFilesQuery' => 'airtime/CcFilesQuery.php',
'BaseCcFilesPeer' => 'airtime/om/BaseCcFilesPeer.php',
'BaseCcFiles' => 'airtime/om/BaseCcFiles.php',
'BaseCcFilesQuery' => 'airtime/om/BaseCcFilesQuery.php',
'CcPermsTableMap' => 'airtime/map/CcPermsTableMap.php',
'CcPermsPeer' => 'airtime/CcPermsPeer.php',
'CcPerms' => 'airtime/CcPerms.php',
'CcPermsQuery' => 'airtime/CcPermsQuery.php',
'BaseCcPermsPeer' => 'airtime/om/BaseCcPermsPeer.php',
'BaseCcPerms' => 'airtime/om/BaseCcPerms.php',
'BaseCcPermsQuery' => 'airtime/om/BaseCcPermsQuery.php',
'CcShowTableMap' => 'airtime/map/CcShowTableMap.php',
'CcShowPeer' => 'airtime/CcShowPeer.php',
'CcShow' => 'airtime/CcShow.php',
'CcShowQuery' => 'airtime/CcShowQuery.php',
'BaseCcShowPeer' => 'airtime/om/BaseCcShowPeer.php',
'BaseCcShow' => 'airtime/om/BaseCcShow.php',
'BaseCcShowQuery' => 'airtime/om/BaseCcShowQuery.php',
'CcShowDaysTableMap' => 'airtime/map/CcShowDaysTableMap.php',
'CcShowDaysPeer' => 'airtime/CcShowDaysPeer.php',
'CcShowDays' => 'airtime/CcShowDays.php',
'CcShowDaysQuery' => 'airtime/CcShowDaysQuery.php',
'BaseCcShowDaysPeer' => 'airtime/om/BaseCcShowDaysPeer.php',
'BaseCcShowDays' => 'airtime/om/BaseCcShowDays.php',
'BaseCcShowDaysQuery' => 'airtime/om/BaseCcShowDaysQuery.php',
'CcShowHostsTableMap' => 'airtime/map/CcShowHostsTableMap.php',
'CcShowHostsPeer' => 'airtime/CcShowHostsPeer.php',
'CcShowHosts' => 'airtime/CcShowHosts.php',
'CcShowHostsQuery' => 'airtime/CcShowHostsQuery.php',
'BaseCcShowHostsPeer' => 'airtime/om/BaseCcShowHostsPeer.php',
'BaseCcShowHosts' => 'airtime/om/BaseCcShowHosts.php',
'BaseCcShowHostsQuery' => 'airtime/om/BaseCcShowHostsQuery.php',
'CcShowScheduleTableMap' => 'airtime/map/CcShowScheduleTableMap.php',
'CcShowSchedulePeer' => 'airtime/CcShowSchedulePeer.php',
'CcShowSchedule' => 'airtime/CcShowSchedule.php',
'CcShowScheduleQuery' => 'airtime/CcShowScheduleQuery.php',
'BaseCcShowSchedulePeer' => 'airtime/om/BaseCcShowSchedulePeer.php',
'BaseCcShowSchedule' => 'airtime/om/BaseCcShowSchedule.php',
'BaseCcShowScheduleQuery' => 'airtime/om/BaseCcShowScheduleQuery.php',
'CcPlaylistTableMap' => 'airtime/map/CcPlaylistTableMap.php',
'CcPlaylistPeer' => 'airtime/CcPlaylistPeer.php',
'CcPlaylist' => 'airtime/CcPlaylist.php',
'CcPlaylistQuery' => 'airtime/CcPlaylistQuery.php',
'BaseCcPlaylistPeer' => 'airtime/om/BaseCcPlaylistPeer.php',
'BaseCcPlaylist' => 'airtime/om/BaseCcPlaylist.php',
'BaseCcPlaylistQuery' => 'airtime/om/BaseCcPlaylistQuery.php',
'CcPlaylistcontentsTableMap' => 'airtime/map/CcPlaylistcontentsTableMap.php',
'CcPlaylistcontentsPeer' => 'airtime/CcPlaylistcontentsPeer.php',
'CcPlaylistcontents' => 'airtime/CcPlaylistcontents.php',
'CcPlaylistcontentsQuery' => 'airtime/CcPlaylistcontentsQuery.php',
'BaseCcPlaylistcontentsPeer' => 'airtime/om/BaseCcPlaylistcontentsPeer.php',
'BaseCcPlaylistcontents' => 'airtime/om/BaseCcPlaylistcontents.php',
'BaseCcPlaylistcontentsQuery' => 'airtime/om/BaseCcPlaylistcontentsQuery.php',
'CcPrefTableMap' => 'airtime/map/CcPrefTableMap.php',
'CcPrefPeer' => 'airtime/CcPrefPeer.php',
'CcPref' => 'airtime/CcPref.php',
'CcPrefQuery' => 'airtime/CcPrefQuery.php',
'BaseCcPrefPeer' => 'airtime/om/BaseCcPrefPeer.php',
'BaseCcPref' => 'airtime/om/BaseCcPref.php',
'BaseCcPrefQuery' => 'airtime/om/BaseCcPrefQuery.php',
'CcScheduleTableMap' => 'airtime/map/CcScheduleTableMap.php',
'CcSchedulePeer' => 'airtime/CcSchedulePeer.php',
'CcSchedule' => 'airtime/CcSchedule.php',
'CcScheduleQuery' => 'airtime/CcScheduleQuery.php',
'BaseCcSchedulePeer' => 'airtime/om/BaseCcSchedulePeer.php',
'BaseCcSchedule' => 'airtime/om/BaseCcSchedule.php',
'BaseCcScheduleQuery' => 'airtime/om/BaseCcScheduleQuery.php',
'CcSessTableMap' => 'airtime/map/CcSessTableMap.php',
'CcSessPeer' => 'airtime/CcSessPeer.php',
'CcSess' => 'airtime/CcSess.php',
'CcSessQuery' => 'airtime/CcSessQuery.php',
'BaseCcSessPeer' => 'airtime/om/BaseCcSessPeer.php',
'BaseCcSess' => 'airtime/om/BaseCcSess.php',
'BaseCcSessQuery' => 'airtime/om/BaseCcSessQuery.php',
'CcSmembTableMap' => 'airtime/map/CcSmembTableMap.php',
'CcSmembPeer' => 'airtime/CcSmembPeer.php',
'CcSmemb' => 'airtime/CcSmemb.php',
'CcSmembQuery' => 'airtime/CcSmembQuery.php',
'BaseCcSmembPeer' => 'airtime/om/BaseCcSmembPeer.php',
'BaseCcSmemb' => 'airtime/om/BaseCcSmemb.php',
'BaseCcSmembQuery' => 'airtime/om/BaseCcSmembQuery.php',
'CcSubjsTableMap' => 'airtime/map/CcSubjsTableMap.php',
'CcSubjsPeer' => 'airtime/CcSubjsPeer.php',
'CcSubjs' => 'airtime/CcSubjs.php',
'CcSubjsQuery' => 'airtime/CcSubjsQuery.php',
'BaseCcSubjsPeer' => 'airtime/om/BaseCcSubjsPeer.php',
'BaseCcSubjs' => 'airtime/om/BaseCcSubjs.php',
'BaseCcSubjsQuery' => 'airtime/om/BaseCcSubjsQuery.php',
'CcTransTableMap' => 'airtime/map/CcTransTableMap.php',
'CcTransPeer' => 'airtime/CcTransPeer.php',
'CcTrans' => 'airtime/CcTrans.php',
'CcTransQuery' => 'airtime/CcTransQuery.php',
'BaseCcTransPeer' => 'airtime/om/BaseCcTransPeer.php',
'BaseCcTrans' => 'airtime/om/BaseCcTrans.php',
'BaseCcTransQuery' => 'airtime/om/BaseCcTransQuery.php',
);

View File

@ -141,6 +141,7 @@ $CC_CONFIG['playListTimeView'] = $CC_CONFIG['tblNamePrefix'].'playlisttimes';
$CC_CONFIG['showSchedule'] = $CC_CONFIG['tblNamePrefix'].'show_schedule'; $CC_CONFIG['showSchedule'] = $CC_CONFIG['tblNamePrefix'].'show_schedule';
$CC_CONFIG['showDays'] = $CC_CONFIG['tblNamePrefix'].'show_days'; $CC_CONFIG['showDays'] = $CC_CONFIG['tblNamePrefix'].'show_days';
$CC_CONFIG['showTable'] = $CC_CONFIG['tblNamePrefix'].'show'; $CC_CONFIG['showTable'] = $CC_CONFIG['tblNamePrefix'].'show';
$CC_CONFIG['showInstances'] = $CC_CONFIG['tblNamePrefix'].'show_instances';
$CC_CONFIG['playListSequence'] = $CC_CONFIG['playListTable'].'_id'; $CC_CONFIG['playListSequence'] = $CC_CONFIG['playListTable'].'_id';
$CC_CONFIG['filesSequence'] = $CC_CONFIG['filesTable'].'_id'; $CC_CONFIG['filesSequence'] = $CC_CONFIG['filesTable'].'_id';

View File

@ -1,20 +0,0 @@
<?php
// This file generated by Propel 1.5.2 convert-conf target
// from XML runtime conf file /home/naomiaro/dev-campcaster/campcaster/build/runtime-conf.xml
$conf = array (
'datasources' =>
array (
'airtime' =>
array (
'adapter' => 'pgsql',
'connection' =>
array (
'dsn' => 'pgsql:host=localhost;port=5432;dbname=airtime;user=airtime;password=airtime',
),
),
'default' => 'airtime',
),
'generator_version' => '1.5.2',
);
$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-propel-config.php');
return $conf;

View File

@ -2,7 +2,6 @@
class ScheduleController extends Zend_Controller_Action class ScheduleController extends Zend_Controller_Action
{ {
protected $sched_sess = null; protected $sched_sess = null;
public function init() public function init()
@ -49,17 +48,15 @@ class ScheduleController extends Zend_Controller_Action
{ {
$start = $this->_getParam('start', null); $start = $this->_getParam('start', null);
$end = $this->_getParam('end', null); $end = $this->_getParam('end', null);
$weekday = $this->_getParam('weekday', null);
if(!is_null($weekday)) {
$weekday = array($weekday);
}
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
if($user->isAdmin())
$editable = true;
else
$editable = false;
$show = new Show(new User($userInfo->id, $userInfo->type)); $this->view->events = Show::getFullCalendarEvents($start, $end, $editable);
$this->view->events = $show->getFullCalendarEvents($start, $end, $weekday);
} }
public function addShowDialogAction() public function addShowDialogAction()
@ -137,69 +134,74 @@ class ScheduleController extends Zend_Controller_Action
{ {
$deltaDay = $this->_getParam('day'); $deltaDay = $this->_getParam('day');
$deltaMin = $this->_getParam('min'); $deltaMin = $this->_getParam('min');
$showId = $this->_getParam('showId'); $showInstanceId = $this->_getParam('showInstanceId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$show = new Show(new User($userInfo->id, $userInfo->type)); if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
$error = $show->moveShow($deltaDay, $deltaMin);
}
$overlap = $show->moveShow($showId, $deltaDay, $deltaMin); if(isset($error))
$this->view->error = $error;
if(isset($overlap))
$this->view->overlap = $overlap;
} }
public function resizeShowAction() public function resizeShowAction()
{ {
$deltaDay = $this->_getParam('day'); $deltaDay = $this->_getParam('day');
$deltaMin = $this->_getParam('min'); $deltaMin = $this->_getParam('min');
$showId = $this->_getParam('showId'); $showInstanceId = $this->_getParam('showInstanceId');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$show = new Show(new User($userInfo->id, $userInfo->type)); if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
$error = $show->resizeShow($deltaDay, $deltaMin);
}
$overlap = $show->resizeShow($showId, $deltaDay, $deltaMin); if(isset($error))
$this->view->error = $error;
if(isset($overlap))
$this->view->overlap = $overlap;
} }
public function deleteShowAction() public function deleteShowAction()
{ {
$showId = $this->_getParam('id'); $showInstanceId = $this->_getParam('id');
$start_timestamp = $this->_getParam('start');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type); $user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId);
$show->deleteShow($start_timestamp); if($user->isAdmin()) {
$show = new ShowInstance($showInstanceId);
$show->deleteShow();
}
} }
public function makeContextMenuAction() public function makeContextMenuAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$start_timestamp = $this->_getParam('start');
$today_timestamp = date("Y-m-d H:i:s"); $today_timestamp = date("Y-m-d H:i:s");
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type); $user = new User($userInfo->id, $userInfo->type);
$params = '/format/json/id/#id#/start/#start#/end/#end#'; $show = new ShowInstance($id);
if(strtotime($today_timestamp) < strtotime($start_timestamp)) { $params = '/format/json/id/#id#';
if($user->isHost($id)) { if(strtotime($today_timestamp) < strtotime($show->getShowStart())) {
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), if($user->isAdmin()) {
'title' => 'Delete');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete');
}
if($user->isHost($show->getShowId()) || $user->isAdmin()) {
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Clear');
'title' => 'Clear');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Schedule');
'title' => 'Schedule');
} }
} }
@ -212,9 +214,7 @@ class ScheduleController extends Zend_Controller_Action
public function scheduleShowAction() public function scheduleShowAction()
{ {
$start_timestamp = $this->sched_sess->showStart; $showInstanceId = $this->sched_sess->showInstanceId;
$end_timestamp = $this->sched_sess->showEnd;
$showId = $this->sched_sess->showId;
$search = $this->_getParam('search', null); $search = $this->_getParam('search', null);
$plId = $this->_getParam('plId'); $plId = $this->_getParam('plId');
@ -223,33 +223,30 @@ class ScheduleController extends Zend_Controller_Action
} }
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type);
$show = new ShowInstance($showInstanceId);
$user = new User($userInfo->id, $userInfo->type); if($user->isHost($show->getShowId())) {
$show = new Show($user, $showId); $show->scheduleShow(array($plId));
}
$show->scheduleShow($start_timestamp, array($plId)); $this->view->showContent = $show->getShowContent();
$this->view->timeFilled = $show->getTimeScheduled();
$this->view->showContent = $show->getShowContent($start_timestamp); $this->view->percentFilled = $show->getPercentScheduledInRange();
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
unset($this->view->showContent); unset($this->view->showContent);
} }
public function clearShowAction() public function clearShowAction()
{ {
$start = $this->_getParam('start'); $showInstanceId = $this->_getParam('id');
$showId = $this->_getParam('id');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new User($userInfo->id, $userInfo->type); $user = new User($userInfo->id, $userInfo->type);
$show = new ShowInstance($showInstanceId);
if($user->isHost($showId)) { if($user->isHost($show->getShowId())) {
$show->clearShow();
$show = new Show($user, $showId);
$show->clearShow($start);
} }
} }
@ -260,14 +257,10 @@ class ScheduleController extends Zend_Controller_Action
public function findPlaylistsAction() public function findPlaylistsAction()
{ {
$show_id = $this->sched_sess->showId;
$start_timestamp = $this->sched_sess->showStart;
$end_timestamp = $this->sched_sess->showEnd;
$post = $this->getRequest()->getPost(); $post = $this->getRequest()->getPost();
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $show = new ShowInstance($this->sched_sess->showInstanceId);
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id); $playlists = $show->searchPlaylistsForShow($post);
$playlists = $show->searchPlaylistsForShow($start_timestamp, $end_timestamp, $post);
//for datatables //for datatables
die(json_encode($playlists)); die(json_encode($playlists));
@ -275,52 +268,51 @@ class ScheduleController extends Zend_Controller_Action
public function removeGroupAction() public function removeGroupAction()
{ {
$showInstanceId = $this->sched_sess->showInstanceId;
$group_id = $this->_getParam('groupId'); $group_id = $this->_getParam('groupId');
$start_timestamp = $this->sched_sess->showStart;
$end_timestamp = $this->sched_sess->showEnd;
$show_id = $this->sched_sess->showId;
$search = $this->_getParam('search', null); $search = $this->_getParam('search', null);
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id); $user = new User($userInfo->id, $userInfo->type);
$show = new ShowInstance($showInstanceId);
$show->removeGroupFromShow($start_timestamp, $group_id);
$this->view->showContent = $show->getShowContent($start_timestamp); if($user->isHost($show->getShowId())) {
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp); $show->removeGroupFromShow($group_id);
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp); }
$this->view->showContent = $show->getShowContent();
$this->view->timeFilled = $show->getTimeScheduled();
$this->view->percentFilled = $show->getPercentScheduledInRange();
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
unset($this->view->showContent); unset($this->view->showContent);
} }
public function scheduleShowDialogAction() public function scheduleShowDialogAction()
{ {
$start_timestamp = $this->_getParam('start'); $showInstanceId = $this->_getParam('id');
$end_timestamp = $this->_getParam('end'); $this->sched_sess->showInstanceId = $showInstanceId;
$showId = $this->_getParam('id');
$show = new ShowInstance($showInstanceId);
$this->sched_sess->showId = $showId; $start_timestamp = $show->getShowStart();
$this->sched_sess->showStart = $start_timestamp; $end_timestamp = $show->getShowEnd();
$this->sched_sess->showEnd = $end_timestamp;
//check to make sure show doesn't overlap.
if(Show::getShows($start_timestamp, $end_timestamp, array($showInstanceId))) {
$this->view->error = "cannot schedule an overlapping show.";
return;
}
$start = explode(" ", $start_timestamp); $start = explode(" ", $start_timestamp);
$end = explode(" ", $end_timestamp); $end = explode(" ", $end_timestamp);
$startTime = explode(":", $start[1]); $startTime = explode(":", $start[1]);
$endTime = explode(":", $end[1]); $endTime = explode(":", $end[1]);
$dateInfo = getDate(strtotime($start_timestamp)); $dateInfo = getDate(strtotime($start_timestamp));
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $this->view->showContent = $show->getShowContent();
$this->view->timeFilled = $show->getTimeScheduled();
$user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId);
$this->view->showContent = $show->getShowContent($start_timestamp);
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
$this->view->showName = $show->getName(); $this->view->showName = $show->getName();
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp); $this->view->showLength = $show->getShowLength();
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp); $this->view->percentFilled = $show->getPercentScheduledInRange();
$this->view->wday = $dateInfo['weekday']; $this->view->wday = $dateInfo['weekday'];
$this->view->month = $dateInfo['month']; $this->view->month = $dateInfo['month'];
@ -330,28 +322,18 @@ class ScheduleController extends Zend_Controller_Action
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml'); $this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
unset($this->view->showContent); unset($this->view->showContent);
} }
public function showContentDialogAction() public function showContentDialogAction()
{ {
$start_timestamp = $this->_getParam('start'); $showInstanceId = $this->_getParam('id');
$end_timestamp = $this->_getParam('end'); $show = new ShowInstance($showInstanceId);
$showId = $this->_getParam('id');
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $this->view->showContent = $show->getShowListContent();
$user = new User($userInfo->id, $userInfo->type);
$show = new Show($user, $showId);
$this->view->showContent = $show->getShowListContent($start_timestamp);
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
unset($this->view->showContent); unset($this->view->showContent);
} }
} }

View File

@ -29,6 +29,16 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
'viewScript' => 'form/add-show-checkbox.phtml' 'viewScript' => 'form/add-show-checkbox.phtml'
)))); ))));
//Add type select
$this->addElement('select', 'add_show_repeat_type', array(
'required' => true,
'label' => 'Repeat Type:',
'multiOptions' => array(
"0" => "weekly",
"1" => "bi-weekly"
),
));
// Add end date element // Add end date element
$this->addElement('text', 'add_show_end_date', array( $this->addElement('text', 'add_show_end_date', array(
'label' => 'Date End:', 'label' => 'Date End:',

View File

@ -2,108 +2,88 @@
class Application_Model_Nowplaying class Application_Model_Nowplaying
{ {
public static function InsertBlankRow($i, $rows){ public static function InsertBlankRow($i, $rows){
$startDate = explode(".", $rows[$i-1][3]); $startDate = explode(".", $rows[$i-1][3]);
$endDate = explode(".", $rows[$i][2]); $endDate = explode(".", $rows[$i][2]);
$epochStartMS = strtotime($startDate[0])*1000;
$epochEndMS = strtotime($endDate[0])*1000;
if (count($startDate) > 1)
$epochStartMS += $startDate[1];
if (count($endDate) > 1)
$epochEndMS += $endDate[1];
$blankRow = array(array("b", "-", "-", "-", Application_Model_DateHelper::ConvertMSToHHMMSSmm($epochEndMS - $epochStartMS), "-", "-", "-", "-" , "-", "", ""));
array_splice($rows, $i, 0, $blankRow);
return $rows;
}
public static function FindGaps($rows){
$n = count($rows);
$blankRowIndices = array();
$arrayIndexOffset = 0;
if ($n < 2)
return $rows;
for ($i=1; $i<$n; $i++){
if ($rows[$i-1][3] != $rows[$i][2])
array_push($blankRowIndices, $i);
}
for ($i=0, $n=count($blankRowIndices); $i<$n; $i++){
$rows = Application_Model_Nowplaying::InsertBlankRow($blankRowIndices[$i]+$arrayIndexOffset, $rows);
$arrayIndexOffset++;
}
return $rows;
}
public static function GetDataGridData($viewType){
$columnHeaders = array(array("sTitle"=>"type", "bVisible"=>false),
array("sTitle"=>"Date"),
array("sTitle"=>"Start"),
array("sTitle"=>"End"),
array("sTitle"=>"Duration"),
array("sTitle"=>"Song"),
array("sTitle"=>"Artist"),
array("sTitle"=>"Album"),
array("sTitle"=>"Playlist"),
array("sTitle"=>"Show"),
array("sTitle"=>"bgcolor", "bVisible"=>false),
array("sTitle"=>"group_id", "bVisible"=>false));
$date = Schedule::GetSchedulerTime();
$timeNow = $date->getDate();
$currentShow = Schedule::GetCurrentShow($timeNow);
$groupIDs = array();
if (count($currentShow) > 0){ $epochStartMS = strtotime($startDate[0])*1000;
$dbRows = Show_DAL::GetShowGroupIDs($currentShow[0]["id"]); $epochEndMS = strtotime($endDate[0])*1000;
foreach ($dbRows as $row){ if (count($startDate) > 1)
array_push($groupIDs, $row["group_id"]); $epochStartMS += $startDate[1];
} if (count($endDate) > 1)
} $epochEndMS += $endDate[1];
if ($viewType == "now"){ $blankRow = array(array("b", "-", "-", "-", Application_Model_DateHelper::ConvertMSToHHMMSSmm($epochEndMS - $epochStartMS), "-", "-", "-", "-" , "-", "", ""));
$previous = Schedule::Get_Scheduled_Item_Data($timeNow, -1, 1, "60 seconds"); array_splice($rows, $i, 0, $blankRow);
$current = Schedule::Get_Scheduled_Item_Data($timeNow, 0); return $rows;
$next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, 10, "24 hours"); }
} else {
public static function FindGaps($rows){
$n = count($rows);
$blankRowIndices = array();
$arrayIndexOffset = 0;
if ($n < 2)
return $rows;
for ($i=1; $i<$n; $i++){
if ($rows[$i-1][3] != $rows[$i][2])
array_push($blankRowIndices, $i);
}
for ($i=0, $n=count($blankRowIndices); $i<$n; $i++){
$rows = Application_Model_Nowplaying::InsertBlankRow($blankRowIndices[$i]+$arrayIndexOffset, $rows);
$arrayIndexOffset++;
}
return $rows;
}
public static function GetDataGridData($viewType){
$date = Schedule::GetSchedulerTime();
$timeNow = $date->getDate();
if ($viewType == "now"){
$previous = Schedule::Get_Scheduled_Item_Data($timeNow, -1, "ALL", $date->getNowDayStartDiff()." seconds"); /* When do "ORDER BY x DESC LIMIT 5" to ensure that we get the last 5 previously scheduled items.
$current = Schedule::Get_Scheduled_Item_Data($timeNow, 0); * However using DESC, puts our scheduled items in reverse order, so we need to reverse it again
$next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, "ALL", $date->getNowDayEndDiff()." seconds"); * with array_reverse.
} */
$previous = array_reverse(Schedule::Get_Scheduled_Item_Data($timeNow, -1, 1, "60 seconds"));
$rows = array(); $current = Schedule::Get_Scheduled_Item_Data($timeNow, 0);
$next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, 10, "24 hours");
foreach ($previous as $item){ } else {
$color = (count($currentShow) > 0) && in_array($item["group_id"], $groupIDs) ? "x" : "";
array_push($rows, array("p", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"], $previous = array_reverse(Schedule::Get_Scheduled_Item_Data($timeNow, -1, "ALL", $date->getNowDayStartDiff()." seconds"));
$item["album_title"], $item["name"], $item["show_name"], $color, $item["group_id"])); $current = Schedule::Get_Scheduled_Item_Data($timeNow, 0);
} $next = Schedule::Get_Scheduled_Item_Data($timeNow, 1, "ALL", $date->getNowDayEndDiff()." seconds");
}
foreach ($current as $item){
array_push($rows, array("c", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"], $rows = array();
$item["album_title"], $item["name"], $item["show_name"], "", $item["group_id"]));
} foreach ($previous as $item){
array_push($rows, array("p", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
foreach ($next as $item){ $item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
$color = (count($currentShow) > 0) && in_array($item["group_id"], $groupIDs) ? "x" : ""; }
array_push($rows, array("n", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], $item["name"], $item["show_name"], $color, $item["group_id"])); foreach ($current as $item){
} array_push($rows, array("c", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
$rows = Application_Model_Nowplaying::FindGaps($rows); }
$data = array("columnHeaders"=>$columnHeaders, "rows"=>$rows);
foreach ($next as $item){
return $data; array_push($rows, array("n", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
} $item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"]));
}
$rows = Application_Model_Nowplaying::FindGaps($rows);
$data = array("rows"=>$rows);
return $data;
}
} }

View File

@ -3,8 +3,11 @@
class Application_Model_Preference class Application_Model_Preference
{ {
public static function SetValue($key, $value, $id){ public static function SetValue($key, $value){
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$auth = Zend_Auth::getInstance();
$id = $auth->getIdentity()->id;
//Check if key already exists //Check if key already exists
$sql = "SELECT COUNT(*) FROM cc_pref" $sql = "SELECT COUNT(*) FROM cc_pref"
@ -57,10 +60,7 @@ class Application_Model_Preference
} }
public static function SetHeadTitle($title, $view){ public static function SetHeadTitle($title, $view){
$auth = Zend_Auth::getInstance(); Application_Model_Preference::SetValue("station_name", $title);
$id = $auth->getIdentity()->id;
Application_Model_Preference::SetValue("station_name", $title, $id);
$defaultNamespace = new Zend_Session_Namespace('title_name'); $defaultNamespace = new Zend_Session_Namespace('title_name');
$defaultNamespace->title = $title; $defaultNamespace->title = $title;
@ -70,5 +70,13 @@ class Application_Model_Preference
$view->headTitle(Application_Model_Preference::GetHeadTitle()); $view->headTitle(Application_Model_Preference::GetHeadTitle());
} }
public static function SetShowsPopulatedUntil($timestamp) {
Application_Model_Preference::SetValue("shows_populated_until", $timestamp);
}
public static function GetShowsPopulatedUntil() {
return Application_Model_Preference::GetValue("shows_populated_until");
}
} }

View File

@ -76,7 +76,7 @@ class ScheduleGroup {
* Return PEAR_Error if the item could not be added. * Return PEAR_Error if the item could not be added.
* Error code 555 is a scheduling conflict. * Error code 555 is a scheduling conflict.
*/ */
public function add($p_datetime, $p_audioFileId = null, $p_playlistId = null, $p_options = null) { public function add($show_instance, $p_datetime, $p_audioFileId = null, $p_playlistId = null, $p_options = null) {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
if (!is_null($p_audioFileId)) { if (!is_null($p_audioFileId)) {
// Schedule a single audio track // Schedule a single audio track
@ -101,8 +101,8 @@ class ScheduleGroup {
$this->groupId = $CC_DBC->GetOne("SELECT nextval('schedule_group_id_seq')"); $this->groupId = $CC_DBC->GetOne("SELECT nextval('schedule_group_id_seq')");
$id = $this->dateToId($p_datetime); $id = $this->dateToId($p_datetime);
$sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"] $sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"]
." (id, playlist_id, starts, ends, clip_length, group_id, file_id)" ." (playlist_id, starts, ends, clip_length, group_id, file_id)"
." VALUES ($id, 0, TIMESTAMP '$p_datetime', " ." VALUES (0, TIMESTAMP '$p_datetime', "
." (TIMESTAMP '$p_datetime' + INTERVAL '$length')," ." (TIMESTAMP '$p_datetime' + INTERVAL '$length'),"
." '$length'," ." '$length',"
." {$this->groupId}, $p_audioFileId)"; ." {$this->groupId}, $p_audioFileId)";
@ -143,9 +143,9 @@ class ScheduleGroup {
$trackLength = $row["cliplength"]; $trackLength = $row["cliplength"];
//var_dump($trackLength); //var_dump($trackLength);
$sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"] $sql = "INSERT INTO ".$CC_CONFIG["scheduleTable"]
." (id, playlist_id, starts, ends, group_id, file_id," ." (instance_id, playlist_id, starts, ends, group_id, file_id,"
." clip_length, cue_in, cue_out, fade_in, fade_out)" ." clip_length, cue_in, cue_out, fade_in, fade_out)"
." VALUES ($id, $p_playlistId, TIMESTAMP '$itemStartTime', " ." VALUES ($show_instance, $p_playlistId, TIMESTAMP '$itemStartTime', "
." (TIMESTAMP '$itemStartTime' + INTERVAL '$trackLength')," ." (TIMESTAMP '$itemStartTime' + INTERVAL '$trackLength'),"
." '{$this->groupId}', '{$row['file_id']}', '$trackLength', '{$row['cuein']}'," ." '{$this->groupId}', '{$row['file_id']}', '$trackLength', '{$row['cuein']}',"
." '{$row['cueout']}', '{$row['fadein']}','{$row['fadeout']}')"; ." '{$row['cueout']}', '{$row['fadein']}','{$row['fadeout']}')";
@ -161,23 +161,23 @@ class ScheduleGroup {
} }
} }
public function addAfter($p_groupId, $p_audioFileId) { public function addAfter($show_instance, $p_groupId, $p_audioFileId) {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
// Get the end time for the given entry // Get the end time for the given entry
$sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"] $sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id=$p_groupId"; ." WHERE group_id=$p_groupId";
$startTime = $CC_DBC->GetOne($sql); $startTime = $CC_DBC->GetOne($sql);
return $this->add($startTime, $p_audioFileId); return $this->add($show_instance, $startTime, $p_audioFileId);
} }
public function addPlaylistAfter($p_groupId, $p_playlistId) { public function addPlaylistAfter($show_instance, $p_groupId, $p_playlistId) {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
// Get the end time for the given entry // Get the end time for the given entry
$sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"] $sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id=$p_groupId"; ." WHERE group_id=$p_groupId";
$startTime = $CC_DBC->GetOne($sql); $startTime = $CC_DBC->GetOne($sql);
return $this->add($startTime, null, $p_playlistId); return $this->add($show_instance, $startTime, null, $p_playlistId);
} }
public function update() { public function update() {
@ -281,14 +281,6 @@ class Schedule {
public static function getTimeUnScheduledInRange($s_datetime, $e_datetime) { public static function getTimeUnScheduledInRange($s_datetime, $e_datetime) {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$sql = "SELECT timestamp '{$s_datetime}' > timestamp '{$e_datetime}'";
$isNextDay = $CC_DBC->GetOne($sql);
if($isNextDay === 't') {
$sql = "SELECT date '{$e_datetime}' + interval '1 day'";
$e_datetime = $CC_DBC->GetOne($sql);
}
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
WHERE (starts >= '{$s_datetime}') WHERE (starts >= '{$s_datetime}')
AND (ends <= '{$e_datetime}')"; AND (ends <= '{$e_datetime}')";
@ -310,20 +302,12 @@ class Schedule {
public static function getTimeScheduledInRange($s_datetime, $e_datetime) { public static function getTimeScheduledInRange($s_datetime, $e_datetime) {
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$sql = "SELECT timestamp '{$s_datetime}' > timestamp '{$e_datetime}'";
$isNextDay = $CC_DBC->GetOne($sql);
if($isNextDay === 't') {
$sql = "SELECT date '{$e_datetime}' + interval '1 day'";
$e_datetime = $CC_DBC->GetOne($sql);
}
$sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]." $sql = "SELECT SUM(clip_length) FROM ".$CC_CONFIG["scheduleTable"]."
WHERE (starts >= '{$s_datetime}') WHERE (starts >= '{$s_datetime}')
AND (ends <= '{$e_datetime}')"; AND (ends <= '{$e_datetime}')";
$res = $CC_DBC->GetOne($sql); $res = $CC_DBC->GetOne($sql);
if(is_null($res)) if(is_null($res))
return 0; return 0;
@ -331,9 +315,9 @@ class Schedule {
} }
public static function getPercentScheduledInRange($s_datetime, $e_datetime) { public static function getPercentScheduledInRange($s_datetime, $e_datetime) {
$time = Schedule::getTimeScheduledInRange($s_datetime, $e_datetime); $time = Schedule::getTimeScheduledInRange($s_datetime, $e_datetime);
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
$sql = "SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '{$s_datetime}')"; $sql = "SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '{$s_datetime}')";
@ -349,7 +333,7 @@ class Schedule {
$i_epoch = $r->fetchColumn(0); $i_epoch = $r->fetchColumn(0);
$percent = ceil(($i_epoch / ($e_epoch - $s_epoch)) * 100); $percent = ceil(($i_epoch / ($e_epoch - $s_epoch)) * 100);
return $percent; return $percent;
} }
@ -460,17 +444,18 @@ class Schedule {
public static function GetPlayOrderRange($prev = 1, $next = 1) { public static function GetPlayOrderRange($prev = 1, $next = 1) {
if (!is_int($prev) || !is_int($next)){ if (!is_int($prev) || !is_int($next)){
//must enter integers to specify ranges //must enter integers to specify ranges
return "{}"; return array();
} }
$date = Schedule::GetSchedulerTime(); $date = Schedule::GetSchedulerTime();
$timeNow = $date->getDate(); $timeNow = $date->getDate();
return array("schedulerTime"=>gmdate("Y-m-d H:i:s"), return array("env"=>APPLICATION_ENV,
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
"previous"=>Schedule::Get_Scheduled_Item_Data($timeNow, -1, $prev, "24 hours"), "previous"=>Schedule::Get_Scheduled_Item_Data($timeNow, -1, $prev, "24 hours"),
"current"=>Schedule::Get_Scheduled_Item_Data($timeNow, 0), "current"=>Schedule::Get_Scheduled_Item_Data($timeNow, 0),
"next"=>Schedule::Get_Scheduled_Item_Data($timeNow, 1, $next, "48 hours"), "next"=>Schedule::Get_Scheduled_Item_Data($timeNow, 1, $next, "48 hours"),
"currentShow"=>Schedule::GetCurrentShow($timeNow), "currentShow"=>Show_DAL::GetCurrentShow($timeNow),
"nextShow"=>Schedule::GetNextShow($timeNow), "nextShow"=>Show_DAL::GetNextShow($timeNow),
"timezone"=> date("T"), "timezone"=> date("T"),
"timezoneOffset"=> date("Z")); "timezoneOffset"=> date("Z"));
} }
@ -499,17 +484,17 @@ class Schedule {
*/ */
public static function Get_Scheduled_Item_Data($timeNow, $timePeriod=0, $count = 0, $interval="0 hours"){ public static function Get_Scheduled_Item_Data($timeNow, $timePeriod=0, $count = 0, $interval="0 hours"){
global $CC_CONFIG, $CC_DBC; global $CC_CONFIG, $CC_DBC;
$sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name" $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, (si.starts <= TIMESTAMP '$timeNow' AND si.ends > TIMESTAMP '$timeNow') as current_show"
." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showSchedule] ss, $CC_CONFIG[showTable] show" ." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show"
." WHERE st.playlist_id = pt.id" ." WHERE st.playlist_id = pt.id"
." AND st.file_id = ft.id" ." AND st.file_id = ft.id"
." AND st.group_id = ss.group_id" ." AND st.instance_id = si.id"
." AND ss.show_id = show.id"; ." AND si.show_id = show.id";
if ($timePeriod < 0){ if ($timePeriod < 0){
$sql .= " AND st.ends < TIMESTAMP '$timeNow'" $sql .= " AND st.ends < TIMESTAMP '$timeNow'"
." AND st.ends > (TIMESTAMP '$timeNow' - INTERVAL '$interval')" ." AND st.ends > (TIMESTAMP '$timeNow' - INTERVAL '$interval')"
." ORDER BY st.starts" ." ORDER BY st.starts DESC"
." LIMIT $count"; ." LIMIT $count";
} else if ($timePeriod == 0){ } else if ($timePeriod == 0){
$sql .= " AND st.starts < TIMESTAMP '$timeNow'" $sql .= " AND st.starts < TIMESTAMP '$timeNow'"
@ -524,87 +509,7 @@ class Schedule {
$rows = $CC_DBC->GetAll($sql); $rows = $CC_DBC->GetAll($sql);
return $rows; return $rows;
} }
/*
public static function GetPreviousItems($timeNow, $prevCount = 1, $prevInterval="24 hours"){
global $CC_CONFIG, $CC_DBC;
$sql = "SELECT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id"
." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt"
." WHERE st.ends < TIMESTAMP '$timeNow'"
." AND st.ends > (TIMESTAMP '$timeNow' - INTERVAL '$prevInterval')"
." AND st.playlist_id = pt.id"
." AND st.file_id = ft.id"
." ORDER BY st.starts DESC"
." LIMIT $prevCount";
$rows = $CC_DBC->GetAll($sql);
return $rows;
}
public static function GetCurrentlyPlaying($timeNow){
global $CC_CONFIG, $CC_DBC;
$sql = "SELECT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id"
." FROM $CC_CONFIG[scheduleTable] st,"
."$CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt"
." WHERE st.starts < TIMESTAMP '$timeNow'"
." AND st.ends > TIMESTAMP '$timeNow'"
." AND st.playlist_id = pt.id"
." AND st.file_id = ft.id";
$rows = $CC_DBC->GetAll($sql);
return $rows;
}
public static function GetNextItems($timeNow, $nextCount = 1) {
global $CC_CONFIG, $CC_DBC;
$sql = "SELECT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id"
." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt"
." WHERE st.starts > TIMESTAMP '$timeNow'"
." AND st.ends < (TIMESTAMP '$timeNow' + INTERVAL '7 days')"
." AND st.playlist_id = pt.id"
." AND st.file_id = ft.id"
." ORDER BY st.starts"
." LIMIT $nextCount";
$rows = $CC_DBC->GetAll($sql);
return $rows;
}
*/
public static function GetCurrentShow($timeNow) {
global $CC_CONFIG, $CC_DBC;
$timestamp = explode(" ", $timeNow);
$date = $timestamp[0];
$time = $timestamp[1];
$sql = "SELECT current_date + sd.start_time as start_timestamp, current_date + sd.end_time as end_timestamp, s.name, s.id"
." FROM $CC_CONFIG[showDays] sd, $CC_CONFIG[showTable] s"
." WHERE sd.show_id = s.id"
." AND sd.first_show <= DATE '$date'"
." AND sd.start_time <= TIME '$time'"
." AND sd.last_show > DATE '$date'"
." AND sd.end_time > TIME '$time'";
$rows = $CC_DBC->GetAll($sql);
return $rows;
}
public static function GetNextShow($timeNow) {
global $CC_CONFIG, $CC_DBC;
$datetime = explode(" ", $timeNow);
$sql = "SELECT *, (current_date + start_time) as start_timestamp, (current_date + end_time) as end_timestamp FROM "
." $CC_CONFIG[showDays] sd, $CC_CONFIG[showTable] s"
." WHERE sd.show_id = s.id"
." AND ((sd.last_show + sd.end_time) > TIMESTAMP '$timeNow' OR sd.last_show = NULL)"
." AND TIME '$datetime[1]' < sd.start_time "
." AND sd.day = EXTRACT(DOW FROM TIMESTAMP '$timeNow')"
." ORDER BY sd.start_time"
." LIMIT 1";
$rows = $CC_DBC->GetAll($sql);
return $rows;
}
/** /**
* Convert a time string in the format "YYYY-MM-DD HH:mm:SS" * Convert a time string in the format "YYYY-MM-DD HH:mm:SS"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<?php
/**
* 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
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcShowInstances extends BaseCcShowInstances {
} // CcShowInstances

View File

@ -0,0 +1,18 @@
<?php
/**
* Skeleton subclass for performing query and update operations on 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
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcShowInstancesPeer extends BaseCcShowInstancesPeer {
} // CcShowInstancesPeer

View File

@ -0,0 +1,18 @@
<?php
/**
* Skeleton subclass for performing query and update operations on 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
* long as it does not already exist in the output directory.
*
* @package propel.generator.airtime
*/
class CcShowInstancesQuery extends BaseCcShowInstancesQuery {
} // CcShowInstancesQuery

View File

@ -35,9 +35,10 @@ class CcScheduleTableMap extends TableMap {
$this->setPhpName('CcSchedule'); $this->setPhpName('CcSchedule');
$this->setClassname('CcSchedule'); $this->setClassname('CcSchedule');
$this->setPackage('airtime'); $this->setPackage('airtime');
$this->setUseIdGenerator(false); $this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_schedule_id_seq');
// columns // columns
$this->addPrimaryKey('ID', 'DbId', 'BIGINT', true, null, null); $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', true, null, null); $this->addColumn('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', true, null, null);
$this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null); $this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null);
$this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null); $this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null);
@ -50,6 +51,7 @@ class CcScheduleTableMap extends TableMap {
$this->addColumn('CUE_OUT', 'DbCueOut', 'TIME', false, null, '00:00:00'); $this->addColumn('CUE_OUT', 'DbCueOut', 'TIME', false, null, '00:00:00');
$this->addColumn('SCHEDULE_GROUP_PLAYED', 'DbScheduleGroupPlayed', 'BOOLEAN', false, null, false); $this->addColumn('SCHEDULE_GROUP_PLAYED', 'DbScheduleGroupPlayed', 'BOOLEAN', false, null, false);
$this->addColumn('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false); $this->addColumn('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false);
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
// validators // validators
} // initialize() } // initialize()
@ -58,6 +60,7 @@ class CcScheduleTableMap extends TableMap {
*/ */
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null);
} // buildRelations() } // buildRelations()
} // CcScheduleTableMap } // CcScheduleTableMap

View File

@ -42,8 +42,10 @@ class CcShowDaysTableMap extends TableMap {
$this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null); $this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null);
$this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null); $this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null);
$this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null); $this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null);
$this->addColumn('END_TIME', 'DbEndTime', 'TIME', true, null, null); $this->addColumn('DURATION', 'DbDuration', 'TIME', true, null, null);
$this->addColumn('DAY', 'DbDay', 'TINYINT', true, null, null); $this->addColumn('DAY', 'DbDay', 'TINYINT', true, null, null);
$this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null);
$this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, null, null);
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null); $this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
// validators // validators
} // initialize() } // initialize()

View File

@ -0,0 +1,57 @@
<?php
/**
* This class defines the structure of the 'cc_show_instances' 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 CcShowInstancesTableMap extends TableMap {
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'airtime.map.CcShowInstancesTableMap';
/**
* 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_instances');
$this->setPhpName('CcShowInstances');
$this->setClassname('CcShowInstances');
$this->setPackage('airtime');
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('cc_show_instances_id_seq');
// columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null);
$this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null);
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', 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('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null);
} // buildRelations()
} // CcShowInstancesTableMap

View File

@ -39,8 +39,7 @@ class CcShowScheduleTableMap extends TableMap {
$this->setPrimaryKeyMethodInfo('cc_show_schedule_id_seq'); $this->setPrimaryKeyMethodInfo('cc_show_schedule_id_seq');
// columns // columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $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', true, null, null);
$this->addColumn('SHOW_DAY', 'DbShowDay', 'DATE', true, null, null);
$this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null);
$this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', true, null, null); $this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', true, null, null);
// validators // validators
@ -51,7 +50,7 @@ class CcShowScheduleTableMap extends TableMap {
*/ */
public function buildRelations() 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);
} // buildRelations() } // buildRelations()
} // CcShowScheduleTableMap } // CcShowScheduleTableMap

View File

@ -40,7 +40,6 @@ class CcShowTableMap extends TableMap {
// columns // columns
$this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, '');
$this->addColumn('REPEATS', 'DbRepeats', 'TINYINT', true, null, null);
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
$this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null); $this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null);
$this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null); $this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null);
@ -52,9 +51,9 @@ class CcShowTableMap extends TableMap {
*/ */
public function buildRelations() public function buildRelations()
{ {
$this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
$this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); $this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
$this->addRelation('CcShowSchedule', 'CcShowSchedule', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null);
} // buildRelations() } // buildRelations()
} // CcShowTableMap } // CcShowTableMap

View File

@ -26,7 +26,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
/** /**
* The value for the id field. * The value for the id field.
* @var string * @var int
*/ */
protected $id; protected $id;
@ -109,6 +109,17 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
*/ */
protected $media_item_played; protected $media_item_played;
/**
* The value for the instance_id field.
* @var int
*/
protected $instance_id;
/**
* @var CcShowInstances
*/
protected $aCcShowInstances;
/** /**
* Flag to prevent endless save loop, if this object is referenced * Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction. * by another object which falls in this transaction.
@ -153,7 +164,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
/** /**
* Get the [id] column value. * Get the [id] column value.
* *
* @return string * @return int
*/ */
public function getDbId() public function getDbId()
{ {
@ -441,16 +452,26 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return $this->media_item_played; return $this->media_item_played;
} }
/**
* Get the [instance_id] column value.
*
* @return int
*/
public function getDbInstanceId()
{
return $this->instance_id;
}
/** /**
* Set the value of [id] column. * Set the value of [id] column.
* *
* @param string $v new value * @param int $v new value
* @return CcSchedule The current object (for fluent API support) * @return CcSchedule The current object (for fluent API support)
*/ */
public function setDbId($v) public function setDbId($v)
{ {
if ($v !== null) { if ($v !== null) {
$v = (string) $v; $v = (int) $v;
} }
if ($this->id !== $v) { if ($this->id !== $v) {
@ -909,6 +930,30 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return $this; return $this;
} // setDbMediaItemPlayed() } // setDbMediaItemPlayed()
/**
* Set the value of [instance_id] column.
*
* @param int $v new value
* @return CcSchedule The current object (for fluent API support)
*/
public function setDbInstanceId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->instance_id !== $v) {
$this->instance_id = $v;
$this->modifiedColumns[] = CcSchedulePeer::INSTANCE_ID;
}
if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) {
$this->aCcShowInstances = null;
}
return $this;
} // setDbInstanceId()
/** /**
* Indicates whether the columns in this object are only set to default values. * Indicates whether the columns in this object are only set to default values.
* *
@ -969,7 +1014,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
{ {
try { try {
$this->id = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; $this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->starts = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->starts = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->ends = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->ends = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
@ -982,6 +1027,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->cue_out = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; $this->cue_out = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null;
$this->schedule_group_played = ($row[$startcol + 11] !== null) ? (boolean) $row[$startcol + 11] : null; $this->schedule_group_played = ($row[$startcol + 11] !== null) ? (boolean) $row[$startcol + 11] : null;
$this->media_item_played = ($row[$startcol + 12] !== null) ? (boolean) $row[$startcol + 12] : null; $this->media_item_played = ($row[$startcol + 12] !== null) ? (boolean) $row[$startcol + 12] : null;
$this->instance_id = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -990,7 +1036,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 13; // 13 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 14; // 14 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcSchedule object", $e); throw new PropelException("Error populating CcSchedule object", $e);
@ -1013,6 +1059,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
public function ensureConsistency() public function ensureConsistency()
{ {
if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) {
$this->aCcShowInstances = null;
}
} // ensureConsistency } // ensureConsistency
/** /**
@ -1052,6 +1101,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects? if ($deep) { // also de-associate any related objects?
$this->aCcShowInstances = null;
} // if (deep) } // if (deep)
} }
@ -1162,16 +1212,36 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if (!$this->alreadyInSave) { if (!$this->alreadyInSave) {
$this->alreadyInSave = true; $this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcShowInstances !== null) {
if ($this->aCcShowInstances->isModified() || $this->aCcShowInstances->isNew()) {
$affectedRows += $this->aCcShowInstances->save($con);
}
$this->setCcShowInstances($this->aCcShowInstances);
}
if ($this->isNew() ) {
$this->modifiedColumns[] = CcSchedulePeer::ID;
}
// If this object has been modified, then save it to the database. // If this object has been modified, then save it to the database.
if ($this->isModified()) { if ($this->isModified()) {
if ($this->isNew()) { if ($this->isNew()) {
$criteria = $this->buildCriteria(); $criteria = $this->buildCriteria();
if ($criteria->keyContainsValue(CcSchedulePeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSchedulePeer::ID.')');
}
$pk = BasePeer::doInsert($criteria, $con); $pk = BasePeer::doInsert($criteria, $con);
$affectedRows = 1; $affectedRows += 1;
$this->setDbId($pk); //[IMV] update autoincrement primary key
$this->setNew(false); $this->setNew(false);
} else { } else {
$affectedRows = CcSchedulePeer::doUpdate($this, $con); $affectedRows += CcSchedulePeer::doUpdate($this, $con);
} }
$this->resetModified(); // [HL] After being saved an object is no longer 'modified' $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
@ -1243,6 +1313,18 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$failureMap = array(); $failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to this object by their coresponding set
// method. This object relates to these object(s) by a
// foreign key reference.
if ($this->aCcShowInstances !== null) {
if (!$this->aCcShowInstances->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcShowInstances->getValidationFailures());
}
}
if (($retval = CcSchedulePeer::doValidate($this, $columns)) !== true) { if (($retval = CcSchedulePeer::doValidate($this, $columns)) !== true) {
$failureMap = array_merge($failureMap, $retval); $failureMap = array_merge($failureMap, $retval);
} }
@ -1320,6 +1402,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
case 12: case 12:
return $this->getDbMediaItemPlayed(); return $this->getDbMediaItemPlayed();
break; break;
case 13:
return $this->getDbInstanceId();
break;
default: default:
return null; return null;
break; break;
@ -1336,10 +1421,11 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME. * Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
* *
* @return array an associative array containing the field names (as keys) and field values * @return array an associative array containing the field names (as keys) and field values
*/ */
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false)
{ {
$keys = CcSchedulePeer::getFieldNames($keyType); $keys = CcSchedulePeer::getFieldNames($keyType);
$result = array( $result = array(
@ -1356,7 +1442,13 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$keys[10] => $this->getDbCueOut(), $keys[10] => $this->getDbCueOut(),
$keys[11] => $this->getDbScheduleGroupPlayed(), $keys[11] => $this->getDbScheduleGroupPlayed(),
$keys[12] => $this->getDbMediaItemPlayed(), $keys[12] => $this->getDbMediaItemPlayed(),
$keys[13] => $this->getDbInstanceId(),
); );
if ($includeForeignObjects) {
if (null !== $this->aCcShowInstances) {
$result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true);
}
}
return $result; return $result;
} }
@ -1426,6 +1518,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
case 12: case 12:
$this->setDbMediaItemPlayed($value); $this->setDbMediaItemPlayed($value);
break; break;
case 13:
$this->setDbInstanceId($value);
break;
} // switch() } // switch()
} }
@ -1463,6 +1558,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if (array_key_exists($keys[10], $arr)) $this->setDbCueOut($arr[$keys[10]]); if (array_key_exists($keys[10], $arr)) $this->setDbCueOut($arr[$keys[10]]);
if (array_key_exists($keys[11], $arr)) $this->setDbScheduleGroupPlayed($arr[$keys[11]]); if (array_key_exists($keys[11], $arr)) $this->setDbScheduleGroupPlayed($arr[$keys[11]]);
if (array_key_exists($keys[12], $arr)) $this->setDbMediaItemPlayed($arr[$keys[12]]); if (array_key_exists($keys[12], $arr)) $this->setDbMediaItemPlayed($arr[$keys[12]]);
if (array_key_exists($keys[13], $arr)) $this->setDbInstanceId($arr[$keys[13]]);
} }
/** /**
@ -1487,6 +1583,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if ($this->isColumnModified(CcSchedulePeer::CUE_OUT)) $criteria->add(CcSchedulePeer::CUE_OUT, $this->cue_out); if ($this->isColumnModified(CcSchedulePeer::CUE_OUT)) $criteria->add(CcSchedulePeer::CUE_OUT, $this->cue_out);
if ($this->isColumnModified(CcSchedulePeer::SCHEDULE_GROUP_PLAYED)) $criteria->add(CcSchedulePeer::SCHEDULE_GROUP_PLAYED, $this->schedule_group_played); if ($this->isColumnModified(CcSchedulePeer::SCHEDULE_GROUP_PLAYED)) $criteria->add(CcSchedulePeer::SCHEDULE_GROUP_PLAYED, $this->schedule_group_played);
if ($this->isColumnModified(CcSchedulePeer::MEDIA_ITEM_PLAYED)) $criteria->add(CcSchedulePeer::MEDIA_ITEM_PLAYED, $this->media_item_played); if ($this->isColumnModified(CcSchedulePeer::MEDIA_ITEM_PLAYED)) $criteria->add(CcSchedulePeer::MEDIA_ITEM_PLAYED, $this->media_item_played);
if ($this->isColumnModified(CcSchedulePeer::INSTANCE_ID)) $criteria->add(CcSchedulePeer::INSTANCE_ID, $this->instance_id);
return $criteria; return $criteria;
} }
@ -1509,7 +1606,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
/** /**
* Returns the primary key for this object (row). * Returns the primary key for this object (row).
* @return string * @return int
*/ */
public function getPrimaryKey() public function getPrimaryKey()
{ {
@ -1519,7 +1616,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
/** /**
* Generic method to set the primary key (id column). * Generic method to set the primary key (id column).
* *
* @param string $key Primary key. * @param int $key Primary key.
* @return void * @return void
*/ */
public function setPrimaryKey($key) public function setPrimaryKey($key)
@ -1548,7 +1645,6 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
*/ */
public function copyInto($copyObj, $deepCopy = false) public function copyInto($copyObj, $deepCopy = false)
{ {
$copyObj->setDbId($this->id);
$copyObj->setDbPlaylistId($this->playlist_id); $copyObj->setDbPlaylistId($this->playlist_id);
$copyObj->setDbStarts($this->starts); $copyObj->setDbStarts($this->starts);
$copyObj->setDbEnds($this->ends); $copyObj->setDbEnds($this->ends);
@ -1561,8 +1657,10 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$copyObj->setDbCueOut($this->cue_out); $copyObj->setDbCueOut($this->cue_out);
$copyObj->setDbScheduleGroupPlayed($this->schedule_group_played); $copyObj->setDbScheduleGroupPlayed($this->schedule_group_played);
$copyObj->setDbMediaItemPlayed($this->media_item_played); $copyObj->setDbMediaItemPlayed($this->media_item_played);
$copyObj->setDbInstanceId($this->instance_id);
$copyObj->setNew(true); $copyObj->setNew(true);
$copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value
} }
/** /**
@ -1603,6 +1701,55 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return self::$peer; return self::$peer;
} }
/**
* Declares an association between this object and a CcShowInstances object.
*
* @param CcShowInstances $v
* @return CcSchedule The current object (for fluent API support)
* @throws PropelException
*/
public function setCcShowInstances(CcShowInstances $v = null)
{
if ($v === null) {
$this->setDbInstanceId(NULL);
} else {
$this->setDbInstanceId($v->getDbId());
}
$this->aCcShowInstances = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcShowInstances object, it will not be re-added.
if ($v !== null) {
$v->addCcSchedule($this);
}
return $this;
}
/**
* Get the associated CcShowInstances object
*
* @param PropelPDO Optional Connection object.
* @return CcShowInstances The associated CcShowInstances object.
* @throws PropelException
*/
public function getCcShowInstances(PropelPDO $con = null)
{
if ($this->aCcShowInstances === null && ($this->instance_id !== null)) {
$this->aCcShowInstances = CcShowInstancesQuery::create()->findPk($this->instance_id, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aCcShowInstances->addCcSchedules($this);
*/
}
return $this->aCcShowInstances;
}
/** /**
* Clears the current object and sets all attributes to their default values * Clears the current object and sets all attributes to their default values
*/ */
@ -1621,6 +1768,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->cue_out = null; $this->cue_out = null;
$this->schedule_group_played = null; $this->schedule_group_played = null;
$this->media_item_played = null; $this->media_item_played = null;
$this->instance_id = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->clearAllReferences(); $this->clearAllReferences();
@ -1644,6 +1792,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
if ($deep) { if ($deep) {
} // if ($deep) } // if ($deep)
$this->aCcShowInstances = null;
} }
/** /**

View File

@ -26,7 +26,7 @@ abstract class BaseCcSchedulePeer {
const TM_CLASS = 'CcScheduleTableMap'; const TM_CLASS = 'CcScheduleTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 13; const NUM_COLUMNS = 14;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -70,6 +70,9 @@ abstract class BaseCcSchedulePeer {
/** the column name for the MEDIA_ITEM_PLAYED field */ /** the column name for the MEDIA_ITEM_PLAYED field */
const MEDIA_ITEM_PLAYED = 'cc_schedule.MEDIA_ITEM_PLAYED'; const MEDIA_ITEM_PLAYED = 'cc_schedule.MEDIA_ITEM_PLAYED';
/** the column name for the INSTANCE_ID field */
const INSTANCE_ID = 'cc_schedule.INSTANCE_ID';
/** /**
* An identiy map to hold any loaded instances of CcSchedule objects. * 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 * This must be public so that other peer classes can access this when hydrating from JOIN
@ -86,12 +89,12 @@ abstract class BaseCcSchedulePeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbStarts', 'DbEnds', 'DbGroupId', 'DbFileId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbScheduleGroupPlayed', 'DbMediaItemPlayed', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbPlaylistId', 'DbStarts', 'DbEnds', 'DbGroupId', 'DbFileId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbScheduleGroupPlayed', 'DbMediaItemPlayed', 'DbInstanceId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbStarts', 'dbEnds', 'dbGroupId', 'dbFileId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbScheduleGroupPlayed', 'dbMediaItemPlayed', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbStarts', 'dbEnds', 'dbGroupId', 'dbFileId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbScheduleGroupPlayed', 'dbMediaItemPlayed', 'dbInstanceId', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::STARTS, self::ENDS, self::GROUP_ID, self::FILE_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::SCHEDULE_GROUP_PLAYED, self::MEDIA_ITEM_PLAYED, ), BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::STARTS, self::ENDS, self::GROUP_ID, self::FILE_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::SCHEDULE_GROUP_PLAYED, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'STARTS', 'ENDS', 'GROUP_ID', 'FILE_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'SCHEDULE_GROUP_PLAYED', 'MEDIA_ITEM_PLAYED', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'STARTS', 'ENDS', 'GROUP_ID', 'FILE_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'SCHEDULE_GROUP_PLAYED', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'starts', 'ends', 'group_id', 'file_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'schedule_group_played', 'media_item_played', ), BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'starts', 'ends', 'group_id', 'file_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'schedule_group_played', 'media_item_played', 'instance_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
); );
/** /**
@ -101,12 +104,12 @@ abstract class BaseCcSchedulePeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbStarts' => 2, 'DbEnds' => 3, 'DbGroupId' => 4, 'DbFileId' => 5, 'DbClipLength' => 6, 'DbFadeIn' => 7, 'DbFadeOut' => 8, 'DbCueIn' => 9, 'DbCueOut' => 10, 'DbScheduleGroupPlayed' => 11, 'DbMediaItemPlayed' => 12, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbPlaylistId' => 1, 'DbStarts' => 2, 'DbEnds' => 3, 'DbGroupId' => 4, 'DbFileId' => 5, 'DbClipLength' => 6, 'DbFadeIn' => 7, 'DbFadeOut' => 8, 'DbCueIn' => 9, 'DbCueOut' => 10, 'DbScheduleGroupPlayed' => 11, 'DbMediaItemPlayed' => 12, 'DbInstanceId' => 13, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbStarts' => 2, 'dbEnds' => 3, 'dbGroupId' => 4, 'dbFileId' => 5, 'dbClipLength' => 6, 'dbFadeIn' => 7, 'dbFadeOut' => 8, 'dbCueIn' => 9, 'dbCueOut' => 10, 'dbScheduleGroupPlayed' => 11, 'dbMediaItemPlayed' => 12, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbStarts' => 2, 'dbEnds' => 3, 'dbGroupId' => 4, 'dbFileId' => 5, 'dbClipLength' => 6, 'dbFadeIn' => 7, 'dbFadeOut' => 8, 'dbCueIn' => 9, 'dbCueOut' => 10, 'dbScheduleGroupPlayed' => 11, 'dbMediaItemPlayed' => 12, 'dbInstanceId' => 13, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::STARTS => 2, self::ENDS => 3, self::GROUP_ID => 4, self::FILE_ID => 5, self::CLIP_LENGTH => 6, self::FADE_IN => 7, self::FADE_OUT => 8, self::CUE_IN => 9, self::CUE_OUT => 10, self::SCHEDULE_GROUP_PLAYED => 11, self::MEDIA_ITEM_PLAYED => 12, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::STARTS => 2, self::ENDS => 3, self::GROUP_ID => 4, self::FILE_ID => 5, self::CLIP_LENGTH => 6, self::FADE_IN => 7, self::FADE_OUT => 8, self::CUE_IN => 9, self::CUE_OUT => 10, self::SCHEDULE_GROUP_PLAYED => 11, self::MEDIA_ITEM_PLAYED => 12, self::INSTANCE_ID => 13, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'STARTS' => 2, 'ENDS' => 3, 'GROUP_ID' => 4, 'FILE_ID' => 5, 'CLIP_LENGTH' => 6, 'FADE_IN' => 7, 'FADE_OUT' => 8, 'CUE_IN' => 9, 'CUE_OUT' => 10, 'SCHEDULE_GROUP_PLAYED' => 11, 'MEDIA_ITEM_PLAYED' => 12, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'STARTS' => 2, 'ENDS' => 3, 'GROUP_ID' => 4, 'FILE_ID' => 5, 'CLIP_LENGTH' => 6, 'FADE_IN' => 7, 'FADE_OUT' => 8, 'CUE_IN' => 9, 'CUE_OUT' => 10, 'SCHEDULE_GROUP_PLAYED' => 11, 'MEDIA_ITEM_PLAYED' => 12, 'INSTANCE_ID' => 13, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'starts' => 2, 'ends' => 3, 'group_id' => 4, 'file_id' => 5, 'clip_length' => 6, 'fade_in' => 7, 'fade_out' => 8, 'cue_in' => 9, 'cue_out' => 10, 'schedule_group_played' => 11, 'media_item_played' => 12, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'starts' => 2, 'ends' => 3, 'group_id' => 4, 'file_id' => 5, 'clip_length' => 6, 'fade_in' => 7, 'fade_out' => 8, 'cue_in' => 9, 'cue_out' => 10, 'schedule_group_played' => 11, 'media_item_played' => 12, 'instance_id' => 13, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, )
); );
/** /**
@ -191,6 +194,7 @@ abstract class BaseCcSchedulePeer {
$criteria->addSelectColumn(CcSchedulePeer::CUE_OUT); $criteria->addSelectColumn(CcSchedulePeer::CUE_OUT);
$criteria->addSelectColumn(CcSchedulePeer::SCHEDULE_GROUP_PLAYED); $criteria->addSelectColumn(CcSchedulePeer::SCHEDULE_GROUP_PLAYED);
$criteria->addSelectColumn(CcSchedulePeer::MEDIA_ITEM_PLAYED); $criteria->addSelectColumn(CcSchedulePeer::MEDIA_ITEM_PLAYED);
$criteria->addSelectColumn(CcSchedulePeer::INSTANCE_ID);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.PLAYLIST_ID'); $criteria->addSelectColumn($alias . '.PLAYLIST_ID');
@ -205,6 +209,7 @@ abstract class BaseCcSchedulePeer {
$criteria->addSelectColumn($alias . '.CUE_OUT'); $criteria->addSelectColumn($alias . '.CUE_OUT');
$criteria->addSelectColumn($alias . '.SCHEDULE_GROUP_PLAYED'); $criteria->addSelectColumn($alias . '.SCHEDULE_GROUP_PLAYED');
$criteria->addSelectColumn($alias . '.MEDIA_ITEM_PLAYED'); $criteria->addSelectColumn($alias . '.MEDIA_ITEM_PLAYED');
$criteria->addSelectColumn($alias . '.INSTANCE_ID');
} }
} }
@ -430,7 +435,7 @@ abstract class BaseCcSchedulePeer {
*/ */
public static function getPrimaryKeyFromRow($row, $startcol = 0) public static function getPrimaryKeyFromRow($row, $startcol = 0)
{ {
return (string) $row[$startcol]; return (int) $row[$startcol];
} }
/** /**
@ -489,6 +494,240 @@ abstract class BaseCcSchedulePeer {
} }
return array($obj, $col); return array($obj, $col);
} }
/**
* Returns the number of rows matching criteria, joining the related CcShowInstances table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcShowInstances(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSchedulePeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcSchedule objects pre-filled with their CcShowInstances objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcSchedule objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcSchedulePeer::addSelectColumns($criteria);
$startcol = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
CcShowInstancesPeer::addSelectColumns($criteria);
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcSchedulePeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcSchedulePeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcSchedulePeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcShowInstancesPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcShowInstancesPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcShowInstancesPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcSchedule) to $obj2 (CcShowInstances)
$obj2->addCcSchedule($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcSchedulePeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcSchedule objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcSchedule objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcSchedulePeer::addSelectColumns($criteria);
$startcol2 = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
CcShowInstancesPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcSchedulePeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcSchedulePeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcSchedulePeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcShowInstances rows
$key2 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcShowInstancesPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcShowInstancesPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcShowInstancesPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (CcSchedule) to the collection in $obj2 (CcShowInstances)
$obj2->addCcSchedule($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/** /**
* Returns the TableMap related to this peer. * Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need. * This method is not needed for general use but a specific application could have a need.
@ -550,6 +789,10 @@ abstract class BaseCcSchedulePeer {
$criteria = $values->buildCriteria(); // build Criteria from CcSchedule object $criteria = $values->buildCriteria(); // build Criteria from CcSchedule object
} }
if ($criteria->containsKey(CcSchedulePeer::ID) && $criteria->keyContainsValue(CcSchedulePeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSchedulePeer::ID.')');
}
// Set the correct dbName // Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME); $criteria->setDbName(self::DATABASE_NAME);
@ -734,7 +977,7 @@ abstract class BaseCcSchedulePeer {
/** /**
* Retrieve a single object by pkey. * Retrieve a single object by pkey.
* *
* @param string $pk the primary key. * @param int $pk the primary key.
* @param PropelPDO $con the connection to use * @param PropelPDO $con the connection to use
* @return CcSchedule * @return CcSchedule
*/ */

View File

@ -19,6 +19,7 @@
* @method CcScheduleQuery orderByDbCueOut($order = Criteria::ASC) Order by the cue_out column * @method CcScheduleQuery orderByDbCueOut($order = Criteria::ASC) Order by the cue_out column
* @method CcScheduleQuery orderByDbScheduleGroupPlayed($order = Criteria::ASC) Order by the schedule_group_played column * @method CcScheduleQuery orderByDbScheduleGroupPlayed($order = Criteria::ASC) Order by the schedule_group_played column
* @method CcScheduleQuery orderByDbMediaItemPlayed($order = Criteria::ASC) Order by the media_item_played column * @method CcScheduleQuery orderByDbMediaItemPlayed($order = Criteria::ASC) Order by the media_item_played column
* @method CcScheduleQuery orderByDbInstanceId($order = Criteria::ASC) Order by the instance_id column
* *
* @method CcScheduleQuery groupByDbId() Group by the id column * @method CcScheduleQuery groupByDbId() Group by the id column
* @method CcScheduleQuery groupByDbPlaylistId() Group by the playlist_id column * @method CcScheduleQuery groupByDbPlaylistId() Group by the playlist_id column
@ -33,15 +34,20 @@
* @method CcScheduleQuery groupByDbCueOut() Group by the cue_out column * @method CcScheduleQuery groupByDbCueOut() Group by the cue_out column
* @method CcScheduleQuery groupByDbScheduleGroupPlayed() Group by the schedule_group_played column * @method CcScheduleQuery groupByDbScheduleGroupPlayed() Group by the schedule_group_played column
* @method CcScheduleQuery groupByDbMediaItemPlayed() Group by the media_item_played column * @method CcScheduleQuery groupByDbMediaItemPlayed() Group by the media_item_played column
* @method CcScheduleQuery groupByDbInstanceId() Group by the instance_id column
* *
* @method CcScheduleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcScheduleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcScheduleQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method CcScheduleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method CcScheduleQuery leftJoinCcShowInstances($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowInstances relation
* @method CcScheduleQuery rightJoinCcShowInstances($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowInstances relation
* @method CcScheduleQuery innerJoinCcShowInstances($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowInstances relation
*
* @method CcSchedule findOne(PropelPDO $con = null) Return the first CcSchedule matching the query * @method CcSchedule findOne(PropelPDO $con = null) Return the first CcSchedule matching the query
* @method CcSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcSchedule matching the query, or a new CcSchedule object populated from the query conditions when no match is found * @method CcSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcSchedule matching the query, or a new CcSchedule object populated from the query conditions when no match is found
* *
* @method CcSchedule findOneByDbId(string $id) Return the first CcSchedule filtered by the id column * @method CcSchedule findOneByDbId(int $id) Return the first CcSchedule filtered by the id column
* @method CcSchedule findOneByDbPlaylistId(int $playlist_id) Return the first CcSchedule filtered by the playlist_id column * @method CcSchedule findOneByDbPlaylistId(int $playlist_id) Return the first CcSchedule filtered by the playlist_id column
* @method CcSchedule findOneByDbStarts(string $starts) Return the first CcSchedule filtered by the starts column * @method CcSchedule findOneByDbStarts(string $starts) Return the first CcSchedule filtered by the starts column
* @method CcSchedule findOneByDbEnds(string $ends) Return the first CcSchedule filtered by the ends column * @method CcSchedule findOneByDbEnds(string $ends) Return the first CcSchedule filtered by the ends column
@ -54,8 +60,9 @@
* @method CcSchedule findOneByDbCueOut(string $cue_out) Return the first CcSchedule filtered by the cue_out column * @method CcSchedule findOneByDbCueOut(string $cue_out) Return the first CcSchedule filtered by the cue_out column
* @method CcSchedule findOneByDbScheduleGroupPlayed(boolean $schedule_group_played) Return the first CcSchedule filtered by the schedule_group_played column * @method CcSchedule findOneByDbScheduleGroupPlayed(boolean $schedule_group_played) Return the first CcSchedule filtered by the schedule_group_played column
* @method CcSchedule findOneByDbMediaItemPlayed(boolean $media_item_played) Return the first CcSchedule filtered by the media_item_played column * @method CcSchedule findOneByDbMediaItemPlayed(boolean $media_item_played) Return the first CcSchedule filtered by the media_item_played column
* @method CcSchedule findOneByDbInstanceId(int $instance_id) Return the first CcSchedule filtered by the instance_id column
* *
* @method array findByDbId(string $id) Return CcSchedule objects filtered by the id column * @method array findByDbId(int $id) Return CcSchedule objects filtered by the id column
* @method array findByDbPlaylistId(int $playlist_id) Return CcSchedule objects filtered by the playlist_id column * @method array findByDbPlaylistId(int $playlist_id) Return CcSchedule objects filtered by the playlist_id column
* @method array findByDbStarts(string $starts) Return CcSchedule objects filtered by the starts column * @method array findByDbStarts(string $starts) Return CcSchedule objects filtered by the starts column
* @method array findByDbEnds(string $ends) Return CcSchedule objects filtered by the ends column * @method array findByDbEnds(string $ends) Return CcSchedule objects filtered by the ends column
@ -68,6 +75,7 @@
* @method array findByDbCueOut(string $cue_out) Return CcSchedule objects filtered by the cue_out column * @method array findByDbCueOut(string $cue_out) Return CcSchedule objects filtered by the cue_out column
* @method array findByDbScheduleGroupPlayed(boolean $schedule_group_played) Return CcSchedule objects filtered by the schedule_group_played column * @method array findByDbScheduleGroupPlayed(boolean $schedule_group_played) Return CcSchedule objects filtered by the schedule_group_played column
* @method array findByDbMediaItemPlayed(boolean $media_item_played) Return CcSchedule objects filtered by the media_item_played column * @method array findByDbMediaItemPlayed(boolean $media_item_played) Return CcSchedule objects filtered by the media_item_played column
* @method array findByDbInstanceId(int $instance_id) Return CcSchedule objects filtered by the instance_id column
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
@ -180,7 +188,7 @@ abstract class BaseCcScheduleQuery extends ModelCriteria
/** /**
* Filter the query on the id column * Filter the query on the id column
* *
* @param string|array $dbId The value to use as filter. * @param int|array $dbId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue) * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
@ -538,6 +546,101 @@ abstract class BaseCcScheduleQuery extends ModelCriteria
return $this->addUsingAlias(CcSchedulePeer::MEDIA_ITEM_PLAYED, $dbMediaItemPlayed, $comparison); return $this->addUsingAlias(CcSchedulePeer::MEDIA_ITEM_PLAYED, $dbMediaItemPlayed, $comparison);
} }
/**
* Filter the query on the instance_id column
*
* @param int|array $dbInstanceId 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 filterByDbInstanceId($dbInstanceId = null, $comparison = null)
{
if (is_array($dbInstanceId)) {
$useMinMax = false;
if (isset($dbInstanceId['min'])) {
$this->addUsingAlias(CcSchedulePeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbInstanceId['max'])) {
$this->addUsingAlias(CcSchedulePeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcSchedulePeer::INSTANCE_ID, $dbInstanceId, $comparison);
}
/**
* Filter the query by a related CcShowInstances object
*
* @param CcShowInstances $ccShowInstances the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function filterByCcShowInstances($ccShowInstances, $comparison = null)
{
return $this
->addUsingAlias(CcSchedulePeer::INSTANCE_ID, $ccShowInstances->getDbId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcShowInstances relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcScheduleQuery The current query, for fluid interface
*/
public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcShowInstances');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcShowInstances');
}
return $this;
}
/**
* Use the CcShowInstances relation CcShowInstances object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowInstancesQuery A secondary query class using the current class as primary query
*/
public function useCcShowInstancesQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCcShowInstances($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery');
}
/** /**
* Exclude object from result * Exclude object from result
* *

View File

@ -37,12 +37,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/ */
protected $name; protected $name;
/**
* The value for the repeats field.
* @var int
*/
protected $repeats;
/** /**
* The value for the description field. * The value for the description field.
* @var string * @var string
@ -61,6 +55,11 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/ */
protected $background_color; protected $background_color;
/**
* @var array CcShowInstances[] Collection to store aggregation of CcShowInstances objects.
*/
protected $collCcShowInstancess;
/** /**
* @var array CcShowDays[] Collection to store aggregation of CcShowDays objects. * @var array CcShowDays[] Collection to store aggregation of CcShowDays objects.
*/ */
@ -71,11 +70,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
*/ */
protected $collCcShowHostss; protected $collCcShowHostss;
/**
* @var array CcShowSchedule[] Collection to store aggregation of CcShowSchedule objects.
*/
protected $collCcShowSchedules;
/** /**
* Flag to prevent endless save loop, if this object is referenced * Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction. * by another object which falls in this transaction.
@ -131,16 +125,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->name; return $this->name;
} }
/**
* Get the [repeats] column value.
*
* @return int
*/
public function getDbRepeats()
{
return $this->repeats;
}
/** /**
* Get the [description] column value. * Get the [description] column value.
* *
@ -211,26 +195,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this; return $this;
} // setDbName() } // setDbName()
/**
* Set the value of [repeats] column.
*
* @param int $v new value
* @return CcShow The current object (for fluent API support)
*/
public function setDbRepeats($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->repeats !== $v) {
$this->repeats = $v;
$this->modifiedColumns[] = CcShowPeer::REPEATS;
}
return $this;
} // setDbRepeats()
/** /**
* Set the value of [description] column. * Set the value of [description] column.
* *
@ -329,10 +293,9 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->repeats = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; $this->description = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->description = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->color = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->color = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; $this->background_color = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->background_color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -341,7 +304,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 6; // 6 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 5; // 5 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcShow object", $e); throw new PropelException("Error populating CcShow object", $e);
@ -403,12 +366,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects? if ($deep) { // also de-associate any related objects?
$this->collCcShowInstancess = null;
$this->collCcShowDayss = null; $this->collCcShowDayss = null;
$this->collCcShowHostss = null; $this->collCcShowHostss = null;
$this->collCcShowSchedules = null;
} // if (deep) } // if (deep)
} }
@ -542,6 +505,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->resetModified(); // [HL] After being saved an object is no longer 'modified' $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
} }
if ($this->collCcShowInstancess !== null) {
foreach ($this->collCcShowInstancess as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
if ($this->collCcShowDayss !== null) { if ($this->collCcShowDayss !== null) {
foreach ($this->collCcShowDayss as $referrerFK) { foreach ($this->collCcShowDayss as $referrerFK) {
if (!$referrerFK->isDeleted()) { if (!$referrerFK->isDeleted()) {
@ -558,14 +529,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
} }
} }
if ($this->collCcShowSchedules !== null) {
foreach ($this->collCcShowSchedules as $referrerFK) {
if (!$referrerFK->isDeleted()) {
$affectedRows += $referrerFK->save($con);
}
}
}
$this->alreadyInSave = false; $this->alreadyInSave = false;
} }
@ -637,6 +600,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent
} }
if ($this->collCcShowInstancess !== null) {
foreach ($this->collCcShowInstancess as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
if ($this->collCcShowDayss !== null) { if ($this->collCcShowDayss !== null) {
foreach ($this->collCcShowDayss as $referrerFK) { foreach ($this->collCcShowDayss as $referrerFK) {
if (!$referrerFK->validate($columns)) { if (!$referrerFK->validate($columns)) {
@ -653,14 +624,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
} }
} }
if ($this->collCcShowSchedules !== null) {
foreach ($this->collCcShowSchedules as $referrerFK) {
if (!$referrerFK->validate($columns)) {
$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
}
}
}
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
} }
@ -701,15 +664,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->getDbName(); return $this->getDbName();
break; break;
case 2: case 2:
return $this->getDbRepeats();
break;
case 3:
return $this->getDbDescription(); return $this->getDbDescription();
break; break;
case 4: case 3:
return $this->getDbColor(); return $this->getDbColor();
break; break;
case 5: case 4:
return $this->getDbBackgroundColor(); return $this->getDbBackgroundColor();
break; break;
default: default:
@ -737,10 +697,9 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$result = array( $result = array(
$keys[0] => $this->getDbId(), $keys[0] => $this->getDbId(),
$keys[1] => $this->getDbName(), $keys[1] => $this->getDbName(),
$keys[2] => $this->getDbRepeats(), $keys[2] => $this->getDbDescription(),
$keys[3] => $this->getDbDescription(), $keys[3] => $this->getDbColor(),
$keys[4] => $this->getDbColor(), $keys[4] => $this->getDbBackgroundColor(),
$keys[5] => $this->getDbBackgroundColor(),
); );
return $result; return $result;
} }
@ -779,15 +738,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$this->setDbName($value); $this->setDbName($value);
break; break;
case 2: case 2:
$this->setDbRepeats($value);
break;
case 3:
$this->setDbDescription($value); $this->setDbDescription($value);
break; break;
case 4: case 3:
$this->setDbColor($value); $this->setDbColor($value);
break; break;
case 5: case 4:
$this->setDbBackgroundColor($value); $this->setDbBackgroundColor($value);
break; break;
} // switch() } // switch()
@ -816,10 +772,9 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]); if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbRepeats($arr[$keys[2]]); if (array_key_exists($keys[2], $arr)) $this->setDbDescription($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbDescription($arr[$keys[3]]); if (array_key_exists($keys[3], $arr)) $this->setDbColor($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbColor($arr[$keys[4]]); if (array_key_exists($keys[4], $arr)) $this->setDbBackgroundColor($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbBackgroundColor($arr[$keys[5]]);
} }
/** /**
@ -833,7 +788,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowPeer::ID)) $criteria->add(CcShowPeer::ID, $this->id); if ($this->isColumnModified(CcShowPeer::ID)) $criteria->add(CcShowPeer::ID, $this->id);
if ($this->isColumnModified(CcShowPeer::NAME)) $criteria->add(CcShowPeer::NAME, $this->name); if ($this->isColumnModified(CcShowPeer::NAME)) $criteria->add(CcShowPeer::NAME, $this->name);
if ($this->isColumnModified(CcShowPeer::REPEATS)) $criteria->add(CcShowPeer::REPEATS, $this->repeats);
if ($this->isColumnModified(CcShowPeer::DESCRIPTION)) $criteria->add(CcShowPeer::DESCRIPTION, $this->description); if ($this->isColumnModified(CcShowPeer::DESCRIPTION)) $criteria->add(CcShowPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CcShowPeer::COLOR)) $criteria->add(CcShowPeer::COLOR, $this->color); if ($this->isColumnModified(CcShowPeer::COLOR)) $criteria->add(CcShowPeer::COLOR, $this->color);
if ($this->isColumnModified(CcShowPeer::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color); if ($this->isColumnModified(CcShowPeer::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color);
@ -899,7 +853,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
public function copyInto($copyObj, $deepCopy = false) public function copyInto($copyObj, $deepCopy = false)
{ {
$copyObj->setDbName($this->name); $copyObj->setDbName($this->name);
$copyObj->setDbRepeats($this->repeats);
$copyObj->setDbDescription($this->description); $copyObj->setDbDescription($this->description);
$copyObj->setDbColor($this->color); $copyObj->setDbColor($this->color);
$copyObj->setDbBackgroundColor($this->background_color); $copyObj->setDbBackgroundColor($this->background_color);
@ -909,6 +862,12 @@ abstract class BaseCcShow extends BaseObject implements Persistent
// the getter/setter methods for fkey referrer objects. // the getter/setter methods for fkey referrer objects.
$copyObj->setNew(false); $copyObj->setNew(false);
foreach ($this->getCcShowInstancess() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCcShowInstances($relObj->copy($deepCopy));
}
}
foreach ($this->getCcShowDayss() as $relObj) { foreach ($this->getCcShowDayss() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCcShowDays($relObj->copy($deepCopy)); $copyObj->addCcShowDays($relObj->copy($deepCopy));
@ -921,12 +880,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
} }
} }
foreach ($this->getCcShowSchedules() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCcShowSchedule($relObj->copy($deepCopy));
}
}
} // if ($deepCopy) } // if ($deepCopy)
@ -972,6 +925,115 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return self::$peer; return self::$peer;
} }
/**
* Clears out the collCcShowInstancess collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addCcShowInstancess()
*/
public function clearCcShowInstancess()
{
$this->collCcShowInstancess = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Initializes the collCcShowInstancess collection.
*
* By default this just sets the collCcShowInstancess collection to an empty array (like clearcollCcShowInstancess());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
* @return void
*/
public function initCcShowInstancess()
{
$this->collCcShowInstancess = new PropelObjectCollection();
$this->collCcShowInstancess->setModel('CcShowInstances');
}
/**
* 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)
->find($con);
if (null !== $criteria) {
return $collCcShowInstancess;
}
$this->collCcShowInstancess = $collCcShowInstancess;
}
}
return $this->collCcShowInstancess;
}
/**
* Returns the number of related CcShowInstances objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related CcShowInstances objects.
* @throws PropelException
*/
public function countCcShowInstancess(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
if(null === $this->collCcShowInstancess || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowInstancess) {
return 0;
} else {
$query = CcShowInstancesQuery::create(null, $criteria);
if($distinct) {
$query->distinct();
}
return $query
->filterByCcShow($this)
->count($con);
}
} else {
return count($this->collCcShowInstancess);
}
}
/**
* Method called to associate a CcShowInstances object to this object
* through the CcShowInstances foreign key attribute.
*
* @param CcShowInstances $l CcShowInstances
* @return void
* @throws PropelException
*/
public function addCcShowInstances(CcShowInstances $l)
{
if ($this->collCcShowInstancess === null) {
$this->initCcShowInstancess();
}
if (!$this->collCcShowInstancess->contains($l)) { // only add it if the **same** object is not already associated
$this->collCcShowInstancess[]= $l;
$l->setCcShow($this);
}
}
/** /**
* Clears out the collCcShowDayss collection * Clears out the collCcShowDayss collection
* *
@ -1215,115 +1277,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
return $this->getCcShowHostss($query, $con); return $this->getCcShowHostss($query, $con);
} }
/**
* Clears out the collCcShowSchedules collection
*
* This does not modify the database; however, it will remove any associated objects, causing
* them to be refetched by subsequent calls to accessor method.
*
* @return void
* @see addCcShowSchedules()
*/
public function clearCcShowSchedules()
{
$this->collCcShowSchedules = null; // important to set this to NULL since that means it is uninitialized
}
/**
* Initializes the collCcShowSchedules collection.
*
* By default this just sets the collCcShowSchedules collection to an empty array (like clearcollCcShowSchedules());
* however, you may wish to override this method in your stub class to provide setting appropriate
* to your application -- for example, setting the initial array to the values stored in database.
*
* @return void
*/
public function initCcShowSchedules()
{
$this->collCcShowSchedules = new PropelObjectCollection();
$this->collCcShowSchedules->setModel('CcShowSchedule');
}
/**
* Gets an array of CcShowSchedule 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 CcShowSchedule[] List of CcShowSchedule objects
* @throws PropelException
*/
public function getCcShowSchedules($criteria = null, PropelPDO $con = null)
{
if(null === $this->collCcShowSchedules || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowSchedules) {
// return empty collection
$this->initCcShowSchedules();
} else {
$collCcShowSchedules = CcShowScheduleQuery::create(null, $criteria)
->filterByCcShow($this)
->find($con);
if (null !== $criteria) {
return $collCcShowSchedules;
}
$this->collCcShowSchedules = $collCcShowSchedules;
}
}
return $this->collCcShowSchedules;
}
/**
* Returns the number of related CcShowSchedule objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related CcShowSchedule objects.
* @throws PropelException
*/
public function countCcShowSchedules(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
if(null === $this->collCcShowSchedules || null !== $criteria) {
if ($this->isNew() && null === $this->collCcShowSchedules) {
return 0;
} else {
$query = CcShowScheduleQuery::create(null, $criteria);
if($distinct) {
$query->distinct();
}
return $query
->filterByCcShow($this)
->count($con);
}
} else {
return count($this->collCcShowSchedules);
}
}
/**
* Method called to associate a CcShowSchedule object to this object
* through the CcShowSchedule foreign key attribute.
*
* @param CcShowSchedule $l CcShowSchedule
* @return void
* @throws PropelException
*/
public function addCcShowSchedule(CcShowSchedule $l)
{
if ($this->collCcShowSchedules === null) {
$this->initCcShowSchedules();
}
if (!$this->collCcShowSchedules->contains($l)) { // only add it if the **same** object is not already associated
$this->collCcShowSchedules[]= $l;
$l->setCcShow($this);
}
}
/** /**
* Clears the current object and sets all attributes to their default values * Clears the current object and sets all attributes to their default values
*/ */
@ -1331,7 +1284,6 @@ abstract class BaseCcShow extends BaseObject implements Persistent
{ {
$this->id = null; $this->id = null;
$this->name = null; $this->name = null;
$this->repeats = null;
$this->description = null; $this->description = null;
$this->color = null; $this->color = null;
$this->background_color = null; $this->background_color = null;
@ -1356,6 +1308,11 @@ abstract class BaseCcShow extends BaseObject implements Persistent
public function clearAllReferences($deep = false) public function clearAllReferences($deep = false)
{ {
if ($deep) { if ($deep) {
if ($this->collCcShowInstancess) {
foreach ((array) $this->collCcShowInstancess as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collCcShowDayss) { if ($this->collCcShowDayss) {
foreach ((array) $this->collCcShowDayss as $o) { foreach ((array) $this->collCcShowDayss as $o) {
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
@ -1366,16 +1323,11 @@ abstract class BaseCcShow extends BaseObject implements Persistent
$o->clearAllReferences($deep); $o->clearAllReferences($deep);
} }
} }
if ($this->collCcShowSchedules) {
foreach ((array) $this->collCcShowSchedules as $o) {
$o->clearAllReferences($deep);
}
}
} // if ($deep) } // if ($deep)
$this->collCcShowInstancess = null;
$this->collCcShowDayss = null; $this->collCcShowDayss = null;
$this->collCcShowHostss = null; $this->collCcShowHostss = null;
$this->collCcShowSchedules = null;
} }
/** /**

View File

@ -49,10 +49,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
protected $start_time; protected $start_time;
/** /**
* The value for the end_time field. * The value for the duration field.
* @var string * @var string
*/ */
protected $end_time; protected $duration;
/** /**
* The value for the day field. * The value for the day field.
@ -60,6 +60,18 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
*/ */
protected $day; protected $day;
/**
* The value for the repeat_type field.
* @var int
*/
protected $repeat_type;
/**
* The value for the next_pop_date field.
* @var string
*/
protected $next_pop_date;
/** /**
* The value for the show_id field. * The value for the show_id field.
* @var int * @var int
@ -195,7 +207,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
} }
/** /**
* Get the [optionally formatted] temporal [end_time] column value. * Get the [optionally formatted] temporal [duration] column value.
* *
* *
* @param string $format The date/time format string (either date()-style or strftime()-style). * @param string $format The date/time format string (either date()-style or strftime()-style).
@ -203,18 +215,18 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value. * @throws PropelException - if unable to parse/validate the date/time value.
*/ */
public function getDbEndTime($format = '%X') public function getDbDuration($format = '%X')
{ {
if ($this->end_time === null) { if ($this->duration === null) {
return null; return null;
} }
try { try {
$dt = new DateTime($this->end_time); $dt = new DateTime($this->duration);
} catch (Exception $x) { } catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->end_time, true), $x); throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->duration, true), $x);
} }
if ($format === null) { if ($format === null) {
@ -237,6 +249,49 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
return $this->day; return $this->day;
} }
/**
* Get the [repeat_type] column value.
*
* @return int
*/
public function getDbRepeatType()
{
return $this->repeat_type;
}
/**
* Get the [optionally formatted] temporal [next_pop_date] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbNextPopDate($format = '%x')
{
if ($this->next_pop_date === null) {
return null;
}
try {
$dt = new DateTime($this->next_pop_date);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->next_pop_date, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
}
/** /**
* Get the [show_id] column value. * Get the [show_id] column value.
* *
@ -415,13 +470,13 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
} // setDbStartTime() } // setDbStartTime()
/** /**
* Sets the value of [end_time] column to a normalized version of the date/time value specified. * Sets the value of [duration] column to a normalized version of the date/time value specified.
* *
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects. * be treated as NULL for temporal objects.
* @return CcShowDays The current object (for fluent API support) * @return CcShowDays The current object (for fluent API support)
*/ */
public function setDbEndTime($v) public function setDbDuration($v)
{ {
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now') // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
// -- which is unexpected, to say the least. // -- which is unexpected, to say the least.
@ -446,22 +501,22 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
} }
} }
if ( $this->end_time !== null || $dt !== null ) { if ( $this->duration !== null || $dt !== null ) {
// (nested ifs are a little easier to read in this case) // (nested ifs are a little easier to read in this case)
$currNorm = ($this->end_time !== null && $tmpDt = new DateTime($this->end_time)) ? $tmpDt->format('H:i:s') : null; $currNorm = ($this->duration !== null && $tmpDt = new DateTime($this->duration)) ? $tmpDt->format('H:i:s') : null;
$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match if ( ($currNorm !== $newNorm) // normalized values don't match
) )
{ {
$this->end_time = ($dt ? $dt->format('H:i:s') : null); $this->duration = ($dt ? $dt->format('H:i:s') : null);
$this->modifiedColumns[] = CcShowDaysPeer::END_TIME; $this->modifiedColumns[] = CcShowDaysPeer::DURATION;
} }
} // if either are not null } // if either are not null
return $this; return $this;
} // setDbEndTime() } // setDbDuration()
/** /**
* Set the value of [day] column. * Set the value of [day] column.
@ -483,6 +538,75 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
return $this; return $this;
} // setDbDay() } // setDbDay()
/**
* Set the value of [repeat_type] column.
*
* @param int $v new value
* @return CcShowDays The current object (for fluent API support)
*/
public function setDbRepeatType($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->repeat_type !== $v) {
$this->repeat_type = $v;
$this->modifiedColumns[] = CcShowDaysPeer::REPEAT_TYPE;
}
return $this;
} // setDbRepeatType()
/**
* Sets the value of [next_pop_date] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcShowDays The current object (for fluent API support)
*/
public function setDbNextPopDate($v)
{
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
// -- which is unexpected, to say the least.
if ($v === null || $v === '') {
$dt = null;
} elseif ($v instanceof DateTime) {
$dt = $v;
} else {
// some string/numeric value passed; we normalize that so that we can
// validate it.
try {
if (is_numeric($v)) { // if it's a unix timestamp
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
// We have to explicitly specify and then change the time zone because of a
// DateTime bug: http://bugs.php.net/bug.php?id=43003
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
} else {
$dt = new DateTime($v);
}
} catch (Exception $x) {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
if ( $this->next_pop_date !== null || $dt !== null ) {
// (nested ifs are a little easier to read in this case)
$currNorm = ($this->next_pop_date !== null && $tmpDt = new DateTime($this->next_pop_date)) ? $tmpDt->format('Y-m-d') : null;
$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
)
{
$this->next_pop_date = ($dt ? $dt->format('Y-m-d') : null);
$this->modifiedColumns[] = CcShowDaysPeer::NEXT_POP_DATE;
}
} // if either are not null
return $this;
} // setDbNextPopDate()
/** /**
* Set the value of [show_id] column. * Set the value of [show_id] column.
* *
@ -543,9 +667,11 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->first_show = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; $this->first_show = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->last_show = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->last_show = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->start_time = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; $this->start_time = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->end_time = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; $this->duration = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->day = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; $this->day = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
$this->show_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; $this->repeat_type = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
$this->next_pop_date = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
$this->show_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -554,7 +680,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 7; // 7 = CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 9; // 9 = CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcShowDays object", $e); throw new PropelException("Error populating CcShowDays object", $e);
@ -894,12 +1020,18 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
return $this->getDbStartTime(); return $this->getDbStartTime();
break; break;
case 4: case 4:
return $this->getDbEndTime(); return $this->getDbDuration();
break; break;
case 5: case 5:
return $this->getDbDay(); return $this->getDbDay();
break; break;
case 6: case 6:
return $this->getDbRepeatType();
break;
case 7:
return $this->getDbNextPopDate();
break;
case 8:
return $this->getDbShowId(); return $this->getDbShowId();
break; break;
default: default:
@ -930,9 +1062,11 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$keys[1] => $this->getDbFirstShow(), $keys[1] => $this->getDbFirstShow(),
$keys[2] => $this->getDbLastShow(), $keys[2] => $this->getDbLastShow(),
$keys[3] => $this->getDbStartTime(), $keys[3] => $this->getDbStartTime(),
$keys[4] => $this->getDbEndTime(), $keys[4] => $this->getDbDuration(),
$keys[5] => $this->getDbDay(), $keys[5] => $this->getDbDay(),
$keys[6] => $this->getDbShowId(), $keys[6] => $this->getDbRepeatType(),
$keys[7] => $this->getDbNextPopDate(),
$keys[8] => $this->getDbShowId(),
); );
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->aCcShow) { if (null !== $this->aCcShow) {
@ -982,12 +1116,18 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->setDbStartTime($value); $this->setDbStartTime($value);
break; break;
case 4: case 4:
$this->setDbEndTime($value); $this->setDbDuration($value);
break; break;
case 5: case 5:
$this->setDbDay($value); $this->setDbDay($value);
break; break;
case 6: case 6:
$this->setDbRepeatType($value);
break;
case 7:
$this->setDbNextPopDate($value);
break;
case 8:
$this->setDbShowId($value); $this->setDbShowId($value);
break; break;
} // switch() } // switch()
@ -1018,9 +1158,11 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
if (array_key_exists($keys[1], $arr)) $this->setDbFirstShow($arr[$keys[1]]); if (array_key_exists($keys[1], $arr)) $this->setDbFirstShow($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbLastShow($arr[$keys[2]]); if (array_key_exists($keys[2], $arr)) $this->setDbLastShow($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbStartTime($arr[$keys[3]]); if (array_key_exists($keys[3], $arr)) $this->setDbStartTime($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbEndTime($arr[$keys[4]]); if (array_key_exists($keys[4], $arr)) $this->setDbDuration($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbDay($arr[$keys[5]]); if (array_key_exists($keys[5], $arr)) $this->setDbDay($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbShowId($arr[$keys[6]]); if (array_key_exists($keys[6], $arr)) $this->setDbRepeatType($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbNextPopDate($arr[$keys[7]]);
if (array_key_exists($keys[8], $arr)) $this->setDbShowId($arr[$keys[8]]);
} }
/** /**
@ -1036,8 +1178,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
if ($this->isColumnModified(CcShowDaysPeer::FIRST_SHOW)) $criteria->add(CcShowDaysPeer::FIRST_SHOW, $this->first_show); if ($this->isColumnModified(CcShowDaysPeer::FIRST_SHOW)) $criteria->add(CcShowDaysPeer::FIRST_SHOW, $this->first_show);
if ($this->isColumnModified(CcShowDaysPeer::LAST_SHOW)) $criteria->add(CcShowDaysPeer::LAST_SHOW, $this->last_show); if ($this->isColumnModified(CcShowDaysPeer::LAST_SHOW)) $criteria->add(CcShowDaysPeer::LAST_SHOW, $this->last_show);
if ($this->isColumnModified(CcShowDaysPeer::START_TIME)) $criteria->add(CcShowDaysPeer::START_TIME, $this->start_time); if ($this->isColumnModified(CcShowDaysPeer::START_TIME)) $criteria->add(CcShowDaysPeer::START_TIME, $this->start_time);
if ($this->isColumnModified(CcShowDaysPeer::END_TIME)) $criteria->add(CcShowDaysPeer::END_TIME, $this->end_time); if ($this->isColumnModified(CcShowDaysPeer::DURATION)) $criteria->add(CcShowDaysPeer::DURATION, $this->duration);
if ($this->isColumnModified(CcShowDaysPeer::DAY)) $criteria->add(CcShowDaysPeer::DAY, $this->day); if ($this->isColumnModified(CcShowDaysPeer::DAY)) $criteria->add(CcShowDaysPeer::DAY, $this->day);
if ($this->isColumnModified(CcShowDaysPeer::REPEAT_TYPE)) $criteria->add(CcShowDaysPeer::REPEAT_TYPE, $this->repeat_type);
if ($this->isColumnModified(CcShowDaysPeer::NEXT_POP_DATE)) $criteria->add(CcShowDaysPeer::NEXT_POP_DATE, $this->next_pop_date);
if ($this->isColumnModified(CcShowDaysPeer::SHOW_ID)) $criteria->add(CcShowDaysPeer::SHOW_ID, $this->show_id); if ($this->isColumnModified(CcShowDaysPeer::SHOW_ID)) $criteria->add(CcShowDaysPeer::SHOW_ID, $this->show_id);
return $criteria; return $criteria;
@ -1103,8 +1247,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$copyObj->setDbFirstShow($this->first_show); $copyObj->setDbFirstShow($this->first_show);
$copyObj->setDbLastShow($this->last_show); $copyObj->setDbLastShow($this->last_show);
$copyObj->setDbStartTime($this->start_time); $copyObj->setDbStartTime($this->start_time);
$copyObj->setDbEndTime($this->end_time); $copyObj->setDbDuration($this->duration);
$copyObj->setDbDay($this->day); $copyObj->setDbDay($this->day);
$copyObj->setDbRepeatType($this->repeat_type);
$copyObj->setDbNextPopDate($this->next_pop_date);
$copyObj->setDbShowId($this->show_id); $copyObj->setDbShowId($this->show_id);
$copyObj->setNew(true); $copyObj->setNew(true);
@ -1207,8 +1353,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->first_show = null; $this->first_show = null;
$this->last_show = null; $this->last_show = null;
$this->start_time = null; $this->start_time = null;
$this->end_time = null; $this->duration = null;
$this->day = null; $this->day = null;
$this->repeat_type = null;
$this->next_pop_date = null;
$this->show_id = null; $this->show_id = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowDaysPeer {
const TM_CLASS = 'CcShowDaysTableMap'; const TM_CLASS = 'CcShowDaysTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 7; const NUM_COLUMNS = 9;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -43,12 +43,18 @@ abstract class BaseCcShowDaysPeer {
/** the column name for the START_TIME field */ /** the column name for the START_TIME field */
const START_TIME = 'cc_show_days.START_TIME'; const START_TIME = 'cc_show_days.START_TIME';
/** the column name for the END_TIME field */ /** the column name for the DURATION field */
const END_TIME = 'cc_show_days.END_TIME'; const DURATION = 'cc_show_days.DURATION';
/** the column name for the DAY field */ /** the column name for the DAY field */
const DAY = 'cc_show_days.DAY'; const DAY = 'cc_show_days.DAY';
/** the column name for the REPEAT_TYPE field */
const REPEAT_TYPE = 'cc_show_days.REPEAT_TYPE';
/** the column name for the NEXT_POP_DATE field */
const NEXT_POP_DATE = 'cc_show_days.NEXT_POP_DATE';
/** the column name for the SHOW_ID field */ /** the column name for the SHOW_ID field */
const SHOW_ID = 'cc_show_days.SHOW_ID'; const SHOW_ID = 'cc_show_days.SHOW_ID';
@ -68,12 +74,12 @@ abstract class BaseCcShowDaysPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbFirstShow', 'DbLastShow', 'DbStartTime', 'DbEndTime', 'DbDay', 'DbShowId', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbFirstShow', 'DbLastShow', 'DbStartTime', 'DbDuration', 'DbDay', 'DbRepeatType', 'DbNextPopDate', 'DbShowId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbFirstShow', 'dbLastShow', 'dbStartTime', 'dbEndTime', 'dbDay', 'dbShowId', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbFirstShow', 'dbLastShow', 'dbStartTime', 'dbDuration', 'dbDay', 'dbRepeatType', 'dbNextPopDate', 'dbShowId', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::FIRST_SHOW, self::LAST_SHOW, self::START_TIME, self::END_TIME, self::DAY, self::SHOW_ID, ), BasePeer::TYPE_COLNAME => array (self::ID, self::FIRST_SHOW, self::LAST_SHOW, self::START_TIME, self::DURATION, self::DAY, self::REPEAT_TYPE, self::NEXT_POP_DATE, self::SHOW_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'FIRST_SHOW', 'LAST_SHOW', 'START_TIME', 'END_TIME', 'DAY', 'SHOW_ID', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'FIRST_SHOW', 'LAST_SHOW', 'START_TIME', 'DURATION', 'DAY', 'REPEAT_TYPE', 'NEXT_POP_DATE', 'SHOW_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'first_show', 'last_show', 'start_time', 'end_time', 'day', 'show_id', ), BasePeer::TYPE_FIELDNAME => array ('id', 'first_show', 'last_show', 'start_time', 'duration', 'day', 'repeat_type', 'next_pop_date', 'show_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
); );
/** /**
@ -83,12 +89,12 @@ abstract class BaseCcShowDaysPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbFirstShow' => 1, 'DbLastShow' => 2, 'DbStartTime' => 3, 'DbEndTime' => 4, 'DbDay' => 5, 'DbShowId' => 6, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbFirstShow' => 1, 'DbLastShow' => 2, 'DbStartTime' => 3, 'DbDuration' => 4, 'DbDay' => 5, 'DbRepeatType' => 6, 'DbNextPopDate' => 7, 'DbShowId' => 8, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbFirstShow' => 1, 'dbLastShow' => 2, 'dbStartTime' => 3, 'dbEndTime' => 4, 'dbDay' => 5, 'dbShowId' => 6, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbFirstShow' => 1, 'dbLastShow' => 2, 'dbStartTime' => 3, 'dbDuration' => 4, 'dbDay' => 5, 'dbRepeatType' => 6, 'dbNextPopDate' => 7, 'dbShowId' => 8, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FIRST_SHOW => 1, self::LAST_SHOW => 2, self::START_TIME => 3, self::END_TIME => 4, self::DAY => 5, self::SHOW_ID => 6, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FIRST_SHOW => 1, self::LAST_SHOW => 2, self::START_TIME => 3, self::DURATION => 4, self::DAY => 5, self::REPEAT_TYPE => 6, self::NEXT_POP_DATE => 7, self::SHOW_ID => 8, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'FIRST_SHOW' => 1, 'LAST_SHOW' => 2, 'START_TIME' => 3, 'END_TIME' => 4, 'DAY' => 5, 'SHOW_ID' => 6, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'FIRST_SHOW' => 1, 'LAST_SHOW' => 2, 'START_TIME' => 3, 'DURATION' => 4, 'DAY' => 5, 'REPEAT_TYPE' => 6, 'NEXT_POP_DATE' => 7, 'SHOW_ID' => 8, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'first_show' => 1, 'last_show' => 2, 'start_time' => 3, 'end_time' => 4, 'day' => 5, 'show_id' => 6, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'first_show' => 1, 'last_show' => 2, 'start_time' => 3, 'duration' => 4, 'day' => 5, 'repeat_type' => 6, 'next_pop_date' => 7, 'show_id' => 8, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, )
); );
/** /**
@ -164,16 +170,20 @@ abstract class BaseCcShowDaysPeer {
$criteria->addSelectColumn(CcShowDaysPeer::FIRST_SHOW); $criteria->addSelectColumn(CcShowDaysPeer::FIRST_SHOW);
$criteria->addSelectColumn(CcShowDaysPeer::LAST_SHOW); $criteria->addSelectColumn(CcShowDaysPeer::LAST_SHOW);
$criteria->addSelectColumn(CcShowDaysPeer::START_TIME); $criteria->addSelectColumn(CcShowDaysPeer::START_TIME);
$criteria->addSelectColumn(CcShowDaysPeer::END_TIME); $criteria->addSelectColumn(CcShowDaysPeer::DURATION);
$criteria->addSelectColumn(CcShowDaysPeer::DAY); $criteria->addSelectColumn(CcShowDaysPeer::DAY);
$criteria->addSelectColumn(CcShowDaysPeer::REPEAT_TYPE);
$criteria->addSelectColumn(CcShowDaysPeer::NEXT_POP_DATE);
$criteria->addSelectColumn(CcShowDaysPeer::SHOW_ID); $criteria->addSelectColumn(CcShowDaysPeer::SHOW_ID);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.FIRST_SHOW'); $criteria->addSelectColumn($alias . '.FIRST_SHOW');
$criteria->addSelectColumn($alias . '.LAST_SHOW'); $criteria->addSelectColumn($alias . '.LAST_SHOW');
$criteria->addSelectColumn($alias . '.START_TIME'); $criteria->addSelectColumn($alias . '.START_TIME');
$criteria->addSelectColumn($alias . '.END_TIME'); $criteria->addSelectColumn($alias . '.DURATION');
$criteria->addSelectColumn($alias . '.DAY'); $criteria->addSelectColumn($alias . '.DAY');
$criteria->addSelectColumn($alias . '.REPEAT_TYPE');
$criteria->addSelectColumn($alias . '.NEXT_POP_DATE');
$criteria->addSelectColumn($alias . '.SHOW_ID'); $criteria->addSelectColumn($alias . '.SHOW_ID');
} }
} }

View File

@ -10,16 +10,20 @@
* @method CcShowDaysQuery orderByDbFirstShow($order = Criteria::ASC) Order by the first_show column * @method CcShowDaysQuery orderByDbFirstShow($order = Criteria::ASC) Order by the first_show column
* @method CcShowDaysQuery orderByDbLastShow($order = Criteria::ASC) Order by the last_show column * @method CcShowDaysQuery orderByDbLastShow($order = Criteria::ASC) Order by the last_show column
* @method CcShowDaysQuery orderByDbStartTime($order = Criteria::ASC) Order by the start_time column * @method CcShowDaysQuery orderByDbStartTime($order = Criteria::ASC) Order by the start_time column
* @method CcShowDaysQuery orderByDbEndTime($order = Criteria::ASC) Order by the end_time column * @method CcShowDaysQuery orderByDbDuration($order = Criteria::ASC) Order by the duration column
* @method CcShowDaysQuery orderByDbDay($order = Criteria::ASC) Order by the day column * @method CcShowDaysQuery orderByDbDay($order = Criteria::ASC) Order by the day column
* @method CcShowDaysQuery orderByDbRepeatType($order = Criteria::ASC) Order by the repeat_type column
* @method CcShowDaysQuery orderByDbNextPopDate($order = Criteria::ASC) Order by the next_pop_date column
* @method CcShowDaysQuery orderByDbShowId($order = Criteria::ASC) Order by the show_id column * @method CcShowDaysQuery orderByDbShowId($order = Criteria::ASC) Order by the show_id column
* *
* @method CcShowDaysQuery groupByDbId() Group by the id column * @method CcShowDaysQuery groupByDbId() Group by the id column
* @method CcShowDaysQuery groupByDbFirstShow() Group by the first_show column * @method CcShowDaysQuery groupByDbFirstShow() Group by the first_show column
* @method CcShowDaysQuery groupByDbLastShow() Group by the last_show column * @method CcShowDaysQuery groupByDbLastShow() Group by the last_show column
* @method CcShowDaysQuery groupByDbStartTime() Group by the start_time column * @method CcShowDaysQuery groupByDbStartTime() Group by the start_time column
* @method CcShowDaysQuery groupByDbEndTime() Group by the end_time column * @method CcShowDaysQuery groupByDbDuration() Group by the duration column
* @method CcShowDaysQuery groupByDbDay() Group by the day column * @method CcShowDaysQuery groupByDbDay() Group by the day column
* @method CcShowDaysQuery groupByDbRepeatType() Group by the repeat_type column
* @method CcShowDaysQuery groupByDbNextPopDate() Group by the next_pop_date column
* @method CcShowDaysQuery groupByDbShowId() Group by the show_id column * @method CcShowDaysQuery groupByDbShowId() Group by the show_id column
* *
* @method CcShowDaysQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcShowDaysQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
@ -37,16 +41,20 @@
* @method CcShowDays findOneByDbFirstShow(string $first_show) Return the first CcShowDays filtered by the first_show column * @method CcShowDays findOneByDbFirstShow(string $first_show) Return the first CcShowDays filtered by the first_show column
* @method CcShowDays findOneByDbLastShow(string $last_show) Return the first CcShowDays filtered by the last_show column * @method CcShowDays findOneByDbLastShow(string $last_show) Return the first CcShowDays filtered by the last_show column
* @method CcShowDays findOneByDbStartTime(string $start_time) Return the first CcShowDays filtered by the start_time column * @method CcShowDays findOneByDbStartTime(string $start_time) Return the first CcShowDays filtered by the start_time column
* @method CcShowDays findOneByDbEndTime(string $end_time) Return the first CcShowDays filtered by the end_time column * @method CcShowDays findOneByDbDuration(string $duration) Return the first CcShowDays filtered by the duration column
* @method CcShowDays findOneByDbDay(int $day) Return the first CcShowDays filtered by the day column * @method CcShowDays findOneByDbDay(int $day) Return the first CcShowDays filtered by the day column
* @method CcShowDays findOneByDbRepeatType(int $repeat_type) Return the first CcShowDays filtered by the repeat_type column
* @method CcShowDays findOneByDbNextPopDate(string $next_pop_date) Return the first CcShowDays filtered by the next_pop_date column
* @method CcShowDays findOneByDbShowId(int $show_id) Return the first CcShowDays filtered by the show_id column * @method CcShowDays findOneByDbShowId(int $show_id) Return the first CcShowDays filtered by the show_id column
* *
* @method array findByDbId(int $id) Return CcShowDays objects filtered by the id column * @method array findByDbId(int $id) Return CcShowDays objects filtered by the id column
* @method array findByDbFirstShow(string $first_show) Return CcShowDays objects filtered by the first_show column * @method array findByDbFirstShow(string $first_show) Return CcShowDays objects filtered by the first_show column
* @method array findByDbLastShow(string $last_show) Return CcShowDays objects filtered by the last_show column * @method array findByDbLastShow(string $last_show) Return CcShowDays objects filtered by the last_show column
* @method array findByDbStartTime(string $start_time) Return CcShowDays objects filtered by the start_time column * @method array findByDbStartTime(string $start_time) Return CcShowDays objects filtered by the start_time column
* @method array findByDbEndTime(string $end_time) Return CcShowDays objects filtered by the end_time column * @method array findByDbDuration(string $duration) Return CcShowDays objects filtered by the duration column
* @method array findByDbDay(int $day) Return CcShowDays objects filtered by the day column * @method array findByDbDay(int $day) Return CcShowDays objects filtered by the day column
* @method array findByDbRepeatType(int $repeat_type) Return CcShowDays objects filtered by the repeat_type column
* @method array findByDbNextPopDate(string $next_pop_date) Return CcShowDays objects filtered by the next_pop_date column
* @method array findByDbShowId(int $show_id) Return CcShowDays objects filtered by the show_id column * @method array findByDbShowId(int $show_id) Return CcShowDays objects filtered by the show_id column
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
@ -268,24 +276,24 @@ abstract class BaseCcShowDaysQuery extends ModelCriteria
} }
/** /**
* Filter the query on the end_time column * Filter the query on the duration column
* *
* @param string|array $dbEndTime The value to use as filter. * @param string|array $dbDuration The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue) * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return CcShowDaysQuery The current query, for fluid interface * @return CcShowDaysQuery The current query, for fluid interface
*/ */
public function filterByDbEndTime($dbEndTime = null, $comparison = null) public function filterByDbDuration($dbDuration = null, $comparison = null)
{ {
if (is_array($dbEndTime)) { if (is_array($dbDuration)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbEndTime['min'])) { if (isset($dbDuration['min'])) {
$this->addUsingAlias(CcShowDaysPeer::END_TIME, $dbEndTime['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbEndTime['max'])) { if (isset($dbDuration['max'])) {
$this->addUsingAlias(CcShowDaysPeer::END_TIME, $dbEndTime['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -295,7 +303,7 @@ abstract class BaseCcShowDaysQuery extends ModelCriteria
$comparison = Criteria::IN; $comparison = Criteria::IN;
} }
} }
return $this->addUsingAlias(CcShowDaysPeer::END_TIME, $dbEndTime, $comparison); return $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration, $comparison);
} }
/** /**
@ -329,6 +337,68 @@ abstract class BaseCcShowDaysQuery extends ModelCriteria
return $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay, $comparison); return $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay, $comparison);
} }
/**
* Filter the query on the repeat_type column
*
* @param int|array $dbRepeatType 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 CcShowDaysQuery The current query, for fluid interface
*/
public function filterByDbRepeatType($dbRepeatType = null, $comparison = null)
{
if (is_array($dbRepeatType)) {
$useMinMax = false;
if (isset($dbRepeatType['min'])) {
$this->addUsingAlias(CcShowDaysPeer::REPEAT_TYPE, $dbRepeatType['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbRepeatType['max'])) {
$this->addUsingAlias(CcShowDaysPeer::REPEAT_TYPE, $dbRepeatType['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowDaysPeer::REPEAT_TYPE, $dbRepeatType, $comparison);
}
/**
* Filter the query on the next_pop_date column
*
* @param string|array $dbNextPopDate 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 CcShowDaysQuery The current query, for fluid interface
*/
public function filterByDbNextPopDate($dbNextPopDate = null, $comparison = null)
{
if (is_array($dbNextPopDate)) {
$useMinMax = false;
if (isset($dbNextPopDate['min'])) {
$this->addUsingAlias(CcShowDaysPeer::NEXT_POP_DATE, $dbNextPopDate['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbNextPopDate['max'])) {
$this->addUsingAlias(CcShowDaysPeer::NEXT_POP_DATE, $dbNextPopDate['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowDaysPeer::NEXT_POP_DATE, $dbNextPopDate, $comparison);
}
/** /**
* Filter the query on the show_id column * Filter the query on the show_id column
* *

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,986 @@
<?php
/**
* Base static class for performing query and update operations on the 'cc_show_instances' table.
*
*
*
* @package propel.generator.airtime.om
*/
abstract class BaseCcShowInstancesPeer {
/** the default database name for this class */
const DATABASE_NAME = 'airtime';
/** the table name for this class */
const TABLE_NAME = 'cc_show_instances';
/** the related Propel class for this table */
const OM_CLASS = 'CcShowInstances';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'airtime.CcShowInstances';
/** the related TableMap class for this table */
const TM_CLASS = 'CcShowInstancesTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 4;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'cc_show_instances.ID';
/** the column name for the STARTS field */
const STARTS = 'cc_show_instances.STARTS';
/** the column name for the ENDS field */
const ENDS = 'cc_show_instances.ENDS';
/** the column name for the SHOW_ID field */
const SHOW_ID = 'cc_show_instances.SHOW_ID';
/**
* An identiy map to hold any loaded instances of CcShowInstances objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
* queries.
* @var array CcShowInstances[]
*/
public static $instances = array();
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbShowId' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
);
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
* @throws PropelException - if the specified name could not be found in the fieldname mappings.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. CcShowInstancesPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(CcShowInstancesPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param Criteria $criteria object containing the columns to add.
* @param string $alias optional table alias
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CcShowInstancesPeer::ID);
$criteria->addSelectColumn(CcShowInstancesPeer::STARTS);
$criteria->addSelectColumn(CcShowInstancesPeer::ENDS);
$criteria->addSelectColumn(CcShowInstancesPeer::SHOW_ID);
} else {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.STARTS');
$criteria->addSelectColumn($alias . '.ENDS');
$criteria->addSelectColumn($alias . '.SHOW_ID');
}
}
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
{
// we may modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcShowInstancesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcShowInstancesPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
$criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
// BasePeer returns a PDOStatement
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param PropelPDO $con
* @return CcShowInstances
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = CcShowInstancesPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, PropelPDO $con = null)
{
return CcShowInstancesPeer::populateObjects(CcShowInstancesPeer::doSelectStmt($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
*
* Use this method directly if you want to work with an executed statement durirectly (for example
* to perform your own object hydration).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param PropelPDO $con The connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return PDOStatement The executed PDOStatement object.
* @see BasePeer::doSelect()
*/
public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
if (!$criteria->hasSelectClause()) {
$criteria = clone $criteria;
CcShowInstancesPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a PDOStatement
return BasePeer::doSelect($criteria, $con);
}
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param CcShowInstances $value A CcShowInstances object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(CcShowInstances $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getDbId();
} // if key === null
self::$instances[$key] = $obj;
}
}
/**
* Removes an object from the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doDelete
* methods in your stub classes -- you may need to explicitly remove objects
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed $value A CcShowInstances object or a primary key value.
*/
public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof CcShowInstances) {
$key = (string) $value->getDbId();
} elseif (is_scalar($value)) {
// assume we've been passed a primary key
$key = (string) $value;
} else {
$e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcShowInstances object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
throw $e;
}
unset(self::$instances[$key]);
}
} // removeInstanceFromPool()
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param string $key The key (@see getPrimaryKeyHash()) for this instance.
* @return CcShowInstances Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
* @see getPrimaryKeyHash()
*/
public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(self::$instances[$key])) {
return self::$instances[$key];
}
}
return null; // just to be explicit
}
/**
* Clear the instance pool.
*
* @return void
*/
public static function clearInstancePool()
{
self::$instances = array();
}
/**
* Method to invalidate the instance pool of all tables related to cc_show_instances
* by a foreign key with ON DELETE CASCADE
*/
public static function clearRelatedInstancePool()
{
// Invalidate objects in CcSchedulePeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcSchedulePeer::clearInstancePool();
}
/**
* Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
*
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, a serialize()d version of the primary key will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return string A string version of PK or NULL if the components of primary key in result array are all null.
*/
public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
{
// If the PK cannot be derived from the row, return NULL.
if ($row[$startcol] === null) {
return null;
}
return (string) $row[$startcol];
}
/**
* Retrieves the primary key from the DB resultset row
* For tables with a single-column primary key, that simple pkey value will be returned. For tables with
* a multi-column primary key, an array of the primary key columns will be returned.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @return mixed The primary key of the row
*/
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (int) $row[$startcol];
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(PDOStatement $stmt)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = CcShowInstancesPeer::getOMClass(false);
// populate the object(s)
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj = CcShowInstancesPeer::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, 0, true); // rehydrate
$results[] = $obj;
} else {
$obj = new $cls();
$obj->hydrate($row);
$results[] = $obj;
CcShowInstancesPeer::addInstanceToPool($obj, $key);
} // if key exists
}
$stmt->closeCursor();
return $results;
}
/**
* Populates an object of the default type or an object that inherit from the default.
*
* @param array $row PropelPDO resultset row.
* @param int $startcol The 0-based offset for reading from the resultset row.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return array (CcShowInstances object, last column rank)
*/
public static function populateObject($row, $startcol = 0)
{
$key = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CcShowInstancesPeer::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj->hydrate($row, $startcol, true); // rehydrate
$col = $startcol + CcShowInstancesPeer::NUM_COLUMNS;
} else {
$cls = CcShowInstancesPeer::OM_CLASS;
$obj = new $cls();
$col = $obj->hydrate($row, $startcol);
CcShowInstancesPeer::addInstanceToPool($obj, $key);
}
return array($obj, $col);
}
/**
* Returns the number of rows matching criteria, joining the related CcShow table
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinCcShow(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcShowInstancesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcShowInstancesPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcShowInstances objects pre-filled with their CcShow objects.
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcShowInstances objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcShowInstancesPeer::addSelectColumns($criteria);
$startcol = (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
CcShowPeer::addSelectColumns($criteria);
$criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcShowInstancesPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcShowInstancesPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcShowInstancesPeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded
$key2 = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) {
$obj2 = CcShowPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcShowPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol);
CcShowPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded
// Add the $obj1 (CcShowInstances) to $obj2 (CcShow)
$obj2->addCcShowInstances($obj1);
} // if joined row was not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the number of rows matching criteria, joining all related tables
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows.
*/
public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// We need to set the primary table name, since in the case that there are no WHERE columns
// it will be impossible for the BasePeer::createSelectSql() method to determine which
// tables go into the FROM clause.
$criteria->setPrimaryTableName(CcShowInstancesPeer::TABLE_NAME);
if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->setDistinct();
}
if (!$criteria->hasSelectClause()) {
CcShowInstancesPeer::addSelectColumns($criteria);
}
$criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con);
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$count = (int) $row[0];
} else {
$count = 0; // no rows returned; we infer that means 0 matches.
}
$stmt->closeCursor();
return $count;
}
/**
* Selects a collection of CcShowInstances objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of CcShowInstances objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
CcShowInstancesPeer::addSelectColumns($criteria);
$startcol2 = (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
CcShowPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = CcShowInstancesPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.propelorm.org/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = CcShowInstancesPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
CcShowInstancesPeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded
// Add objects for joined CcShow rows
$key2 = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = CcShowPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = CcShowPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
CcShowPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded
// Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcShow)
$obj2->addCcShowInstances($obj1);
} // if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* Add a TableMap instance to the database for this peer class.
*/
public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseCcShowInstancesPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCcShowInstancesPeer::TABLE_NAME))
{
$dbMap->addTableObject(new CcShowInstancesTableMap());
}
}
/**
* The class that the Peer will make instances of.
*
* If $withPrefix is true, the returned path
* uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @param boolean $withPrefix Whether or not to return the path with the class name
* @return string path.to.ClassName
*/
public static function getOMClass($withPrefix = true)
{
return $withPrefix ? CcShowInstancesPeer::CLASS_DEFAULT : CcShowInstancesPeer::OM_CLASS;
}
/**
* Method perform an INSERT on the database, given a CcShowInstances or Criteria object.
*
* @param mixed $values Criteria or CcShowInstances object containing data that is used to create the INSERT statement.
* @param PropelPDO $con the PropelPDO connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from CcShowInstances object
}
if ($criteria->containsKey(CcShowInstancesPeer::ID) && $criteria->keyContainsValue(CcShowInstancesPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowInstancesPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->beginTransaction();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch(PropelException $e) {
$con->rollBack();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a CcShowInstances or Criteria object.
*
* @param mixed $values Criteria or CcShowInstances object containing data that is used to create the UPDATE statement.
* @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(CcShowInstancesPeer::ID);
$value = $criteria->remove(CcShowInstancesPeer::ID);
if ($value) {
$selectCriteria->add(CcShowInstancesPeer::ID, $value, $comparison);
} else {
$selectCriteria->setPrimaryTableName(CcShowInstancesPeer::TABLE_NAME);
}
} else { // $values is CcShowInstances object
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the cc_show_instances table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += BasePeer::doDeleteAll(CcShowInstancesPeer::TABLE_NAME, $con, CcShowInstancesPeer::DATABASE_NAME);
// Because this db requires some delete cascade/set null emulation, we have to
// clear the cached instance *after* the emulation has happened (since
// instances get re-added by the select statement contained therein).
CcShowInstancesPeer::clearInstancePool();
CcShowInstancesPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a CcShowInstances or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or CcShowInstances object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param PropelPDO $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
}
if ($values instanceof Criteria) {
// invalidate the cache for all objects of this type, since we have no
// way of knowing (without running a query) what objects should be invalidated
// from the cache based on this Criteria.
CcShowInstancesPeer::clearInstancePool();
// rename for clarity
$criteria = clone $values;
} elseif ($values instanceof CcShowInstances) { // it's a model object
// invalidate the cache for this single object
CcShowInstancesPeer::removeInstanceFromPool($values);
// create criteria based on pk values
$criteria = $values->buildPkeyCriteria();
} else { // it's a primary key, or an array of pks
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(CcShowInstancesPeer::ID, (array) $values, Criteria::IN);
// invalidate the cache for this object(s)
foreach ((array) $values as $singleval) {
CcShowInstancesPeer::removeInstanceFromPool($singleval);
}
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->beginTransaction();
$affectedRows += BasePeer::doDelete($criteria, $con);
CcShowInstancesPeer::clearRelatedInstancePool();
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollBack();
throw $e;
}
}
/**
* Validates all modified columns of given CcShowInstances object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param CcShowInstances $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(CcShowInstances $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(CcShowInstancesPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(CcShowInstancesPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(CcShowInstancesPeer::DATABASE_NAME, CcShowInstancesPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CcShowInstances
*/
public static function retrieveByPK($pk, PropelPDO $con = null)
{
if (null !== ($obj = CcShowInstancesPeer::getInstanceFromPool((string) $pk))) {
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME);
$criteria->add(CcShowInstancesPeer::ID, $pk);
$v = CcShowInstancesPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME);
$criteria->add(CcShowInstancesPeer::ID, $pks, Criteria::IN);
$objs = CcShowInstancesPeer::doSelect($criteria, $con);
}
return $objs;
}
} // BaseCcShowInstancesPeer
// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseCcShowInstancesPeer::buildTableMap();

View File

@ -0,0 +1,406 @@
<?php
/**
* Base class that represents a query for the 'cc_show_instances' table.
*
*
*
* @method CcShowInstancesQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcShowInstancesQuery orderByDbStarts($order = Criteria::ASC) Order by the starts column
* @method CcShowInstancesQuery orderByDbEnds($order = Criteria::ASC) Order by the ends column
* @method CcShowInstancesQuery orderByDbShowId($order = Criteria::ASC) Order by the show_id column
*
* @method CcShowInstancesQuery groupByDbId() Group by the id column
* @method CcShowInstancesQuery groupByDbStarts() Group by the starts column
* @method CcShowInstancesQuery groupByDbEnds() Group by the ends column
* @method CcShowInstancesQuery groupByDbShowId() Group by the show_id column
*
* @method CcShowInstancesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcShowInstancesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcShowInstancesQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method CcShowInstancesQuery leftJoinCcShow($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShow relation
* @method CcShowInstancesQuery rightJoinCcShow($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShow relation
* @method CcShowInstancesQuery innerJoinCcShow($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShow relation
*
* @method CcShowInstancesQuery leftJoinCcSchedule($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcSchedule relation
* @method CcShowInstancesQuery rightJoinCcSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSchedule relation
* @method CcShowInstancesQuery innerJoinCcSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSchedule relation
*
* @method CcShowInstances findOne(PropelPDO $con = null) Return the first CcShowInstances matching the query
* @method CcShowInstances findOneOrCreate(PropelPDO $con = null) Return the first CcShowInstances matching the query, or a new CcShowInstances object populated from the query conditions when no match is found
*
* @method CcShowInstances findOneByDbId(int $id) Return the first CcShowInstances filtered by the id column
* @method CcShowInstances findOneByDbStarts(string $starts) Return the first CcShowInstances filtered by the starts column
* @method CcShowInstances findOneByDbEnds(string $ends) Return the first CcShowInstances filtered by the ends column
* @method CcShowInstances findOneByDbShowId(int $show_id) Return the first CcShowInstances filtered by the show_id column
*
* @method array findByDbId(int $id) Return CcShowInstances objects filtered by the id column
* @method array findByDbStarts(string $starts) Return CcShowInstances objects filtered by the starts column
* @method array findByDbEnds(string $ends) Return CcShowInstances objects filtered by the ends column
* @method array findByDbShowId(int $show_id) Return CcShowInstances objects filtered by the show_id column
*
* @package propel.generator.airtime.om
*/
abstract class BaseCcShowInstancesQuery extends ModelCriteria
{
/**
* Initializes internal state of BaseCcShowInstancesQuery object.
*
* @param string $dbName The dabase name
* @param string $modelName The phpName of a model, e.g. 'Book'
* @param string $modelAlias The alias for the model in this query, e.g. 'b'
*/
public function __construct($dbName = 'airtime', $modelName = 'CcShowInstances', $modelAlias = null)
{
parent::__construct($dbName, $modelName, $modelAlias);
}
/**
* Returns a new CcShowInstancesQuery object.
*
* @param string $modelAlias The alias of a model in the query
* @param Criteria $criteria Optional Criteria to build the query from
*
* @return CcShowInstancesQuery
*/
public static function create($modelAlias = null, $criteria = null)
{
if ($criteria instanceof CcShowInstancesQuery) {
return $criteria;
}
$query = new CcShowInstancesQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key
* Use instance pooling to avoid a database query if the object exists
* <code>
* $obj = $c->findPk(12, $con);
* </code>
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con an optional connection object
*
* @return CcShowInstances|array|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ((null !== ($obj = CcShowInstancesPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
// the object is alredy in the instance pool
return $obj;
} else {
// the object has not been requested yet, or the formatter is not an object formatter
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filterByPrimaryKey($key)
->getSelectStatement($con);
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
}
}
/**
* Find objects by primary key
* <code>
* $objs = $c->findPks(array(12, 56, 832), $con);
* </code>
* @param array $keys Primary keys to use for the query
* @param PropelPDO $con an optional connection object
*
* @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
$criteria = $this->isKeepQuery() ? clone $this : $this;
return $this
->filterByPrimaryKeys($keys)
->find($con);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(CcShowInstancesPeer::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(CcShowInstancesPeer::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* @param int|array $dbId 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 CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbId($dbId = null, $comparison = null)
{
if (is_array($dbId) && null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(CcShowInstancesPeer::ID, $dbId, $comparison);
}
/**
* Filter the query on the starts column
*
* @param string|array $dbStarts 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 CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbStarts($dbStarts = null, $comparison = null)
{
if (is_array($dbStarts)) {
$useMinMax = false;
if (isset($dbStarts['min'])) {
$this->addUsingAlias(CcShowInstancesPeer::STARTS, $dbStarts['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbStarts['max'])) {
$this->addUsingAlias(CcShowInstancesPeer::STARTS, $dbStarts['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowInstancesPeer::STARTS, $dbStarts, $comparison);
}
/**
* Filter the query on the ends column
*
* @param string|array $dbEnds 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 CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbEnds($dbEnds = null, $comparison = null)
{
if (is_array($dbEnds)) {
$useMinMax = false;
if (isset($dbEnds['min'])) {
$this->addUsingAlias(CcShowInstancesPeer::ENDS, $dbEnds['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbEnds['max'])) {
$this->addUsingAlias(CcShowInstancesPeer::ENDS, $dbEnds['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowInstancesPeer::ENDS, $dbEnds, $comparison);
}
/**
* Filter the query on the show_id column
*
* @param int|array $dbShowId 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 CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByDbShowId($dbShowId = null, $comparison = null)
{
if (is_array($dbShowId)) {
$useMinMax = false;
if (isset($dbShowId['min'])) {
$this->addUsingAlias(CcShowInstancesPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbShowId['max'])) {
$this->addUsingAlias(CcShowInstancesPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowInstancesPeer::SHOW_ID, $dbShowId, $comparison);
}
/**
* Filter the query by a related CcShow object
*
* @param CcShow $ccShow the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByCcShow($ccShow, $comparison = null)
{
return $this
->addUsingAlias(CcShowInstancesPeer::SHOW_ID, $ccShow->getDbId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcShow relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function joinCcShow($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcShow');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcShow');
}
return $this;
}
/**
* Use the CcShow relation CcShow object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowQuery A secondary query class using the current class as primary query
*/
public function useCcShowQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCcShow($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcShow', 'CcShowQuery');
}
/**
* Filter the query by a related CcSchedule object
*
* @param CcSchedule $ccSchedule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function filterByCcSchedule($ccSchedule, $comparison = null)
{
return $this
->addUsingAlias(CcShowInstancesPeer::ID, $ccSchedule->getDbInstanceId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcSchedule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function joinCcSchedule($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcSchedule');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcSchedule');
}
return $this;
}
/**
* Use the CcSchedule relation CcSchedule object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcScheduleQuery A secondary query class using the current class as primary query
*/
public function useCcScheduleQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCcSchedule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcSchedule', 'CcScheduleQuery');
}
/**
* Exclude object from result
*
* @param CcShowInstances $ccShowInstances Object to remove from the list of results
*
* @return CcShowInstancesQuery The current query, for fluid interface
*/
public function prune($ccShowInstances = null)
{
if ($ccShowInstances) {
$this->addUsingAlias(CcShowInstancesPeer::ID, $ccShowInstances->getDbId(), Criteria::NOT_EQUAL);
}
return $this;
}
} // BaseCcShowInstancesQuery

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowPeer {
const TM_CLASS = 'CcShowTableMap'; const TM_CLASS = 'CcShowTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 6; const NUM_COLUMNS = 5;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -37,9 +37,6 @@ abstract class BaseCcShowPeer {
/** the column name for the NAME field */ /** the column name for the NAME field */
const NAME = 'cc_show.NAME'; const NAME = 'cc_show.NAME';
/** the column name for the REPEATS field */
const REPEATS = 'cc_show.REPEATS';
/** the column name for the DESCRIPTION field */ /** the column name for the DESCRIPTION field */
const DESCRIPTION = 'cc_show.DESCRIPTION'; const DESCRIPTION = 'cc_show.DESCRIPTION';
@ -65,12 +62,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbRepeats', 'DbDescription', 'DbColor', 'DbBackgroundColor', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbDescription', 'DbColor', 'DbBackgroundColor', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbRepeats', 'dbDescription', 'dbColor', 'dbBackgroundColor', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbDescription', 'dbColor', 'dbBackgroundColor', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::REPEATS, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ), BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'REPEATS', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'repeats', 'description', 'color', 'background_color', ), BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'description', 'color', 'background_color', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
); );
/** /**
@ -80,12 +77,12 @@ abstract class BaseCcShowPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbRepeats' => 2, 'DbDescription' => 3, 'DbColor' => 4, 'DbBackgroundColor' => 5, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbDescription' => 2, 'DbColor' => 3, 'DbBackgroundColor' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbRepeats' => 2, 'dbDescription' => 3, 'dbColor' => 4, 'dbBackgroundColor' => 5, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbDescription' => 2, 'dbColor' => 3, 'dbBackgroundColor' => 4, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::REPEATS => 2, self::DESCRIPTION => 3, self::COLOR => 4, self::BACKGROUND_COLOR => 5, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::DESCRIPTION => 2, self::COLOR => 3, self::BACKGROUND_COLOR => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'REPEATS' => 2, 'DESCRIPTION' => 3, 'COLOR' => 4, 'BACKGROUND_COLOR' => 5, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'DESCRIPTION' => 2, 'COLOR' => 3, 'BACKGROUND_COLOR' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'repeats' => 2, 'description' => 3, 'color' => 4, 'background_color' => 5, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'description' => 2, 'color' => 3, 'background_color' => 4, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
); );
/** /**
@ -159,14 +156,12 @@ abstract class BaseCcShowPeer {
if (null === $alias) { if (null === $alias) {
$criteria->addSelectColumn(CcShowPeer::ID); $criteria->addSelectColumn(CcShowPeer::ID);
$criteria->addSelectColumn(CcShowPeer::NAME); $criteria->addSelectColumn(CcShowPeer::NAME);
$criteria->addSelectColumn(CcShowPeer::REPEATS);
$criteria->addSelectColumn(CcShowPeer::DESCRIPTION); $criteria->addSelectColumn(CcShowPeer::DESCRIPTION);
$criteria->addSelectColumn(CcShowPeer::COLOR); $criteria->addSelectColumn(CcShowPeer::COLOR);
$criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR); $criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME'); $criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.REPEATS');
$criteria->addSelectColumn($alias . '.DESCRIPTION'); $criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.COLOR'); $criteria->addSelectColumn($alias . '.COLOR');
$criteria->addSelectColumn($alias . '.BACKGROUND_COLOR'); $criteria->addSelectColumn($alias . '.BACKGROUND_COLOR');
@ -363,15 +358,15 @@ abstract class BaseCcShowPeer {
*/ */
public static function clearRelatedInstancePool() public static function clearRelatedInstancePool()
{ {
// Invalidate objects in CcShowInstancesPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcShowInstancesPeer::clearInstancePool();
// Invalidate objects in CcShowDaysPeer instance pool, // Invalidate objects in CcShowDaysPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcShowDaysPeer::clearInstancePool(); CcShowDaysPeer::clearInstancePool();
// Invalidate objects in CcShowHostsPeer instance pool, // Invalidate objects in CcShowHostsPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcShowHostsPeer::clearInstancePool(); CcShowHostsPeer::clearInstancePool();
// Invalidate objects in CcShowSchedulePeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcShowSchedulePeer::clearInstancePool();
} }
/** /**

View File

@ -8,14 +8,12 @@
* *
* @method CcShowQuery orderByDbId($order = Criteria::ASC) Order by the id column * @method CcShowQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcShowQuery orderByDbName($order = Criteria::ASC) Order by the name column * @method CcShowQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CcShowQuery orderByDbRepeats($order = Criteria::ASC) Order by the repeats column
* @method CcShowQuery orderByDbDescription($order = Criteria::ASC) Order by the description column * @method CcShowQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method CcShowQuery orderByDbColor($order = Criteria::ASC) Order by the color column * @method CcShowQuery orderByDbColor($order = Criteria::ASC) Order by the color column
* @method CcShowQuery orderByDbBackgroundColor($order = Criteria::ASC) Order by the background_color column * @method CcShowQuery orderByDbBackgroundColor($order = Criteria::ASC) Order by the background_color column
* *
* @method CcShowQuery groupByDbId() Group by the id column * @method CcShowQuery groupByDbId() Group by the id column
* @method CcShowQuery groupByDbName() Group by the name column * @method CcShowQuery groupByDbName() Group by the name column
* @method CcShowQuery groupByDbRepeats() Group by the repeats column
* @method CcShowQuery groupByDbDescription() Group by the description column * @method CcShowQuery groupByDbDescription() Group by the description column
* @method CcShowQuery groupByDbColor() Group by the color column * @method CcShowQuery groupByDbColor() Group by the color column
* @method CcShowQuery groupByDbBackgroundColor() Group by the background_color column * @method CcShowQuery groupByDbBackgroundColor() Group by the background_color column
@ -24,6 +22,10 @@
* @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcShowQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcShowQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method CcShowQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method CcShowQuery leftJoinCcShowInstances($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowInstances relation
* @method CcShowQuery rightJoinCcShowInstances($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowInstances relation
* @method CcShowQuery innerJoinCcShowInstances($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowInstances relation
*
* @method CcShowQuery leftJoinCcShowDays($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowDays relation * @method CcShowQuery leftJoinCcShowDays($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowDays relation
* @method CcShowQuery rightJoinCcShowDays($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowDays relation * @method CcShowQuery rightJoinCcShowDays($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowDays relation
* @method CcShowQuery innerJoinCcShowDays($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowDays relation * @method CcShowQuery innerJoinCcShowDays($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowDays relation
@ -32,23 +34,17 @@
* @method CcShowQuery rightJoinCcShowHosts($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowHosts relation * @method CcShowQuery rightJoinCcShowHosts($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowHosts relation
* @method CcShowQuery innerJoinCcShowHosts($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowHosts relation * @method CcShowQuery innerJoinCcShowHosts($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowHosts relation
* *
* @method CcShowQuery leftJoinCcShowSchedule($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowSchedule relation
* @method CcShowQuery rightJoinCcShowSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowSchedule relation
* @method CcShowQuery innerJoinCcShowSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowSchedule relation
*
* @method CcShow findOne(PropelPDO $con = null) Return the first CcShow matching the query * @method CcShow findOne(PropelPDO $con = null) Return the first CcShow matching the query
* @method CcShow findOneOrCreate(PropelPDO $con = null) Return the first CcShow matching the query, or a new CcShow object populated from the query conditions when no match is found * @method CcShow findOneOrCreate(PropelPDO $con = null) Return the first CcShow matching the query, or a new CcShow object populated from the query conditions when no match is found
* *
* @method CcShow findOneByDbId(int $id) Return the first CcShow filtered by the id column * @method CcShow findOneByDbId(int $id) Return the first CcShow filtered by the id column
* @method CcShow findOneByDbName(string $name) Return the first CcShow filtered by the name column * @method CcShow findOneByDbName(string $name) Return the first CcShow filtered by the name column
* @method CcShow findOneByDbRepeats(int $repeats) Return the first CcShow filtered by the repeats column
* @method CcShow findOneByDbDescription(string $description) Return the first CcShow filtered by the description column * @method CcShow findOneByDbDescription(string $description) Return the first CcShow filtered by the description column
* @method CcShow findOneByDbColor(string $color) Return the first CcShow filtered by the color column * @method CcShow findOneByDbColor(string $color) Return the first CcShow filtered by the color column
* @method CcShow findOneByDbBackgroundColor(string $background_color) Return the first CcShow filtered by the background_color column * @method CcShow findOneByDbBackgroundColor(string $background_color) Return the first CcShow filtered by the background_color column
* *
* @method array findByDbId(int $id) Return CcShow objects filtered by the id 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 * @method array findByDbName(string $name) Return CcShow objects filtered by the name column
* @method array findByDbRepeats(int $repeats) Return CcShow objects filtered by the repeats column
* @method array findByDbDescription(string $description) Return CcShow objects filtered by the description column * @method array findByDbDescription(string $description) Return CcShow objects filtered by the description column
* @method array findByDbColor(string $color) Return CcShow objects filtered by the color column * @method array findByDbColor(string $color) Return CcShow objects filtered by the color column
* @method array findByDbBackgroundColor(string $background_color) Return CcShow objects filtered by the background_color column * @method array findByDbBackgroundColor(string $background_color) Return CcShow objects filtered by the background_color column
@ -200,37 +196,6 @@ abstract class BaseCcShowQuery extends ModelCriteria
return $this->addUsingAlias(CcShowPeer::NAME, $dbName, $comparison); return $this->addUsingAlias(CcShowPeer::NAME, $dbName, $comparison);
} }
/**
* Filter the query on the repeats column
*
* @param int|array $dbRepeats 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 CcShowQuery The current query, for fluid interface
*/
public function filterByDbRepeats($dbRepeats = null, $comparison = null)
{
if (is_array($dbRepeats)) {
$useMinMax = false;
if (isset($dbRepeats['min'])) {
$this->addUsingAlias(CcShowPeer::REPEATS, $dbRepeats['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbRepeats['max'])) {
$this->addUsingAlias(CcShowPeer::REPEATS, $dbRepeats['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowPeer::REPEATS, $dbRepeats, $comparison);
}
/** /**
* Filter the query on the description column * Filter the query on the description column
* *
@ -297,6 +262,70 @@ abstract class BaseCcShowQuery extends ModelCriteria
return $this->addUsingAlias(CcShowPeer::BACKGROUND_COLOR, $dbBackgroundColor, $comparison); return $this->addUsingAlias(CcShowPeer::BACKGROUND_COLOR, $dbBackgroundColor, $comparison);
} }
/**
* Filter the query by a related CcShowInstances object
*
* @param CcShowInstances $ccShowInstances the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByCcShowInstances($ccShowInstances, $comparison = null)
{
return $this
->addUsingAlias(CcShowPeer::ID, $ccShowInstances->getDbShowId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcShowInstances relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowQuery The current query, for fluid interface
*/
public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcShowInstances');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcShowInstances');
}
return $this;
}
/**
* Use the CcShowInstances relation CcShowInstances object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowInstancesQuery A secondary query class using the current class as primary query
*/
public function useCcShowInstancesQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCcShowInstances($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery');
}
/** /**
* Filter the query by a related CcShowDays object * Filter the query by a related CcShowDays object
* *
@ -425,70 +454,6 @@ abstract class BaseCcShowQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery'); ->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery');
} }
/**
* Filter the query by a related CcShowSchedule object
*
* @param CcShowSchedule $ccShowSchedule the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcShowQuery The current query, for fluid interface
*/
public function filterByCcShowSchedule($ccShowSchedule, $comparison = null)
{
return $this
->addUsingAlias(CcShowPeer::ID, $ccShowSchedule->getDbShowId(), $comparison);
}
/**
* Adds a JOIN clause to the query using the CcShowSchedule relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowQuery The current query, for fluid interface
*/
public function joinCcShowSchedule($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcShowSchedule');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CcShowSchedule');
}
return $this;
}
/**
* Use the CcShowSchedule relation CcShowSchedule object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return CcShowScheduleQuery A secondary query class using the current class as primary query
*/
public function useCcShowScheduleQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCcShowSchedule($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcShowSchedule', 'CcShowScheduleQuery');
}
/** /**
* Exclude object from result * Exclude object from result
* *

View File

@ -31,16 +31,10 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
protected $id; protected $id;
/** /**
* The value for the show_id field. * The value for the instance_id field.
* @var int * @var int
*/ */
protected $show_id; protected $instance_id;
/**
* The value for the show_day field.
* @var string
*/
protected $show_day;
/** /**
* The value for the position field. * The value for the position field.
@ -55,9 +49,9 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
protected $group_id; protected $group_id;
/** /**
* @var CcShow * @var CcShowInstances
*/ */
protected $aCcShow; protected $aCcShowInstances;
/** /**
* Flag to prevent endless save loop, if this object is referenced * Flag to prevent endless save loop, if this object is referenced
@ -84,46 +78,13 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
} }
/** /**
* Get the [show_id] column value. * Get the [instance_id] column value.
* *
* @return int * @return int
*/ */
public function getDbShowId() public function getDbInstanceId()
{ {
return $this->show_id; return $this->instance_id;
}
/**
* Get the [optionally formatted] temporal [show_day] column value.
*
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the raw DateTime object will be returned.
* @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
* @throws PropelException - if unable to parse/validate the date/time value.
*/
public function getDbShowDay($format = '%x')
{
if ($this->show_day === null) {
return null;
}
try {
$dt = new DateTime($this->show_day);
} catch (Exception $x) {
throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->show_day, true), $x);
}
if ($format === null) {
// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
return $dt;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $dt->format('U'));
} else {
return $dt->format($format);
}
} }
/** /**
@ -167,77 +128,28 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
} // setDbId() } // setDbId()
/** /**
* Set the value of [show_id] column. * Set the value of [instance_id] column.
* *
* @param int $v new value * @param int $v new value
* @return CcShowSchedule The current object (for fluent API support) * @return CcShowSchedule The current object (for fluent API support)
*/ */
public function setDbShowId($v) public function setDbInstanceId($v)
{ {
if ($v !== null) { if ($v !== null) {
$v = (int) $v; $v = (int) $v;
} }
if ($this->show_id !== $v) { if ($this->instance_id !== $v) {
$this->show_id = $v; $this->instance_id = $v;
$this->modifiedColumns[] = CcShowSchedulePeer::SHOW_ID; $this->modifiedColumns[] = CcShowSchedulePeer::INSTANCE_ID;
} }
if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) {
$this->aCcShow = null; $this->aCcShowInstances = null;
} }
return $this; return $this;
} // setDbShowId() } // setDbInstanceId()
/**
* Sets the value of [show_day] column to a normalized version of the date/time value specified.
*
* @param mixed $v string, integer (timestamp), or DateTime value. Empty string will
* be treated as NULL for temporal objects.
* @return CcShowSchedule The current object (for fluent API support)
*/
public function setDbShowDay($v)
{
// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
// -- which is unexpected, to say the least.
if ($v === null || $v === '') {
$dt = null;
} elseif ($v instanceof DateTime) {
$dt = $v;
} else {
// some string/numeric value passed; we normalize that so that we can
// validate it.
try {
if (is_numeric($v)) { // if it's a unix timestamp
$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
// We have to explicitly specify and then change the time zone because of a
// DateTime bug: http://bugs.php.net/bug.php?id=43003
$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
} else {
$dt = new DateTime($v);
}
} catch (Exception $x) {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
if ( $this->show_day !== null || $dt !== null ) {
// (nested ifs are a little easier to read in this case)
$currNorm = ($this->show_day !== null && $tmpDt = new DateTime($this->show_day)) ? $tmpDt->format('Y-m-d') : null;
$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;
if ( ($currNorm !== $newNorm) // normalized values don't match
)
{
$this->show_day = ($dt ? $dt->format('Y-m-d') : null);
$this->modifiedColumns[] = CcShowSchedulePeer::SHOW_DAY;
}
} // if either are not null
return $this;
} // setDbShowDay()
/** /**
* Set the value of [position] column. * Set the value of [position] column.
@ -312,10 +224,9 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
try { try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->show_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; $this->instance_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->show_day = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; $this->position = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->position = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; $this->group_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
$this->group_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -324,7 +235,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 5; // 5 = CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 4; // 4 = CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcShowSchedule object", $e); throw new PropelException("Error populating CcShowSchedule object", $e);
@ -347,8 +258,8 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
public function ensureConsistency() public function ensureConsistency()
{ {
if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) {
$this->aCcShow = null; $this->aCcShowInstances = null;
} }
} // ensureConsistency } // ensureConsistency
@ -389,7 +300,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
if ($deep) { // also de-associate any related objects? if ($deep) { // also de-associate any related objects?
$this->aCcShow = null; $this->aCcShowInstances = null;
} // if (deep) } // if (deep)
} }
@ -505,11 +416,11 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
// method. This object relates to these object(s) by a // method. This object relates to these object(s) by a
// foreign key reference. // foreign key reference.
if ($this->aCcShow !== null) { if ($this->aCcShowInstances !== null) {
if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { if ($this->aCcShowInstances->isModified() || $this->aCcShowInstances->isNew()) {
$affectedRows += $this->aCcShow->save($con); $affectedRows += $this->aCcShowInstances->save($con);
} }
$this->setCcShow($this->aCcShow); $this->setCcShowInstances($this->aCcShowInstances);
} }
if ($this->isNew() ) { if ($this->isNew() ) {
@ -606,9 +517,9 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
// method. This object relates to these object(s) by a // method. This object relates to these object(s) by a
// foreign key reference. // foreign key reference.
if ($this->aCcShow !== null) { if ($this->aCcShowInstances !== null) {
if (!$this->aCcShow->validate($columns)) { if (!$this->aCcShowInstances->validate($columns)) {
$failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); $failureMap = array_merge($failureMap, $this->aCcShowInstances->getValidationFailures());
} }
} }
@ -655,15 +566,12 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
return $this->getDbId(); return $this->getDbId();
break; break;
case 1: case 1:
return $this->getDbShowId(); return $this->getDbInstanceId();
break; break;
case 2: case 2:
return $this->getDbShowDay();
break;
case 3:
return $this->getDbPosition(); return $this->getDbPosition();
break; break;
case 4: case 3:
return $this->getDbGroupId(); return $this->getDbGroupId();
break; break;
default: default:
@ -691,14 +599,13 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
$keys = CcShowSchedulePeer::getFieldNames($keyType); $keys = CcShowSchedulePeer::getFieldNames($keyType);
$result = array( $result = array(
$keys[0] => $this->getDbId(), $keys[0] => $this->getDbId(),
$keys[1] => $this->getDbShowId(), $keys[1] => $this->getDbInstanceId(),
$keys[2] => $this->getDbShowDay(), $keys[2] => $this->getDbPosition(),
$keys[3] => $this->getDbPosition(), $keys[3] => $this->getDbGroupId(),
$keys[4] => $this->getDbGroupId(),
); );
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->aCcShow) { if (null !== $this->aCcShowInstances) {
$result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true);
} }
} }
return $result; return $result;
@ -735,15 +642,12 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
$this->setDbId($value); $this->setDbId($value);
break; break;
case 1: case 1:
$this->setDbShowId($value); $this->setDbInstanceId($value);
break; break;
case 2: case 2:
$this->setDbShowDay($value);
break;
case 3:
$this->setDbPosition($value); $this->setDbPosition($value);
break; break;
case 4: case 3:
$this->setDbGroupId($value); $this->setDbGroupId($value);
break; break;
} // switch() } // switch()
@ -771,10 +675,9 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
$keys = CcShowSchedulePeer::getFieldNames($keyType); $keys = CcShowSchedulePeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbShowId($arr[$keys[1]]); if (array_key_exists($keys[1], $arr)) $this->setDbInstanceId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbShowDay($arr[$keys[2]]); if (array_key_exists($keys[2], $arr)) $this->setDbPosition($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbPosition($arr[$keys[3]]); if (array_key_exists($keys[3], $arr)) $this->setDbGroupId($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbGroupId($arr[$keys[4]]);
} }
/** /**
@ -787,8 +690,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
$criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME);
if ($this->isColumnModified(CcShowSchedulePeer::ID)) $criteria->add(CcShowSchedulePeer::ID, $this->id); if ($this->isColumnModified(CcShowSchedulePeer::ID)) $criteria->add(CcShowSchedulePeer::ID, $this->id);
if ($this->isColumnModified(CcShowSchedulePeer::SHOW_ID)) $criteria->add(CcShowSchedulePeer::SHOW_ID, $this->show_id); if ($this->isColumnModified(CcShowSchedulePeer::INSTANCE_ID)) $criteria->add(CcShowSchedulePeer::INSTANCE_ID, $this->instance_id);
if ($this->isColumnModified(CcShowSchedulePeer::SHOW_DAY)) $criteria->add(CcShowSchedulePeer::SHOW_DAY, $this->show_day);
if ($this->isColumnModified(CcShowSchedulePeer::POSITION)) $criteria->add(CcShowSchedulePeer::POSITION, $this->position); if ($this->isColumnModified(CcShowSchedulePeer::POSITION)) $criteria->add(CcShowSchedulePeer::POSITION, $this->position);
if ($this->isColumnModified(CcShowSchedulePeer::GROUP_ID)) $criteria->add(CcShowSchedulePeer::GROUP_ID, $this->group_id); if ($this->isColumnModified(CcShowSchedulePeer::GROUP_ID)) $criteria->add(CcShowSchedulePeer::GROUP_ID, $this->group_id);
@ -852,8 +754,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
*/ */
public function copyInto($copyObj, $deepCopy = false) public function copyInto($copyObj, $deepCopy = false)
{ {
$copyObj->setDbShowId($this->show_id); $copyObj->setDbInstanceId($this->instance_id);
$copyObj->setDbShowDay($this->show_day);
$copyObj->setDbPosition($this->position); $copyObj->setDbPosition($this->position);
$copyObj->setDbGroupId($this->group_id); $copyObj->setDbGroupId($this->group_id);
@ -900,24 +801,24 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
} }
/** /**
* Declares an association between this object and a CcShow object. * Declares an association between this object and a CcShowInstances object.
* *
* @param CcShow $v * @param CcShowInstances $v
* @return CcShowSchedule The current object (for fluent API support) * @return CcShowSchedule The current object (for fluent API support)
* @throws PropelException * @throws PropelException
*/ */
public function setCcShow(CcShow $v = null) public function setCcShowInstances(CcShowInstances $v = null)
{ {
if ($v === null) { if ($v === null) {
$this->setDbShowId(NULL); $this->setDbInstanceId(NULL);
} else { } else {
$this->setDbShowId($v->getDbId()); $this->setDbInstanceId($v->getDbId());
} }
$this->aCcShow = $v; $this->aCcShowInstances = $v;
// Add binding for other direction of this n:n relationship. // Add binding for other direction of this n:n relationship.
// If this object has already been added to the CcShow object, it will not be re-added. // If this object has already been added to the CcShowInstances object, it will not be re-added.
if ($v !== null) { if ($v !== null) {
$v->addCcShowSchedule($this); $v->addCcShowSchedule($this);
} }
@ -927,25 +828,25 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
/** /**
* Get the associated CcShow object * Get the associated CcShowInstances object
* *
* @param PropelPDO Optional Connection object. * @param PropelPDO Optional Connection object.
* @return CcShow The associated CcShow object. * @return CcShowInstances The associated CcShowInstances object.
* @throws PropelException * @throws PropelException
*/ */
public function getCcShow(PropelPDO $con = null) public function getCcShowInstances(PropelPDO $con = null)
{ {
if ($this->aCcShow === null && ($this->show_id !== null)) { if ($this->aCcShowInstances === null && ($this->instance_id !== null)) {
$this->aCcShow = CcShowQuery::create()->findPk($this->show_id, $con); $this->aCcShowInstances = CcShowInstancesQuery::create()->findPk($this->instance_id, $con);
/* The following can be used additionally to /* The following can be used additionally to
guarantee the related object contains a reference guarantee the related object contains a reference
to this object. This level of coupling may, however, be to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection undesirable since it could result in an only partially populated collection
in the referenced object. in the referenced object.
$this->aCcShow->addCcShowSchedules($this); $this->aCcShowInstances->addCcShowSchedules($this);
*/ */
} }
return $this->aCcShow; return $this->aCcShowInstances;
} }
/** /**
@ -954,8 +855,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
public function clear() public function clear()
{ {
$this->id = null; $this->id = null;
$this->show_id = null; $this->instance_id = null;
$this->show_day = null;
$this->position = null; $this->position = null;
$this->group_id = null; $this->group_id = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
@ -980,7 +880,7 @@ abstract class BaseCcShowSchedule extends BaseObject implements Persistent
if ($deep) { if ($deep) {
} // if ($deep) } // if ($deep)
$this->aCcShow = null; $this->aCcShowInstances = null;
} }
/** /**

View File

@ -26,7 +26,7 @@ abstract class BaseCcShowSchedulePeer {
const TM_CLASS = 'CcShowScheduleTableMap'; const TM_CLASS = 'CcShowScheduleTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 5; const NUM_COLUMNS = 4;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -34,11 +34,8 @@ abstract class BaseCcShowSchedulePeer {
/** the column name for the ID field */ /** the column name for the ID field */
const ID = 'cc_show_schedule.ID'; const ID = 'cc_show_schedule.ID';
/** the column name for the SHOW_ID field */ /** the column name for the INSTANCE_ID field */
const SHOW_ID = 'cc_show_schedule.SHOW_ID'; const INSTANCE_ID = 'cc_show_schedule.INSTANCE_ID';
/** the column name for the SHOW_DAY field */
const SHOW_DAY = 'cc_show_schedule.SHOW_DAY';
/** the column name for the POSITION field */ /** the column name for the POSITION field */
const POSITION = 'cc_show_schedule.POSITION'; const POSITION = 'cc_show_schedule.POSITION';
@ -62,12 +59,12 @@ abstract class BaseCcShowSchedulePeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbShowId', 'DbShowDay', 'DbPosition', 'DbGroupId', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbInstanceId', 'DbPosition', 'DbGroupId', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbShowDay', 'dbPosition', 'dbGroupId', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbInstanceId', 'dbPosition', 'dbGroupId', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::SHOW_DAY, self::POSITION, self::GROUP_ID, ), BasePeer::TYPE_COLNAME => array (self::ID, self::INSTANCE_ID, self::POSITION, self::GROUP_ID, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'SHOW_DAY', 'POSITION', 'GROUP_ID', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'INSTANCE_ID', 'POSITION', 'GROUP_ID', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'show_day', 'position', 'group_id', ), BasePeer::TYPE_FIELDNAME => array ('id', 'instance_id', 'position', 'group_id', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
); );
/** /**
@ -77,12 +74,12 @@ abstract class BaseCcShowSchedulePeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbShowId' => 1, 'DbShowDay' => 2, 'DbPosition' => 3, 'DbGroupId' => 4, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbInstanceId' => 1, 'DbPosition' => 2, 'DbGroupId' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbShowDay' => 2, 'dbPosition' => 3, 'dbGroupId' => 4, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbInstanceId' => 1, 'dbPosition' => 2, 'dbGroupId' => 3, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::SHOW_DAY => 2, self::POSITION => 3, self::GROUP_ID => 4, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::INSTANCE_ID => 1, self::POSITION => 2, self::GROUP_ID => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'SHOW_DAY' => 2, 'POSITION' => 3, 'GROUP_ID' => 4, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'INSTANCE_ID' => 1, 'POSITION' => 2, 'GROUP_ID' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'show_day' => 2, 'position' => 3, 'group_id' => 4, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'instance_id' => 1, 'position' => 2, 'group_id' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
); );
/** /**
@ -155,14 +152,12 @@ abstract class BaseCcShowSchedulePeer {
{ {
if (null === $alias) { if (null === $alias) {
$criteria->addSelectColumn(CcShowSchedulePeer::ID); $criteria->addSelectColumn(CcShowSchedulePeer::ID);
$criteria->addSelectColumn(CcShowSchedulePeer::SHOW_ID); $criteria->addSelectColumn(CcShowSchedulePeer::INSTANCE_ID);
$criteria->addSelectColumn(CcShowSchedulePeer::SHOW_DAY);
$criteria->addSelectColumn(CcShowSchedulePeer::POSITION); $criteria->addSelectColumn(CcShowSchedulePeer::POSITION);
$criteria->addSelectColumn(CcShowSchedulePeer::GROUP_ID); $criteria->addSelectColumn(CcShowSchedulePeer::GROUP_ID);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.SHOW_ID'); $criteria->addSelectColumn($alias . '.INSTANCE_ID');
$criteria->addSelectColumn($alias . '.SHOW_DAY');
$criteria->addSelectColumn($alias . '.POSITION'); $criteria->addSelectColumn($alias . '.POSITION');
$criteria->addSelectColumn($alias . '.GROUP_ID'); $criteria->addSelectColumn($alias . '.GROUP_ID');
} }
@ -451,7 +446,7 @@ abstract class BaseCcShowSchedulePeer {
} }
/** /**
* Returns the number of rows matching criteria, joining the related CcShow table * Returns the number of rows matching criteria, joining the related CcShowInstances table
* *
* @param Criteria $criteria * @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead. * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
@ -459,7 +454,7 @@ abstract class BaseCcShowSchedulePeer {
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return int Number of matching rows. * @return int Number of matching rows.
*/ */
public static function doCountJoinCcShow(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN) public static function doCountJoinCcShowInstances(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
{ {
// we're going to modify criteria, so copy it first // we're going to modify criteria, so copy it first
$criteria = clone $criteria; $criteria = clone $criteria;
@ -486,7 +481,7 @@ abstract class BaseCcShowSchedulePeer {
$con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
} }
$criteria->addJoin(CcShowSchedulePeer::SHOW_ID, CcShowPeer::ID, $join_behavior); $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con); $stmt = BasePeer::doCount($criteria, $con);
@ -501,7 +496,7 @@ abstract class BaseCcShowSchedulePeer {
/** /**
* Selects a collection of CcShowSchedule objects pre-filled with their CcShow objects. * Selects a collection of CcShowSchedule objects pre-filled with their CcShowInstances objects.
* @param Criteria $criteria * @param Criteria $criteria
* @param PropelPDO $con * @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
@ -509,7 +504,7 @@ abstract class BaseCcShowSchedulePeer {
* @throws PropelException Any exceptions caught during processing will be * @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException. * rethrown wrapped into a PropelException.
*/ */
public static function doSelectJoinCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) public static function doSelectJoinCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{ {
$criteria = clone $criteria; $criteria = clone $criteria;
@ -520,9 +515,9 @@ abstract class BaseCcShowSchedulePeer {
CcShowSchedulePeer::addSelectColumns($criteria); CcShowSchedulePeer::addSelectColumns($criteria);
$startcol = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); $startcol = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
CcShowPeer::addSelectColumns($criteria); CcShowInstancesPeer::addSelectColumns($criteria);
$criteria->addJoin(CcShowSchedulePeer::SHOW_ID, CcShowPeer::ID, $join_behavior); $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con); $stmt = BasePeer::doSelect($criteria, $con);
$results = array(); $results = array();
@ -542,19 +537,19 @@ abstract class BaseCcShowSchedulePeer {
CcShowSchedulePeer::addInstanceToPool($obj1, $key1); CcShowSchedulePeer::addInstanceToPool($obj1, $key1);
} // if $obj1 already loaded } // if $obj1 already loaded
$key2 = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol); $key2 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol);
if ($key2 !== null) { if ($key2 !== null) {
$obj2 = CcShowPeer::getInstanceFromPool($key2); $obj2 = CcShowInstancesPeer::getInstanceFromPool($key2);
if (!$obj2) { if (!$obj2) {
$cls = CcShowPeer::getOMClass(false); $cls = CcShowInstancesPeer::getOMClass(false);
$obj2 = new $cls(); $obj2 = new $cls();
$obj2->hydrate($row, $startcol); $obj2->hydrate($row, $startcol);
CcShowPeer::addInstanceToPool($obj2, $key2); CcShowInstancesPeer::addInstanceToPool($obj2, $key2);
} // if obj2 already loaded } // if obj2 already loaded
// Add the $obj1 (CcShowSchedule) to $obj2 (CcShow) // Add the $obj1 (CcShowSchedule) to $obj2 (CcShowInstances)
$obj2->addCcShowSchedule($obj1); $obj2->addCcShowSchedule($obj1);
} // if joined row was not null } // if joined row was not null
@ -602,7 +597,7 @@ abstract class BaseCcShowSchedulePeer {
$con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ);
} }
$criteria->addJoin(CcShowSchedulePeer::SHOW_ID, CcShowPeer::ID, $join_behavior); $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doCount($criteria, $con); $stmt = BasePeer::doCount($criteria, $con);
@ -637,10 +632,10 @@ abstract class BaseCcShowSchedulePeer {
CcShowSchedulePeer::addSelectColumns($criteria); CcShowSchedulePeer::addSelectColumns($criteria);
$startcol2 = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); $startcol2 = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS);
CcShowPeer::addSelectColumns($criteria); CcShowInstancesPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(CcShowSchedulePeer::SHOW_ID, CcShowPeer::ID, $join_behavior); $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior);
$stmt = BasePeer::doSelect($criteria, $con); $stmt = BasePeer::doSelect($criteria, $con);
$results = array(); $results = array();
@ -659,21 +654,21 @@ abstract class BaseCcShowSchedulePeer {
CcShowSchedulePeer::addInstanceToPool($obj1, $key1); CcShowSchedulePeer::addInstanceToPool($obj1, $key1);
} // if obj1 already loaded } // if obj1 already loaded
// Add objects for joined CcShow rows // Add objects for joined CcShowInstances rows
$key2 = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol2); $key2 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) { if ($key2 !== null) {
$obj2 = CcShowPeer::getInstanceFromPool($key2); $obj2 = CcShowInstancesPeer::getInstanceFromPool($key2);
if (!$obj2) { if (!$obj2) {
$cls = CcShowPeer::getOMClass(false); $cls = CcShowInstancesPeer::getOMClass(false);
$obj2 = new $cls(); $obj2 = new $cls();
$obj2->hydrate($row, $startcol2); $obj2->hydrate($row, $startcol2);
CcShowPeer::addInstanceToPool($obj2, $key2); CcShowInstancesPeer::addInstanceToPool($obj2, $key2);
} // if obj2 loaded } // if obj2 loaded
// Add the $obj1 (CcShowSchedule) to the collection in $obj2 (CcShow) // Add the $obj1 (CcShowSchedule) to the collection in $obj2 (CcShowInstances)
$obj2->addCcShowSchedule($obj1); $obj2->addCcShowSchedule($obj1);
} // if joined row not null } // if joined row not null

View File

@ -7,14 +7,12 @@
* *
* *
* @method CcShowScheduleQuery orderByDbId($order = Criteria::ASC) Order by the id column * @method CcShowScheduleQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcShowScheduleQuery orderByDbShowId($order = Criteria::ASC) Order by the show_id column * @method CcShowScheduleQuery orderByDbInstanceId($order = Criteria::ASC) Order by the instance_id column
* @method CcShowScheduleQuery orderByDbShowDay($order = Criteria::ASC) Order by the show_day column
* @method CcShowScheduleQuery orderByDbPosition($order = Criteria::ASC) Order by the position column * @method CcShowScheduleQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
* @method CcShowScheduleQuery orderByDbGroupId($order = Criteria::ASC) Order by the group_id column * @method CcShowScheduleQuery orderByDbGroupId($order = Criteria::ASC) Order by the group_id column
* *
* @method CcShowScheduleQuery groupByDbId() Group by the id column * @method CcShowScheduleQuery groupByDbId() Group by the id column
* @method CcShowScheduleQuery groupByDbShowId() Group by the show_id column * @method CcShowScheduleQuery groupByDbInstanceId() Group by the instance_id column
* @method CcShowScheduleQuery groupByDbShowDay() Group by the show_day column
* @method CcShowScheduleQuery groupByDbPosition() Group by the position column * @method CcShowScheduleQuery groupByDbPosition() Group by the position column
* @method CcShowScheduleQuery groupByDbGroupId() Group by the group_id column * @method CcShowScheduleQuery groupByDbGroupId() Group by the group_id column
* *
@ -22,22 +20,20 @@
* @method CcShowScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcShowScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method CcShowScheduleQuery innerJoin($relation) Adds a INNER JOIN clause to the query * @method CcShowScheduleQuery innerJoin($relation) Adds a INNER JOIN clause to the query
* *
* @method CcShowScheduleQuery leftJoinCcShow($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShow relation * @method CcShowScheduleQuery leftJoinCcShowInstances($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowInstances relation
* @method CcShowScheduleQuery rightJoinCcShow($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShow relation * @method CcShowScheduleQuery rightJoinCcShowInstances($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowInstances relation
* @method CcShowScheduleQuery innerJoinCcShow($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShow relation * @method CcShowScheduleQuery innerJoinCcShowInstances($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowInstances relation
* *
* @method CcShowSchedule findOne(PropelPDO $con = null) Return the first CcShowSchedule matching the query * @method CcShowSchedule findOne(PropelPDO $con = null) Return the first CcShowSchedule matching the query
* @method CcShowSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcShowSchedule matching the query, or a new CcShowSchedule object populated from the query conditions when no match is found * @method CcShowSchedule findOneOrCreate(PropelPDO $con = null) Return the first CcShowSchedule matching the query, or a new CcShowSchedule object populated from the query conditions when no match is found
* *
* @method CcShowSchedule findOneByDbId(int $id) Return the first CcShowSchedule filtered by the id column * @method CcShowSchedule findOneByDbId(int $id) Return the first CcShowSchedule filtered by the id column
* @method CcShowSchedule findOneByDbShowId(int $show_id) Return the first CcShowSchedule filtered by the show_id column * @method CcShowSchedule findOneByDbInstanceId(int $instance_id) Return the first CcShowSchedule filtered by the instance_id column
* @method CcShowSchedule findOneByDbShowDay(string $show_day) Return the first CcShowSchedule filtered by the show_day column
* @method CcShowSchedule findOneByDbPosition(int $position) Return the first CcShowSchedule filtered by the position column * @method CcShowSchedule findOneByDbPosition(int $position) Return the first CcShowSchedule filtered by the position column
* @method CcShowSchedule findOneByDbGroupId(int $group_id) Return the first CcShowSchedule filtered by the group_id column * @method CcShowSchedule findOneByDbGroupId(int $group_id) Return the first CcShowSchedule filtered by the group_id column
* *
* @method array findByDbId(int $id) Return CcShowSchedule objects filtered by the id column * @method array findByDbId(int $id) Return CcShowSchedule objects filtered by the id column
* @method array findByDbShowId(int $show_id) Return CcShowSchedule objects filtered by the show_id column * @method array findByDbInstanceId(int $instance_id) Return CcShowSchedule objects filtered by the instance_id column
* @method array findByDbShowDay(string $show_day) Return CcShowSchedule objects filtered by the show_day column
* @method array findByDbPosition(int $position) Return CcShowSchedule objects filtered by the position column * @method array findByDbPosition(int $position) Return CcShowSchedule objects filtered by the position column
* @method array findByDbGroupId(int $group_id) Return CcShowSchedule objects filtered by the group_id column * @method array findByDbGroupId(int $group_id) Return CcShowSchedule objects filtered by the group_id column
* *
@ -167,24 +163,24 @@ abstract class BaseCcShowScheduleQuery extends ModelCriteria
} }
/** /**
* Filter the query on the show_id column * Filter the query on the instance_id column
* *
* @param int|array $dbShowId The value to use as filter. * @param int|array $dbInstanceId The value to use as filter.
* Accepts an associative array('min' => $minValue, 'max' => $maxValue) * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return CcShowScheduleQuery The current query, for fluid interface * @return CcShowScheduleQuery The current query, for fluid interface
*/ */
public function filterByDbShowId($dbShowId = null, $comparison = null) public function filterByDbInstanceId($dbInstanceId = null, $comparison = null)
{ {
if (is_array($dbShowId)) { if (is_array($dbInstanceId)) {
$useMinMax = false; $useMinMax = false;
if (isset($dbShowId['min'])) { if (isset($dbInstanceId['min'])) {
$this->addUsingAlias(CcShowSchedulePeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if (isset($dbShowId['max'])) { if (isset($dbInstanceId['max'])) {
$this->addUsingAlias(CcShowSchedulePeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL);
$useMinMax = true; $useMinMax = true;
} }
if ($useMinMax) { if ($useMinMax) {
@ -194,38 +190,7 @@ abstract class BaseCcShowScheduleQuery extends ModelCriteria
$comparison = Criteria::IN; $comparison = Criteria::IN;
} }
} }
return $this->addUsingAlias(CcShowSchedulePeer::SHOW_ID, $dbShowId, $comparison); return $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId, $comparison);
}
/**
* Filter the query on the show_day column
*
* @param string|array $dbShowDay 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 CcShowScheduleQuery The current query, for fluid interface
*/
public function filterByDbShowDay($dbShowDay = null, $comparison = null)
{
if (is_array($dbShowDay)) {
$useMinMax = false;
if (isset($dbShowDay['min'])) {
$this->addUsingAlias(CcShowSchedulePeer::SHOW_DAY, $dbShowDay['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbShowDay['max'])) {
$this->addUsingAlias(CcShowSchedulePeer::SHOW_DAY, $dbShowDay['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CcShowSchedulePeer::SHOW_DAY, $dbShowDay, $comparison);
} }
/** /**
@ -291,31 +256,31 @@ abstract class BaseCcShowScheduleQuery extends ModelCriteria
} }
/** /**
* Filter the query by a related CcShow object * Filter the query by a related CcShowInstances object
* *
* @param CcShow $ccShow the related object to use as filter * @param CcShowInstances $ccShowInstances the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
* *
* @return CcShowScheduleQuery The current query, for fluid interface * @return CcShowScheduleQuery The current query, for fluid interface
*/ */
public function filterByCcShow($ccShow, $comparison = null) public function filterByCcShowInstances($ccShowInstances, $comparison = null)
{ {
return $this return $this
->addUsingAlias(CcShowSchedulePeer::SHOW_ID, $ccShow->getDbId(), $comparison); ->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $ccShowInstances->getDbId(), $comparison);
} }
/** /**
* Adds a JOIN clause to the query using the CcShow relation * Adds a JOIN clause to the query using the CcShowInstances relation
* *
* @param string $relationAlias optional alias for the relation * @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return CcShowScheduleQuery The current query, for fluid interface * @return CcShowScheduleQuery The current query, for fluid interface
*/ */
public function joinCcShow($relationAlias = '', $joinType = Criteria::INNER_JOIN) public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{ {
$tableMap = $this->getTableMap(); $tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CcShow'); $relationMap = $tableMap->getRelation('CcShowInstances');
// create a ModelJoin object for this join // create a ModelJoin object for this join
$join = new ModelJoin(); $join = new ModelJoin();
@ -330,14 +295,14 @@ abstract class BaseCcShowScheduleQuery extends ModelCriteria
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias); $this->addJoinObject($join, $relationAlias);
} else { } else {
$this->addJoinObject($join, 'CcShow'); $this->addJoinObject($join, 'CcShowInstances');
} }
return $this; return $this;
} }
/** /**
* Use the CcShow relation CcShow object * Use the CcShowInstances relation CcShowInstances object
* *
* @see useQuery() * @see useQuery()
* *
@ -345,13 +310,13 @@ abstract class BaseCcShowScheduleQuery extends ModelCriteria
* to be used as main alias in the secondary query * to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
* *
* @return CcShowQuery A secondary query class using the current class as primary query * @return CcShowInstancesQuery A secondary query class using the current class as primary query
*/ */
public function useCcShowQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) public function useCcShowInstancesQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN)
{ {
return $this return $this
->joinCcShow($relationAlias, $joinType) ->joinCcShowInstances($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CcShow', 'CcShowQuery'); ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery');
} }
/** /**

View File

@ -1,6 +1,6 @@
#Note: project.home is automatically generated by the propel-install script. #Note: project.home is automatically generated by the propel-install script.
#Any manual changes to this value will be overwritten. #Any manual changes to this value will be overwritten.
project.home = /home/naomi/dev-campcaster/campcaster project.home = /home/naomiaro/dev-campcaster/campcaster
project.build = ${project.home}/build project.build = ${project.home}/build
#Database driver #Database driver

View File

@ -124,18 +124,28 @@
<table name="cc_show" phpName="CcShow"> <table name="cc_show" phpName="CcShow">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/> <column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
<column name="repeats" phpName="DbRepeats" type="TINYINT" required="true"/>
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/> <column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
<column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/> <column name="color" phpName="DbColor" type="VARCHAR" size="6" required="false"/>
<column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/> <column name="background_color" phpName="DbBackgroundColor" type="VARCHAR" size="6" required="false"/>
</table> </table>
<table name="cc_show_instances" phpName="CcShowInstances">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="starts" phpName="DbStarts" type="TIMESTAMP" required="true"/>
<column name="ends" phpName="DbEnds" type="TIMESTAMP" required="true"/>
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
<reference local="show_id" foreign="id"/>
</foreign-key>
</table>
<table name="cc_show_days" phpName="CcShowDays"> <table name="cc_show_days" phpName="CcShowDays">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="first_show" phpName="DbFirstShow" type="DATE" required="true"/> <column name="first_show" phpName="DbFirstShow" type="DATE" required="true"/>
<column name="last_show" phpName="DbLastShow" type="DATE" required="false"/> <column name="last_show" phpName="DbLastShow" type="DATE" required="false"/>
<column name="start_time" phpName="DbStartTime" type="TIME" required="true"/> <column name="start_time" phpName="DbStartTime" type="TIME" required="true"/>
<column name="end_time" phpName="DbEndTime" type="TIME" required="true"/> <column name="duration" phpName="DbDuration" type="TIME" required="true"/>
<column name="day" phpName="DbDay" type="TINYINT" required="true"/> <column name="day" phpName="DbDay" type="TINYINT" required="true"/>
<column name="repeat_type" phpName="DbRepeatType" type="TINYINT" required="true"/>
<column name="next_pop_date" phpName="DbNextPopDate" type="DATE" required="false"/>
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/> <column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE"> <foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
<reference local="show_id" foreign="id"/> <reference local="show_id" foreign="id"/>
@ -152,16 +162,6 @@
<reference local="subjs_id" foreign="id"/> <reference local="subjs_id" foreign="id"/>
</foreign-key> </foreign-key>
</table> </table>
<table name="cc_show_schedule" phpName="CcShowSchedule">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
<column name="show_day" phpName="DbShowDay" type="DATE" required="true"/>
<column name="position" phpName="DbPosition" type="INTEGER" required="false"/>
<column name="group_id" phpName="DbGroupId" type="INTEGER" required="true"/>
<foreign-key foreignTable="cc_show" name="cc_perm_show_fkey" onDelete="CASCADE">
<reference local="show_id" foreign="id"/>
</foreign-key>
</table>
<table name="cc_playlist" phpName="CcPlaylist"> <table name="cc_playlist" phpName="CcPlaylist">
<column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/> <column name="name" phpName="DbName" type="VARCHAR" size="255" required="true" defaultValue=""/>
@ -212,7 +212,7 @@
</index> </index>
</table> </table>
<table name="cc_schedule" phpName="CcSchedule"> <table name="cc_schedule" phpName="CcSchedule">
<column name="id" phpName="DbId" type="BIGINT" primaryKey="true" required="true"/> <column name="id" phpName="DbId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="playlist_id" phpName="DbPlaylistId" type="INTEGER" required="true"/> <column name="playlist_id" phpName="DbPlaylistId" type="INTEGER" required="true"/>
<column name="starts" phpName="DbStarts" type="TIMESTAMP" required="true"/> <column name="starts" phpName="DbStarts" type="TIMESTAMP" required="true"/>
<column name="ends" phpName="DbEnds" type="TIMESTAMP" required="true"/> <column name="ends" phpName="DbEnds" type="TIMESTAMP" required="true"/>
@ -225,6 +225,10 @@
<column name="cue_out" phpName="DbCueOut" type="TIME" required="false" defaultValue="00:00:00"/> <column name="cue_out" phpName="DbCueOut" type="TIME" required="false" defaultValue="00:00:00"/>
<column name="schedule_group_played" phpName="DbScheduleGroupPlayed" type="BOOLEAN" required="false" defaultValue="0"/> <column name="schedule_group_played" phpName="DbScheduleGroupPlayed" type="BOOLEAN" required="false" defaultValue="0"/>
<column name="media_item_played" phpName="DbMediaItemPlayed" type="BOOLEAN" required="false" defaultValue="0"/> <column name="media_item_played" phpName="DbMediaItemPlayed" type="BOOLEAN" required="false" defaultValue="0"/>
<column name="instance_id" phpName="DbInstanceId" type="INTEGER" required="true"/>
<foreign-key foreignTable="cc_show_instances" name="cc_show_inst_fkey" onDelete="CASCADE">
<reference local="instance_id" foreign="id"/>
</foreign-key>
</table> </table>
<table name="cc_sess" phpName="CcSess"> <table name="cc_sess" phpName="CcSess">
<column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true"/> <column name="sessid" phpName="Sessid" type="CHAR" size="32" primaryKey="true" required="true"/>

View File

@ -162,7 +162,6 @@ CREATE TABLE "cc_show"
( (
"id" serial NOT NULL, "id" serial NOT NULL,
"name" VARCHAR(255) default '' NOT NULL, "name" VARCHAR(255) default '' NOT NULL,
"repeats" INT2 NOT NULL,
"description" VARCHAR(512), "description" VARCHAR(512),
"color" VARCHAR(6), "color" VARCHAR(6),
"background_color" VARCHAR(6), "background_color" VARCHAR(6),
@ -172,6 +171,26 @@ CREATE TABLE "cc_show"
COMMENT ON TABLE "cc_show" IS ''; COMMENT ON TABLE "cc_show" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_show_instances
-----------------------------------------------------------------------------
DROP TABLE "cc_show_instances" CASCADE;
CREATE TABLE "cc_show_instances"
(
"id" serial NOT NULL,
"starts" TIMESTAMP NOT NULL,
"ends" TIMESTAMP NOT NULL,
"show_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_show_instances" IS '';
SET search_path TO public; SET search_path TO public;
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- cc_show_days -- cc_show_days
@ -186,8 +205,10 @@ CREATE TABLE "cc_show_days"
"first_show" DATE NOT NULL, "first_show" DATE NOT NULL,
"last_show" DATE, "last_show" DATE,
"start_time" TIME NOT NULL, "start_time" TIME NOT NULL,
"end_time" TIME NOT NULL, "duration" TIME NOT NULL,
"day" INT2 NOT NULL, "day" INT2 NOT NULL,
"repeat_type" INT2 NOT NULL,
"next_pop_date" DATE,
"show_id" INTEGER NOT NULL, "show_id" INTEGER NOT NULL,
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );
@ -214,27 +235,6 @@ CREATE TABLE "cc_show_hosts"
COMMENT ON TABLE "cc_show_hosts" IS ''; COMMENT ON TABLE "cc_show_hosts" IS '';
SET search_path TO public;
-----------------------------------------------------------------------------
-- cc_show_schedule
-----------------------------------------------------------------------------
DROP TABLE "cc_show_schedule" CASCADE;
CREATE TABLE "cc_show_schedule"
(
"id" serial NOT NULL,
"show_id" INTEGER NOT NULL,
"show_day" DATE NOT NULL,
"position" INTEGER,
"group_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
COMMENT ON TABLE "cc_show_schedule" IS '';
SET search_path TO public; SET search_path TO public;
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- cc_playlist -- cc_playlist
@ -318,7 +318,7 @@ DROP TABLE "cc_schedule" CASCADE;
CREATE TABLE "cc_schedule" CREATE TABLE "cc_schedule"
( (
"id" INT8 NOT NULL, "id" serial NOT NULL,
"playlist_id" INTEGER NOT NULL, "playlist_id" INTEGER NOT NULL,
"starts" TIMESTAMP NOT NULL, "starts" TIMESTAMP NOT NULL,
"ends" TIMESTAMP NOT NULL, "ends" TIMESTAMP NOT NULL,
@ -331,6 +331,7 @@ CREATE TABLE "cc_schedule"
"cue_out" TIME default '00:00:00', "cue_out" TIME default '00:00:00',
"schedule_group_played" BOOLEAN default 'f', "schedule_group_played" BOOLEAN default 'f',
"media_item_played" BOOLEAN default 'f', "media_item_played" BOOLEAN default 'f',
"instance_id" INTEGER NOT NULL,
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );
@ -463,14 +464,14 @@ ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey" FOREIGN KEY ("edi
ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey" FOREIGN KEY ("subj") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE; ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey" FOREIGN KEY ("subj") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_instances" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_days" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; ALTER TABLE "cc_show_days" ADD CONSTRAINT "cc_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_host_fkey" FOREIGN KEY ("subjs_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE; ALTER TABLE "cc_show_hosts" ADD CONSTRAINT "cc_perm_host_fkey" FOREIGN KEY ("subjs_id") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_show_schedule" ADD CONSTRAINT "cc_perm_show_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id"); ALTER TABLE "cc_playlist" ADD CONSTRAINT "cc_playlist_editedby_fkey" FOREIGN KEY ("editedby") REFERENCES "cc_subjs" ("id");
ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE;
@ -479,4 +480,6 @@ ALTER TABLE "cc_playlistcontents" ADD CONSTRAINT "cc_playlistcontents_playlist_i
ALTER TABLE "cc_pref" ADD CONSTRAINT "cc_pref_subjid_fkey" FOREIGN KEY ("subjid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE; ALTER TABLE "cc_pref" ADD CONSTRAINT "cc_pref_subjid_fkey" FOREIGN KEY ("subjid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_schedule" ADD CONSTRAINT "cc_show_inst_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE;
ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey" FOREIGN KEY ("userid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE; ALTER TABLE "cc_sess" ADD CONSTRAINT "cc_sess_userid_fkey" FOREIGN KEY ("userid") REFERENCES "cc_subjs" ("id") ON DELETE CASCADE;

View File

@ -32,7 +32,7 @@ CREATE FUNCTION show_content() RETURNS trigger AS
BEGIN BEGIN
IF(TG_OP=''DELETE'') THEN IF(TG_OP=''DELETE'') THEN
UPDATE cc_show_schedule SET position = (position - 1) UPDATE cc_show_schedule SET position = (position - 1)
WHERE (show_id = old.show_id AND show_day = old.show_day AND position > old.position); WHERE (instance_id = old.instance_id AND position > old.position);
END IF; END IF;
RETURN NULL; RETURN NULL;
END; END;

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View File

@ -80,9 +80,9 @@
font-size:12px; font-size:12px;
} }
#spl_editor { /*#spl_editor {
height: 50px; height: 50px;
} }*/
#spl_editor > div > span { #spl_editor > div > span {
/* display: inline-block; /* display: inline-block;
@ -169,7 +169,6 @@
} }
#spl_sortable .spl_fade_control { #spl_sortable .spl_fade_control {
position:absolute; position:absolute;
top:-8px;
right:35px; right:35px;
z-index: 6; z-index: 6;
height:15px; height:15px;
@ -201,11 +200,14 @@
background: transparent url(images/crossfade_playlist.png) no-repeat 0 -30px; background: transparent url(images/crossfade_playlist.png) no-repeat 0 -30px;
border:none; border:none;
} }
#spl_sortable li .crossfade { #spl_sortable li .crossfade, #spl_sortable li .cue-edit {
background:#debc9e url(images/crossfade_bg.png) repeat-x 0 0 !important; background:#debc9e url(images/crossfade_bg.png) repeat-x 0 0 !important;
border:1px solid #5d5d5d; border:1px solid #5d5d5d;
border-width: 1px 0 0 0; border-width: 1px 0 0 0;
height:60px; min-height:35px;
}
#spl_sortable li .cue-edit {
background:#b6d1d5 url(images/cue-editor_bg.png) repeat-x 0 0 !important;
} }
#spl_sortable dl.inline-list { #spl_sortable dl.inline-list {
margin:10px 0 0 37px; margin:10px 0 0 37px;
@ -237,4 +239,57 @@
#spl_sortable li .spl_fade_end.ui-state-active { #spl_sortable li .spl_fade_end.ui-state-active {
background: transparent url(images/fade_out.png) no-repeat 0 -30px; background: transparent url(images/fade_out.png) no-repeat 0 -30px;
border:none; border:none;
} }
.crossfade dl.inline-list, .cue-edit dl.inline-list, .crossfade-main dl.inline-list {
padding-bottom:5px;
}
.crossfade dl.inline-list dt, .cue-edit dl.inline-list dt, .crossfade-main dl.inline-list dt {
clear: none;
min-width: 40px;
}
.crossfade dl.inline-list dd, .cue-edit dl.inline-list dd, .crossfade-main dl.inline-list dd {
float: left;
font-size: 12px;
margin: 0;
padding: 0 25px 0px 15px;
}
.edit-error {
clear:both;
color:#b80000;
margin:0 0 0px 37px;
padding-bottom:4px;
font-size:12px;
display:none;
}
.edit-error:last-child {
padding-bottom:10px;
}
.spl_text_input {
color:#fff;
}
.crossfade-main {
background:#debc9e;
border:1px solid #5b5b5b;
padding:10px 10px 6px 10px;
margin:0 1px 16px 0;
position:relative;
}
.crossfade-main .edit-error {
padding-bottom:4px;
margin:0;
}
.crossfade-main .edit-error:last-child {
padding-bottom:2px;
}
.crossfade-main .ui-icon-closethick {
position: absolute;
right: 6px;
top: 3px;
z-index: 3;
}

View File

@ -702,7 +702,7 @@ dt.block-display, dd.block-display {
.floated-panel { .floated-panel {
margin-top:0; margin-top:0;
width:99.99%; width:99.99%;
z-index:999; z-index:9999;
} }
@ -805,10 +805,6 @@ div.ui-datepicker {
float:left; float:left;
margin-right: 8px; margin-right: 8px;
} }
#schedule_playlist_chosen li > h3 > span.ui-icon.ui-icon-triangle-1-s {
float:left;
margin-right: 8px;
}
#schedule_playlist_chosen li > h3 > span.ui-icon.ui-icon-close { #schedule_playlist_chosen li > h3 > span.ui-icon.ui-icon-close {
float:right; float:right;
margin-right: 8px; margin-right: 8px;
@ -958,3 +954,109 @@ h2#scheduled_playlist_name span {
} }
/*---//////////////////// Advenced Search ////////////////////---*/ /*---//////////////////// Advenced Search ////////////////////---*/
.search_control {
padding:8px;
border:1pxp solid #8f8f8f;
background:#d8d8d8;
margin-bottom:8px;
}
.search_group {
padding:8px;
border:1pxp solid #8f8f8f;
margin-bottom:8px;
}
.search_group > fieldset {
padding:0;
border:none;
margin-top:8px;
}
.search_group > fieldset .input_text {
width:45%;
}
.search_group > fieldset .input_text, .search_group > fieldset .input_select {
margin-right:6px;
}
.search_group fieldset .ui-button-icon-only .ui-button-text, .search_group fieldset .ui-button-icons-only .ui-button-text {
padding: 3px 2px;
text-indent: -1e+7px;
}
.search_group fieldset .ui-button-icon-only {
width: 2.1em;
}
.search_group fieldset .ui-button-icon-only .ui-icon {
left: 48%;
margin-top: -9px;
position: absolute;
top: 50%;
}
/*---//////////////////// USERS ////////////////////---*/
.simple-formblock {
width: 30%;
}
.simple-formblock dl, .simple-formblock dl.zend_form {
margin: 0;
padding: 0;
width: 100%;
}
.simple-formblock dt {
clear: left;
color: #666666;
float: left;
font-size: 1.2em;
font-weight: bold;
margin: 0;
min-width: 90px;
padding: 4px 0;
text-align: left;
}
.simple-formblock dd {
float: left;
font-size: 1.2em;
margin: 0;
padding: 4px 0 4px 15px;
width:60%;
}
.simple-formblock.padded-strong {
padding:12px;
}
.simple-formblock dd .input_text {
width: 100%;
}
.simple-formblock h2 {
font-size:1.7em;
padding-bottom:16px;
}
.simple-formblock label {
padding:0;
}
.ui-button-icon-only.crossfade-main-button, .ui-button-icons-only.crossfade-main-button {
padding-right: 8px;
}
.ui-button-icon-only.crossfade-main-button .ui-button-text, .ui-button-icons-only.crossfade-main-button .ui-button-text {
padding: 0;
text-indent: -1e+7px;
padding: 0.1em 1em;
}
.ui-state-default .ui-icon.crossfade-main-icon {
background:url(images/crossfade_main.png) no-repeat 0 2px;
width:25px;
}
.ui-button-icon-only.crossfade-main-button .ui-icon {
left: 44%;
margin-left: -8px;
}
button, input {
margin-top:0;
margin-bottom:0;
}

View File

@ -91,34 +91,11 @@ function eventRender(event, element, view) {
function eventAfterRender( event, element, view ) { function eventAfterRender( event, element, view ) {
function getStartTS() {
var start = makeTimeStamp(event.start);
return start;
}
function getEndTS() {
var start = makeTimeStamp(event.end);
return start;
}
$(element) $(element)
.jjmenu("rightClick", .jjmenu("rightClick",
[{get:"/Schedule/make-context-menu/format/json/id/#id#/start/#start#/end/#end#"}], [{get:"/Schedule/make-context-menu/format/json/id/#id#"}],
{id: event.id, start: getStartTS, end: getEndTS}, {id: event.id},
{xposition: "mouse", yposition: "mouse"}); {xposition: "mouse", yposition: "mouse"});
/*
$(element).qtip({
content: {
text: event.description,
title: { text: 'Show Description' }
},
position: {
target: 'mouse',
adjust: { mouse: true }
}
});
*/
} }
function eventClick(event, jsEvent, view) { function eventClick(event, jsEvent, view) {
@ -134,17 +111,13 @@ function eventMouseout(event, jsEvent, view) {
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) { function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
var url; var url;
if (event.repeats && dayDelta !== 0) {
revertFunc();
return;
}
url = '/Schedule/move-show/format/json'; url = '/Schedule/move-show/format/json';
$.post(url, $.post(url,
{day: dayDelta, min: minuteDelta, showId: event.id}, {day: dayDelta, min: minuteDelta, showInstanceId: event.id},
function(json){ function(json){
if(json.overlap) { if(json.error) {
alert(json.error);
revertFunc(); revertFunc();
} }
}); });
@ -156,9 +129,10 @@ function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, vie
url = '/Schedule/resize-show/format/json'; url = '/Schedule/resize-show/format/json';
$.post(url, $.post(url,
{day: dayDelta, min: minuteDelta, showId: event.id}, {day: dayDelta, min: minuteDelta, showInstanceId: event.id},
function(json){ function(json){
if(json.overlap) { if(json.error) {
alert(json.error);
revertFunc(); revertFunc();
} }
}); });
@ -167,24 +141,11 @@ function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, vie
function getFullCalendarEvents(start, end, callback) { function getFullCalendarEvents(start, end, callback) {
var url, start_date, end_date; var url, start_date, end_date;
var sy, sm, sd, ey, em, ed; start_date = makeTimeStamp(start);
sy = start.getFullYear(); end_date = makeTimeStamp(end);
sm = start.getMonth() + 1;
sd = start.getDate();
start_date = sy +"-"+ sm +"-"+ sd;
ey = end.getFullYear();
em = end.getMonth() + 1;
ed = end.getDate();
end_date = ey +"-"+ em +"-"+ ed;
url = '/Schedule/event-feed'; url = '/Schedule/event-feed';
if ((ed - sd) === 1) {
url = url + '/weekday/' + start.getDay();
}
var d = new Date(); var d = new Date();
$.post(url, {format: "json", start: start_date, end: end_date, cachep: d.getTime()}, function(json){ $.post(url, {format: "json", start: start_date, end: end_date, cachep: d.getTime()}, function(json){

View File

@ -165,8 +165,14 @@ function buildContentDialog(json){
} }
function buildScheduleDialog(json){ function buildScheduleDialog(json){
var dialog = $(json.dialog); var dialog;
if(json.error) {
alert(json.error);
return;
}
dialog = $(json.dialog);
makeScheduleDialog(dialog, json); makeScheduleDialog(dialog, json);
dialog.dialog({ dialog.dialog({

View File

@ -1,3 +1,17 @@
/* function to create popup window */
function popup(mylink){
if (!window.focus)
return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, "player", 'width=300,height=100,scrollbars=yes');
return false;
}
/* Takes an input parameter of milliseconds and converts these into /* Takes an input parameter of milliseconds and converts these into
* the format HH:MM:SS */ * the format HH:MM:SS */
function convertToHHMMSS(timeInMS){ function convertToHHMMSS(timeInMS){
@ -66,6 +80,20 @@ function convertToHHMMSSmm(timeInMS){
return hours + ":" + minutes + ":" + seconds+ "." + ms; return hours + ":" + minutes + ":" + seconds+ "." + ms;
} }
function convertDateToHHMM(epochTime){
var d = new Date(epochTime);
var hours = d.getUTCHours().toString();
var minutes = d.getUTCMinutes().toString();
if (hours.length == 1)
hours = "0" + hours;
if (minutes.length == 1)
minutes = "0" + minutes;
return hours + ":" + minutes;
}
function convertDateToHHMMSS(epochTime){ function convertDateToHHMMSS(epochTime){
var d = new Date(epochTime); var d = new Date(epochTime);
@ -82,17 +110,29 @@ function convertDateToHHMMSS(epochTime){
return hours + ":" + minutes + ":" + seconds; return hours + ":" + minutes + ":" + seconds;
} }
/* Takes in a string of format similar to 2011-02-07 02:59:57,
* and converts this to epoch/posix time. */
function convertDateToPosixTime(s){ function convertDateToPosixTime(s){
var year = s.substring(0, 4);
var month = s.substring(5, 7); var datetime = s.split(" ");
var day = s.substring(8, 10);
var hour = s.substring(11, 13); var date = datetime[0].split("-");
var minute = s.substring(14, 16); var time = datetime[1].split(":");
var sec = s.substring(17, 19);
var msec = 0; var year = date[0];
if (s.length >= 20){ var month = date[1];
msec = s.substring(20); var day = date[2];
} var hour = time[0];
var minute = time[1];
var sec = 0;
var msec = 0;
if (time[2].indexOf(".") != -1){
var temp = time[2].split(".");
sec = temp[0];
msec = temp[1];
} else
sec = time[2];
return Date.UTC(year, month, day, hour, minute, sec, msec); return Date.UTC(year, month, day, hour, minute, sec, msec);
} }

View File

@ -86,7 +86,7 @@ function createDataGrid(){
"aaData": datagridData.rows, "aaData": datagridData.rows,
"aoColumns": columns, "aoColumns": columns,
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
if (aData[aData.length-2] != "") if (aData[aData.length-2] == "t")
$(nRow).attr("style", "background-color:#166622"); $(nRow).attr("style", "background-color:#166622");
if (aData[0] == "c") if (aData[0] == "c")
$(nRow).attr("style", "background-color:#61B329"); $(nRow).attr("style", "background-color:#61B329");
@ -96,10 +96,12 @@ function createDataGrid(){
} }
} ); } );
setTimeout(init2, 5000);
} }
var viewType = "now" //"day"; var viewType = "now" //"day";
var mainLoopRegistered = false;
function setViewType(type){ function setViewType(type){
if (type == 0){ if (type == 0){
viewType = "now"; viewType = "now";
@ -119,6 +121,11 @@ function init2(){
registered = true; registered = true;
registerSongEndListener(notifySongEnd); registerSongEndListener(notifySongEnd);
} }
if (!mainLoopRegistered){
setTimeout(init2, 5000);
mainLoopRegistered = true;
}
} }
$(document).ready(function() { $(document).ready(function() {

View File

@ -15,10 +15,9 @@ var uiUpdateInterval = 200;
var songEndFunc; var songEndFunc;
//var showStartPosixTime = 0; //set to "development" if we are developing :). Useful to disable alerts
//var showEndPosixTime = 0; //when entering production mode.
//var showLengthMs = 1; var APPLICATION_ENV = "";
//var currentShowName = "";
/* boolean flag to let us know if we should prepare to execute a function /* boolean flag to let us know if we should prepare to execute a function
* that flips the playlist to the next song. This flags purpose is to * that flips the playlist to the next song. This flags purpose is to
@ -108,8 +107,9 @@ function updateProgressBarValue(){
if (diff < serverUpdateInterval && diff >= 0){ if (diff < serverUpdateInterval && diff >= 0){
nextSongPrepare = false; nextSongPrepare = false;
setTimeout(newSongStart, diff); setTimeout(newSongStart, diff);
} else if (diff < 0){ } else if (diff < 0 && APPLICATION_ENV == "development"){
alert ("Warning: estimatedSchedulePosixTime > songStartPosixTime"); alert ("Warning: estimatedSchedulePosixTime > songStartPosixTime");
alert (estimatedSchedulePosixTime + " " + nextSongs[0].songStartPosixTime);
} }
} }
@ -119,7 +119,7 @@ function updateProgressBarValue(){
if (diff < serverUpdateInterval && diff >= 0){ if (diff < serverUpdateInterval && diff >= 0){
nextShowPrepare = false; nextShowPrepare = false;
setTimeout(nextShowStart, diff); setTimeout(nextShowStart, diff);
} else if (diff < 0){ } else if (diff < 0 && APPLICATION_ENV == "development"){
alert ("Warning: estimatedSchedulePosixTime > showStartPosixTime"); alert ("Warning: estimatedSchedulePosixTime > showStartPosixTime");
} }
} }
@ -172,7 +172,7 @@ function updatePlaybar(){
$('#show-length').empty(); $('#show-length').empty();
if (currentShow.length > 0){ if (currentShow.length > 0){
$('#show-length').text(convertDateToHHMMSS(currentShow[0].showStartPosixTime) + " - " + convertDateToHHMMSS(currentShow[0].showEndPosixTime)); $('#show-length').text(convertDateToHHMM(currentShow[0].showStartPosixTime) + " - " + convertDateToHHMM(currentShow[0].showEndPosixTime));
} }
/* Column 2 update */ /* Column 2 update */
@ -202,6 +202,8 @@ function calcAdditionalShowData(show){
} }
function parseItems(obj){ function parseItems(obj){
APPLICATION_ENV = obj.env;
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime); var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
schedulePosixTime += parseInt(obj.timezoneOffset)*1000; schedulePosixTime += parseInt(obj.timezoneOffset)*1000;
@ -228,15 +230,6 @@ function parseItems(obj){
} }
function getScheduleFromServerDebug(){
$.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"text", success:function(data){
alert(data);
}});
setTimeout(getScheduleFromServer, serverUpdateInterval);
}
function getScheduleFromServer(){ function getScheduleFromServer(){
$.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ $.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){
parseItems(data.entries); parseItems(data.entries);
@ -248,24 +241,11 @@ function getScheduleFromServer(){
function init() { function init() {
//begin producer "thread" //begin producer "thread"
getScheduleFromServer(); getScheduleFromServer();
//getScheduleFromServerDebug();
//begin consumer "thread" //begin consumer "thread"
secondsTimer(); secondsTimer();
} }
function popup(mylink){
if (!window.focus)
return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, "player", 'width=300,height=100,scrollbars=yes');
return false;
}
$(document).ready(function() { $(document).ready(function() {
init(); init();
}); });

View File

@ -43,7 +43,7 @@ def create_user(username):
else: else:
print "User already exists." print "User already exists."
#add pypo to audio group #add pypo to audio group
os.system("adduser " + username + " pulse-access 2>&1 1>/dev/null") os.system("adduser " + username + " audio 2>&1 1>/dev/null")
def copy_dir(src_dir, dest_dir): def copy_dir(src_dir, dest_dir):
if (os.path.exists(dest_dir)) and (dest_dir != "/"): if (os.path.exists(dest_dir)) and (dest_dir != "/"):