From 22f52ca1955069d940e47bc93962f6965f9515cd Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 21 Feb 2013 17:57:56 -0500 Subject: [PATCH 001/128] CC-4961: Show linking -initial schedule service experimentation --- .../controllers/ScheduleController.php | 20 +- .../controllers/_old_ScheduleController.php | 1002 +++++++++++++ airtime_mvc/application/models/Schedule.php | 36 +- .../application/models/_old_Schedule.php | 1329 +++++++++++++++++ .../application/services/ScheduleService.php | 90 ++ 5 files changed, 2458 insertions(+), 19 deletions(-) create mode 100644 airtime_mvc/application/controllers/_old_ScheduleController.php create mode 100644 airtime_mvc/application/models/_old_Schedule.php create mode 100644 airtime_mvc/application/services/ScheduleService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 08fde37dc..9ca879918 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -5,6 +5,8 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; + private $service_schedule; + public function init() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); @@ -38,6 +40,8 @@ class ScheduleController extends Zend_Controller_Action ->initContext(); $this->sched_sess = new Zend_Session_Namespace("schedule"); + + $this->service_schedule = new Application_Service_ScheduleService(); } public function indexAction() @@ -90,13 +94,27 @@ class ScheduleController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']); //End Show builder JS/CSS requirements + $forms = $this->service_schedule->createShowForms(); + // populate forms with default values + $this->service_schedule->populateNewShowForms( + $forms["what"], $forms["when"], $forms["repeats"]); + + $this->view->what = $forms["what"]; + $this->view->when = $forms["when"]; + $this->view->repeats = $forms["repeats"]; + $this->view->live = $forms["live"]; + $this->view->rr = $forms["record"]; + $this->view->absoluteRebroadcast = $forms["abs_record"]; + $this->view->rebroadcast = $forms["rebroadcast"]; + $this->view->who = $forms["who"]; + $this->view->style = $forms["style"]; - Application_Model_Schedule::createNewFormSections($this->view); $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { $this->view->preloadShowForm = true; } + $this->view->addNewShow = true; $this->view->headScript()->appendScript( "var calendarPref = {};\n". "calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n". diff --git a/airtime_mvc/application/controllers/_old_ScheduleController.php b/airtime_mvc/application/controllers/_old_ScheduleController.php new file mode 100644 index 000000000..08fde37dc --- /dev/null +++ b/airtime_mvc/application/controllers/_old_ScheduleController.php @@ -0,0 +1,1002 @@ +_helper->getHelper('AjaxContext'); + $ajaxContext->addActionContext('event-feed', 'json') + ->addActionContext('event-feed-preload', 'json') + ->addActionContext('make-context-menu', 'json') + ->addActionContext('add-show-dialog', 'json') + ->addActionContext('add-show', 'json') + ->addActionContext('edit-show', 'json') + ->addActionContext('move-show', 'json') + ->addActionContext('resize-show', 'json') + ->addActionContext('delete-show', 'json') + ->addActionContext('show-content-dialog', 'json') + ->addActionContext('clear-show', 'json') + ->addActionContext('get-current-playlist', 'json') + ->addActionContext('remove-group', 'json') + ->addActionContext('populate-show-form', 'json') + ->addActionContext('populate-show-instance-form', 'json') + ->addActionContext('cancel-show', 'json') + ->addActionContext('cancel-current-show', 'json') + ->addActionContext('get-form', 'json') + ->addActionContext('upload-to-sound-cloud', 'json') + ->addActionContext('content-context-menu', 'json') + ->addActionContext('set-time-scale', 'json') + ->addActionContext('set-time-interval', 'json') + ->addActionContext('edit-show-instance', 'json') + ->addActionContext('dj-edit-show', 'json') + ->addActionContext('calculate-duration', 'json') + ->addActionContext('get-current-show', 'json') + ->addActionContext('update-future-is-scheduled', 'json') + ->initContext(); + + $this->sched_sess = new Zend_Session_Namespace("schedule"); + } + + public function indexAction() + { + $CC_CONFIG = Config::getConfig(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + //full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time + $this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds"); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/full-calendar-functions.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/fullcalendar/fullcalendar.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/colorpicker/js/colorpicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/add-show.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/schedule.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/fullcalendar.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/colorpicker/css/colorpicker.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/add-show.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']); + + //Start Show builder JS/CSS requirements + $this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/TableTools.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']); + //End Show builder JS/CSS requirements + + + Application_Model_Schedule::createNewFormSections($this->view); + $user = Application_Model_User::getCurrentUser(); + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $this->view->preloadShowForm = true; + } + + $this->view->headScript()->appendScript( + "var calendarPref = {};\n". + "calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n". + "calendarPref.timestamp = ".time().";\n". + "calendarPref.timezoneOffset = ".date("Z").";\n". + "calendarPref.timeScale = '".Application_Model_Preference::GetCalendarTimeScale()."';\n". + "calendarPref.timeInterval = ".Application_Model_Preference::GetCalendarTimeInterval().";\n". + "calendarPref.weekStartDay = ".Application_Model_Preference::GetWeekStartDay().";\n". + "var calendarEvents = null;" + ); + } + + public function eventFeedAction() + { + $start = new DateTime($this->_getParam('start', null)); + $start->setTimezone(new DateTimeZone("UTC")); + $end = new DateTime($this->_getParam('end', null)); + $end->setTimezone(new DateTimeZone("UTC")); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable); + $this->view->events = $events; + } + + public function eventFeedPreloadAction() + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $calendar_interval = Application_Model_Preference::GetCalendarTimeScale(); + Logging::info($calendar_interval); + if ($calendar_interval == "agendaDay") { + list($start, $end) = Application_Model_Show::getStartEndCurrentDayView(); + } else if ($calendar_interval == "agendaWeek") { + list($start, $end) = Application_Model_Show::getStartEndCurrentWeekView(); + } else if ($calendar_interval == "month") { + list($start, $end) = Application_Model_Show::getStartEndCurrentMonthView(); + } else { + Logging::error("Invalid Calendar Interval '$calendar_interval'"); + } + + $events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable); + $this->view->events = $events; + } + + public function getCurrentShowAction() + { + $currentShow = Application_Model_Show::getCurrentShow(); + if (!empty($currentShow)) { + $this->view->si_id = $currentShow[0]["instance_id"]; + $this->view->current_show = true; + } else { + $this->view->current_show = false; + } + } + + public function moveShowAction() + { + $deltaDay = $this->_getParam('day'); + $deltaMin = $this->_getParam('min'); + $showInstanceId = $this->_getParam('showInstanceId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $error = $showInstance->moveShow($deltaDay, $deltaMin); + } + + if (isset($error)) { + $this->view->error = $error; + } + } + + public function resizeShowAction() + { + $deltaDay = $this->_getParam('day'); + $deltaMin = $this->_getParam('min'); + $showId = $this->_getParam('showId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + try { + $show = new Application_Model_Show($showId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $error = $show->resizeShow($deltaDay, $deltaMin); + } + + if (isset($error)) { + $this->view->error = $error; + } + } + + public function deleteShowAction() + { + $showInstanceId = $this->_getParam('id'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + Logging::info($e->getMessage()); + $this->view->show_error = true; + + return false; + } + + $showInstance->delete(); + + $this->view->show_id = $showInstance->getShowId(); + } + } + + public function uploadToSoundCloudAction() + { + $show_instance = $this->_getParam('id'); + try { + $show_inst = new Application_Model_ShowInstance($show_instance); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $file = $show_inst->getRecordedFile(); + $id = $file->getId(); + Application_Model_Soundcloud::uploadSoundcloud($id); + // we should die with ui info + $this->_helper->json->sendJson(null); + } + + public function makeContextMenuAction() + { + $id = $this->_getParam('id'); + $menu = array(); + $epochNow = time(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $instance = new Application_Model_ShowInstance($id); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $isDJ = $user->isHostOfShow($instance->getShowId()); + + $showStartLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceStart()); + $showEndLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceEnd()); + + if ($instance->isRecorded() && $epochNow > $showEndLocalDT->getTimestamp()) { + + $file = $instance->getRecordedFile(); + $fileId = $file->getId(); + + $menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview", + "url" => $baseUrl."library/edit-file-md/id/".$fileId); + } + + if ($epochNow < $showStartLocalDT->getTimestamp()) { + if ( ($isAdminOrPM || $isDJ) + && !$instance->isRecorded() + && !$instance->isRebroadcast()) { + + $menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content", + "url" => $baseUrl."showbuilder/builder-dialog/"); + + $menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content", + "url" => $baseUrl."schedule/clear-show"); + } + } + + if (!$instance->isRecorded()) { + + $menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog"); + } + + if ($showEndLocalDT->getTimestamp() <= $epochNow + && $instance->isRecorded() + && Application_Model_Preference::GetUploadToSoundcloudOption()) { + + $file = $instance->getRecordedFile(); + $fileId = $file->getId(); + $scid = $instance->getSoundCloudFileId(); + + if ($scid > 0) { + $url = $file->getSoundCloudLinkToFile(); + $menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url); + } + + $text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud'); + $menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud"); + } + + if ($showStartLocalDT->getTimestamp() <= $epochNow && + $epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) { + + if ($instance->isRecorded()) { + $menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); + } else { + + if (!$instance->isRebroadcast()) { + $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); + } + + $menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); + } + } + + if ($epochNow < $showStartLocalDT->getTimestamp()) { + + if (!$instance->isRebroadcast() && $isAdminOrPM) { + $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); + } + + if ($instance->getShow()->isRepeating() && $isAdminOrPM) { + + //create delete sub menu. + $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "items" => array()); + + $menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); + + $menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show"); + } elseif ($isAdminOrPM) { + + $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); + } + } + + $this->view->items = $menu; + } + + public function clearShowAction() + { + $showInstanceId = $this->_getParam('id'); + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)) || $user->isHostOfShow($show->getShowId())) + $show->clearShow(); + } + + public function getCurrentPlaylistAction() + { + $range = Application_Model_Schedule::GetPlayOrderRange(); + $show = Application_Model_Show::getCurrentShow(); + + /* Convert all UTC times to localtime before sending back to user. */ + if (isset($range["previous"])) { + $range["previous"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["previous"]["starts"]); + $range["previous"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["previous"]["ends"]); + } + if (isset($range["current"])) { + $range["current"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["current"]["starts"]); + $range["current"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["current"]["ends"]); + } + if (isset($range["next"])) { + $range["next"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["next"]["starts"]); + $range["next"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["next"]["ends"]); + } + + Application_Model_Show::convertToLocalTimeZone($range["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); + Application_Model_Show::convertToLocalTimeZone($range["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); + + $source_status = array(); + $switch_status = array(); + $live_dj = Application_Model_Preference::GetSourceStatus("live_dj"); + $master_dj = Application_Model_Preference::GetSourceStatus("master_dj"); + + $scheduled_play_switch = Application_Model_Preference::GetSourceSwitchStatus("scheduled_play"); + $live_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("live_dj"); + $master_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("master_dj"); + + //might not be the correct place to implement this but for now let's just do it here + $source_status['live_dj_source'] = $live_dj; + $source_status['master_dj_source'] = $master_dj; + $this->view->source_status = $source_status; + + $switch_status['live_dj_source'] = $live_dj_switch; + $switch_status['master_dj_source'] = $master_dj_switch; + $switch_status['scheduled_play'] = $scheduled_play_switch; + $this->view->switch_status = $switch_status; + + $this->view->entries = $range; + $this->view->show_name = isset($show[0])?$show[0]["name"]:""; + } + + public function removeGroupAction() + { + $showInstanceId = $this->sched_sess->showInstanceId; + $group_id = $this->_getParam('groupId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)) || $user->isHostOfShow($show->getShowId())) { + $show->removeGroupFromShow($group_id); + } + + $this->view->showContent = $show->getShowContent(); + $this->view->timeFilled = $show->getTimeScheduled(); + $this->view->percentFilled = $show->getPercentScheduled(); + $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); + unset($this->view->showContent); + } + + public function showContentDialogAction() + { + $showInstanceId = $this->_getParam('id'); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $originalShowId = $show->isRebroadcast(); + if (!is_null($originalShowId)) { + try { + $originalShow = new Application_Model_ShowInstance($originalShowId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $originalShowName = $originalShow->getName(); + $originalShowStart = $originalShow->getShowInstanceStart(); + + //convert from UTC to user's timezone for display. + $originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC")); + $originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + //$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s")); + $this->view->additionalShowInfo = + sprintf(_("Rebroadcast of show %s from %s at %s"), + $originalShowName, + $originalDateTime->format("l, F jS"), + $originalDateTime->format("G:i")); + } + $this->view->showLength = $show->getShowLength(); + $this->view->timeFilled = $show->getTimeScheduled(); + $this->view->percentFilled = $show->getPercentScheduled(); + $this->view->showContent = $show->getShowListContent(); + $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); + $this->view->showTitle = htmlspecialchars($show->getName()); + unset($this->view->showContent); + } + + // we removed edit show instance option in menu item + // this feature is disabled in 2.1 and should be back in 2.2 + /*public function populateShowInstanceFormAction(){ + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $this->view->live = $formLive; + $this->view->addNewShow = false; + + $showInstanceId = $this->_getParam('id'); + + $show_instance = CcShowInstancesQuery::create()->findPK($showInstanceId); + $show = new Application_Model_Show($show_instance->getDbShowId()); + + $starts_string = $show_instance->getDbStarts(); + $ends_string = $show_instance->getDbEnds(); + + $starts_datetime = new DateTime($starts_string, new DateTimeZone("UTC")); + $ends_datetime = new DateTime($ends_string, new DateTimeZone("UTC")); + + $starts_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $ends_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $instance_duration = $starts_datetime->diff($ends_datetime); + + $formWhat->populate(array('add_show_id' => $show->getId(), + 'add_show_instance_id' => $showInstanceId, + 'add_show_name' => $show->getName(), + 'add_show_url' => $show->getUrl(), + 'add_show_genre' => $show->getGenre(), + 'add_show_description' => $show->getDescription())); + + $formWhen->populate(array('add_show_start_date' => $starts_datetime->format("Y-m-d"), + 'add_show_start_time' => $starts_datetime->format("H:i"), + 'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"), + 'add_show_end_time' => $ends_datetime->format("H:i"), + 'add_show_duration' => $instance_duration->format("%h"))); + + $formWhat->disable(); + $formWho->disable(); + $formWhen->disableRepeatCheckbox(); + $formRepeats->disable(); + $formStyle->disable(); + + //$formRecord->disable(); + //$formAbsoluteRebroadcast->disable(); + //$formRebroadcast->disable(); + + $this->view->action = "edit-show-instance"; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + }*/ + + public function populateShowFormAction() + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + $showInstanceId = $this->_getParam('id'); + + $this->view->action = "edit-show"; + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $isDJ = $user->isHostOfShow($showInstance->getShowId()); + + if (!($isAdminOrPM || $isDJ)) { + return; + } + + // in case a user was once a dj and had been assigned to a show + // but was then changed to an admin user we need to allow + // the user to edit the show as an admin (CC-4925) + if ($isDJ && !$isAdminOrPM) { + $this->view->action = "dj-edit-show"; + } + + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $this->view->live = $formLive; + $this->view->addNewShow = false; + + $show = new Application_Model_Show($showInstance->getShowId()); + + $formWhat->populate(array('add_show_id' => $show->getId(), + 'add_show_instance_id' => $showInstanceId, + 'add_show_name' => $show->getName(), + 'add_show_url' => $show->getUrl(), + 'add_show_genre' => $show->getGenre(), + 'add_show_description' => $show->getDescription())); + + $startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone("UTC")); + $endsDateTime = new DateTime($show->getEndDate()." ".$show->getEndTime(), new DateTimeZone("UTC")); + + $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"), + 'add_show_start_time' => $startsDateTime->format("H:i"), + 'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"), + 'add_show_end_time' => $endsDateTime->format("H:i"), + 'add_show_duration' => $show->getDuration(true), + 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); + + if ($show->isStartDateTimeInPast()) { + // for a non-repeating show, we should never allow user to change the start time. + // for the repeating show, we should allow because the form works as repeating template form + if (!$showInstance->getShow()->isRepeating()) { + $formWhen->disableStartDateAndTime(); + } else { + $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); + $formWhen->getElement('add_show_start_date')->setValue($nextFutureRepeatShow["starts"]->format("Y-m-d")); + $formWhen->getElement('add_show_start_time')->setValue($nextFutureRepeatShow["starts"]->format("H:i")); + $formWhen->getElement('add_show_end_date_no_repeat')->setValue($nextFutureRepeatShow["ends"]->format("Y-m-d")); + $formWhen->getElement('add_show_end_time')->setValue($nextFutureRepeatShow["ends"]->format("H:i")); + } + } + + //need to get the days of the week in the php timezone (for the front end). + $days = array(); + $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find(); + foreach ($showDays as $showDay) { + $showStartDay = new DateTime($showDay->getDbFirstShow(), new DateTimeZone($showDay->getDbTimezone())); + $showStartDay->setTimezone(new DateTimeZone(date_default_timezone_get())); + array_push($days, $showStartDay->format('w')); + } + + $displayedEndDate = new DateTime($show->getRepeatingEndDate(), new DateTimeZone($showDays[0]->getDbTimezone())); + $displayedEndDate->sub(new DateInterval("P1D"));//end dates are stored non-inclusively. + $displayedEndDate->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(), + 'add_show_day_check' => $days, + 'add_show_end_date' => $displayedEndDate->format("Y-m-d"), + 'add_show_no_end' => ($show->getRepeatingEndDate() == ''))); + + $hosts = array(); + $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find(); + foreach ($showHosts as $showHost) { + array_push($hosts, $showHost->getDbHost()); + } + $formWho->populate(array('add_show_hosts' => $hosts)); + $formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), + 'add_show_color' => $show->getColor())); + + $formLive->populate($show->getLiveStreamInfo()); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $this->view->rr = $formRecord; + $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $this->view->rebroadcast = $formRebroadcast; + + $formRecord->populate(array('add_show_record' => $show->isRecorded(), + 'add_show_rebroadcast' => $show->isRebroadcast())); + + $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true)); + + + + $rebroadcastsRelative = $show->getRebroadcastsRelative(); + $rebroadcastFormValues = array(); + $i = 1; + foreach ($rebroadcastsRelative as $rebroadcast) { + $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; + $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']); + $i++; + } + $formRebroadcast->populate($rebroadcastFormValues); + + $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute(); + $rebroadcastAbsoluteFormValues = array(); + $i = 1; + foreach ($rebroadcastsAbsolute as $rebroadcast) { + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time']; + $i++; + } + $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); + if (!$isAdminOrPM) { + $formRecord->disable(); + $formAbsoluteRebroadcast->disable(); + $formRebroadcast->disable(); + } + + if (!$isAdminOrPM) { + $formWhat->disable(); + $formWho->disable(); + $formWhen->disable(); + $formRepeats->disable(); + $formStyle->disable(); + } + + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + $this->view->entries = 5; + } + + public function getFormAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + Application_Model_Schedule::createNewFormSections($this->view); + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + } + + public function djEditShowAction() + { + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + //update cc_show + $show = new Application_Model_Show($data["add_show_id"]); + $show->setAirtimeAuthFlag($data["cb_airtime_auth"]); + $show->setCustomAuthFlag($data["cb_custom_auth"]); + $show->setCustomUsername($data["custom_username"]); + $show->setCustomPassword($data["custom_password"]); + + $this->view->edit = true; + } + + /*public function editShowInstanceAction(){ + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $success = Application_Model_Schedule::updateShowInstance($data, $this); + if ($success) { + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + } else { + $this->view->addNewShow = false; + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + }*/ + + public function editShowAction() + { + //1) Get add_show_start_date since it might not have been sent + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $data['add_show_hosts'] = $this->_getParam('hosts'); + $data['add_show_day_check'] = $this->_getParam('days'); + + if ($data['add_show_day_check'] == "") { + $data['add_show_day_check'] = null; + } + + $show = new Application_Model_Show($data['add_show_id']); + + $validateStartDate = true; + $validateStartTime = true; + if (!array_key_exists('add_show_start_date', $data)) { + //Changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + //The start date will be returned in UTC time, so lets convert it to local time. + $dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDateAndTime()); + $data['add_show_start_date'] = $dt->format("Y-m-d"); + + if (!array_key_exists('add_show_start_time', $data)) { + $data['add_show_start_time'] = $dt->format("H:i"); + $validateStartTime = false; + } + $validateStartDate = false; + } + $data['add_show_record'] = $show->isRecorded(); + + if ($show->isRepeating()) { + $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); + $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; + } else { + $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( + $show->getStartDateAndTime()); + } + + $success = Application_Model_Schedule::addUpdateShow($data, $this, + $validateStartDate, $originalShowStartDateTime, true, + $data['add_show_instance_id']); + + if ($success) { + $scheduler = new Application_Model_Scheduler(); + $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); + foreach ($showInstances as $si) { + $scheduler->removeGaps($si->getDbId()); + } + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + } else { + if (!$validateStartDate) { + $this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } + if (!$validateStartTime) { + $this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true)); + } + $this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true)); + $this->view->addNewShow = false; + $this->view->action = "edit-show"; + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + } + + public function addShowAction() + { + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $data['add_show_hosts'] = $this->_getParam('hosts'); + $data['add_show_day_check'] = $this->_getParam('days'); + + if ($data['add_show_day_check'] == "") { + $data['add_show_day_check'] = null; + } + + $validateStartDate = true; + $success = Application_Model_Schedule::addUpdateShow($data, $this, + $validateStartDate); + + if ($success) { + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render( + 'schedule/add-show-form.phtml'); + Logging::debug("Show creation succeeded"); + } else { + $this->view->addNewShow = true; + $this->view->form = $this->view->render( + 'schedule/add-show-form.phtml'); + Logging::debug("Show creation failed"); + } + } + + public function cancelShowAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $showInstanceId = $this->_getParam('id'); + + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $show = new Application_Model_Show($showInstance->getShowId()); + + $show->cancelShow($showInstance->getShowInstanceStart()); + $this->view->show_id = $showInstance->getShowId(); + } + } + + public function cancelCurrentShowAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $id = $this->_getParam('id'); + + try { + $scheduler = new Application_Model_Scheduler(); + $scheduler->cancelShow($id); + Application_Model_StoredFile::updatePastFilesIsScheduled(); + // send kick out source stream signal to pypo + $data = array("sourcename"=>"live_dj"); + Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data); + } catch (Exception $e) { + $this->view->error = $e->getMessage(); + Logging::info($e->getMessage()); + } + } + } + + public function contentContextMenuAction() + { + $id = $this->_getParam('id'); + + $params = '/format/json/id/#id#/'; + + $paramsPop = str_replace('#id#', $id, $params); + + // added for downlaod + $id = $this->_getParam('id'); + + $file_id = $this->_getParam('id', null); + $file = Application_Model_StoredFile::Recall($file_id); + + $baseUrl = $this->getRequest()->getBaseUrl(); + $url = $file->getRelativeFileUrl($baseUrl).'download/true'; + $menu[] = array('action' => array('type' => 'gourl', 'url' => $url), + 'title' => _('Download')); + + //returns format jjmenu is looking for. + $this->_helper->json->sendJson($menu); + } + + /** + * Sets the user specific preference for which time scale to use in Calendar. + * This is only being used by schedule.js at the moment. + */ + public function setTimeScaleAction() + { + Application_Model_Preference::SetCalendarTimeScale($this->_getParam('timeScale')); + } + +/** + * Sets the user specific preference for which time interval to use in Calendar. + * This is only being used by schedule.js at the moment. + */ + public function setTimeIntervalAction() + { + Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval')); + } + + public function calculateDurationAction() + { + $startParam = $this->_getParam('startTime'); + $endParam = $this->_getParam('endTime'); + + try { + $startDateTime = new DateTime($startParam); + $endDateTime = new DateTime($endParam); + + $UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC')); + $UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC')); + + $duration = $UTCEndDateTime->diff($UTCStartDateTime); + + $day = intval($duration->format('%d')); + if ($day > 0) { + $hour = intval($duration->format('%h')); + $min = intval($duration->format('%i')); + $hour += $day * 24; + $hour = min($hour, 99); + $sign = $duration->format('%r'); + $result = sprintf('%s%02dh %02dm', $sign, $hour, $min); + } else { + $result = $duration->format('%r%Hh %Im'); + } + } catch (Exception $e) { + $result = "Invalid Date"; + } + + echo Zend_Json::encode($result); + exit(); + } + + public function updateFutureIsScheduledAction() + { + $schedId = $this->_getParam('schedId'); + $redrawLibTable = Application_Model_StoredFile::setIsScheduled($schedId, false); + $this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable)); + } +} diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 1aac2566e..2778074d2 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -960,7 +960,7 @@ SQL; Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); } - public static function createNewFormSections($p_view) + /*public static function createNewFormSections($p_view) { $formWhat = new Application_Form_AddShowWhat(); $formWho = new Application_Form_AddShowWho(); @@ -1005,7 +1005,7 @@ SQL; $p_view->absoluteRebroadcast = $formAbsoluteRebroadcast; $p_view->rebroadcast = $formRebroadcast; $p_view->addNewShow = true; - } + }*/ /* This function is responsible for handling the case where an individual * show instance in a repeating show was edited (via the context menu in the Calendar). @@ -1140,13 +1140,13 @@ SQL; $data["add_show_duration"] = $hValue.":".$mValue; - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); - $formRecord->removeDecorator('DtDdWrapper'); - $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); - $formRebroadcast->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); $record = $formRecord->isValid($data); @@ -1156,18 +1156,18 @@ SQL; if ($repeats) { $repeats = $formRepeats->checkReliantFields($data); } - $formAbsoluteRebroadcast->reset(); - //make it valid, results don't matter anyways. - $rebroadAb = 1; + $formAbsoluteRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroadAb = 1; - if ($data["add_show_rebroadcast"]) { - $rebroad = $formRebroadcast->isValid($data); - if ($rebroad) { - $rebroad = $formRebroadcast->checkReliantFields($data); - } - } else { - $rebroad = 1; + if ($data["add_show_rebroadcast"]) { + $rebroad = $formRebroadcast->isValid($data); + if ($rebroad) { + $rebroad = $formRebroadcast->checkReliantFields($data); } + } else { + $rebroad = 1; + } } else { $repeats = 1; $formRebroadcast->reset(); diff --git a/airtime_mvc/application/models/_old_Schedule.php b/airtime_mvc/application/models/_old_Schedule.php new file mode 100644 index 000000000..1aac2566e --- /dev/null +++ b/airtime_mvc/application/models/_old_Schedule.php @@ -0,0 +1,1329 @@ + NOW() AT TIME ZONE 'UTC' +SQL; + $count = Application_Common_Database::prepareAndExecute( $sql, array( + ':file_id'=>$p_fileId), 'column'); + return (is_numeric($count) && ($count != '0')); + } + + public static function getAllFutureScheduledFiles() + { + $con = Propel::getConnection(); + $sql = << now() AT TIME ZONE 'UTC' +AND file_id is not null +SQL; + $files = $con->query($sql)->fetchAll(); + $real_files = array(); + foreach ($files as $f) { + $real_files[] = $f['file_id']; + } + + return $real_files; + } + + public static function getAllFutureScheduledWebstreams() + { + $con = Propel::getConnection(); + $sql = << now() AT TIME ZONE 'UTC' +AND stream_id is not null +SQL; + $streams = $con->query($sql)->fetchAll(); + $real_streams = array(); + foreach ($streams as $s) { + $real_streams[] = $s['stream_id']; + } + + return $real_streams; + } + /** + * Returns data related to the scheduled items. + * + * @param int $p_prev + * @param int $p_next + * @return date + */ + public static function GetPlayOrderRange($p_prev = 1, $p_next = 1) + { + if (!is_int($p_prev) || !is_int($p_next)) { + //must enter integers to specify ranges + Logging::info("Invalid range parameters: $p_prev or $p_next"); + + return array(); + } + + $date = new Application_Common_DateHelper; + $timeNow = $date->getTimestamp(); + $utcTimeNow = $date->getUtcTimestamp(); + + $shows = Application_Model_Show::getPrevCurrentNext($utcTimeNow); + $previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['instance_id']:null; + $currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['instance_id']:null; + $nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['instance_id']:null; + $results = self::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow); + + $range = array("env"=>APPLICATION_ENV, + "schedulerTime"=>$timeNow, + "previous"=>$results['previous'] !=null?$results['previous']:(count($shows['previousShow'])>0?$shows['previousShow'][0]:null), + "current"=>$results['current'] !=null?$results['current']:((count($shows['currentShow'])>0 && $shows['currentShow'][0]['record'] == 1)?$shows['currentShow'][0]:null), + "next"=> $results['next'] !=null?$results['next']:(count($shows['nextShow'])>0?$shows['nextShow'][0]:null), + "currentShow"=>$shows['currentShow'], + "nextShow"=>$shows['nextShow'], + "timezone"=> date("T"), + "timezoneOffset"=> date("Z") + ); + + return $range; + } + + /** + * Queries the database for the set of schedules one hour before + * and after the given time. If a show starts and ends within that + * time that is considered the current show. Then the scheduled item + * before it is the previous show, and the scheduled item after it + * is the next show. This way the dashboard getCurrentPlaylist is + * very fast. But if any one of the three show types are not found + * through this mechanism a call is made to the old way of querying + * the database to find the track info. + **/ + public static function GetPrevCurrentNext($p_previousShowID, $p_currentShowID, $p_nextShowID, $p_timeNow) + { + if ($p_previousShowID == null && $p_currentShowID == null && $p_nextShowID == null) { + return; + } + + $sql = "SELECT %%columns%% st.starts as starts, st.ends as ends, + st.media_item_played as media_item_played, si.ends as show_ends + %%tables%% WHERE "; + + $fileColumns = "ft.artist_name, ft.track_title, "; + $fileJoin = "FROM cc_schedule st JOIN cc_files ft ON st.file_id = ft.id + LEFT JOIN cc_show_instances si ON st.instance_id = si.id"; + + $streamColumns = "ws.name AS artist_name, wm.liquidsoap_data AS track_title, "; + $streamJoin = << $rows[$i]["show_ends"]) { + $rows[$i]['ends'] = $rows[$i]["show_ends"]; + } + + if ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) && (strtotime($rows[$i]['ends']) >= $timeNowAsMillis)) { + if ($i - 1 >= 0) { + $results['previous'] = array("name"=>$rows[$i-1]["artist_name"]." - ".$rows[$i-1]["track_title"], + "starts"=>$rows[$i-1]["starts"], + "ends"=>$rows[$i-1]["ends"], + "type"=>'track'); + } + $results['current'] = array("name"=>$rows[$i]["artist_name"]." - ".$rows[$i]["track_title"], + "starts"=>$rows[$i]["starts"], + "ends"=> (($rows[$i]["ends"] > $rows[$i]["show_ends"]) ? $rows[$i]["show_ends"]: $rows[$i]["ends"]), + "media_item_played"=>$rows[$i]["media_item_played"], + "record"=>0, + "type"=>'track'); + if (isset($rows[$i+1])) { + $results['next'] = array("name"=>$rows[$i+1]["artist_name"]." - ".$rows[$i+1]["track_title"], + "starts"=>$rows[$i+1]["starts"], + "ends"=>$rows[$i+1]["ends"], + "type"=>'track'); + } + break; + } + if (strtotime($rows[$i]['ends']) < $timeNowAsMillis ) { + $previousIndex = $i; + } + if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) { + $results['next'] = array("name"=>$rows[$i]["artist_name"]." - ".$rows[$i]["track_title"], + "starts"=>$rows[$i]["starts"], + "ends"=>$rows[$i]["ends"], + "type"=>'track'); + break; + } + } + //If we didn't find a a current show because the time didn't fit we may still have + //found a previous show so use it. + if ($results['previous'] === null && isset($previousIndex)) { + $results['previous'] = array("name"=>$rows[$previousIndex]["artist_name"]." - ".$rows[$previousIndex]["track_title"], + "starts"=>$rows[$previousIndex]["starts"], + "ends"=>$rows[$previousIndex]["ends"]);; + } + + return $results; + } + + public static function GetLastScheduleItem($p_timeNow) + { + $sql = <<= sit.starts + AND st.starts < sit.ends +ORDER BY st.ends DESC LIMIT 1; +SQL; + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow'=>$p_timeNow)); + + return $row; + } + + public static function GetCurrentScheduleItem($p_timeNow, $p_instanceId) + { + /* Note that usually there will be one result returned. In some + * rare cases two songs are returned. This happens when a track + * that was overbooked from a previous show appears as if it + * hasnt ended yet (track end time hasn't been reached yet). For + * this reason, we need to get the track that starts later, as + * this is the *real* track that is currently playing. So this + * is why we are ordering by track start time. */ + $sql = "SELECT *" + ." FROM cc_schedule st" + ." LEFT JOIN cc_files ft" + ." ON st.file_id = ft.id" + ." WHERE st.starts <= TIMESTAMP :timeNow1" + ." AND st.instance_id = :instanceId" + ." AND st.ends > TIMESTAMP :timeNow2" + ." ORDER BY st.starts DESC" + ." LIMIT 1"; + + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow1'=>$p_timeNow, ':instanceId'=>$p_instanceId, ':timeNow2'=>$p_timeNow,)); + + return $row; + } + + public static function GetNextScheduleItem($p_timeNow) + { + $sql = "SELECT" + ." ft.artist_name, ft.track_title," + ." st.starts as starts, st.ends as ends" + ." FROM cc_schedule st" + ." LEFT JOIN cc_files ft" + ." ON st.file_id = ft.id" + ." LEFT JOIN cc_show_instances sit" + ." ON st.instance_id = sit.id" + ." WHERE st.starts > TIMESTAMP :timeNow" + ." AND st.starts >= sit.starts" //this and the next line are necessary since we can overbook shows. + ." AND st.starts < sit.ends" + ." ORDER BY st.starts" + ." LIMIT 1"; + + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow'=>$p_timeNow)); + + return $row; + } + + /* + * + * @param DateTime $p_startDateTime + * + * @param DateTime $p_endDateTime + * + * @return array $scheduledItems + * + */ + public static function GetScheduleDetailItems($p_start, $p_end, $p_shows) + { + $con = Propel::getConnection(); + + $p_start_str = $p_start->format("Y-m-d H:i:s"); + $p_end_str = $p_end->format("Y-m-d H:i:s"); + + + //We need to search 24 hours before and after the show times so that that we + //capture all of the show's contents. + $p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + $p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + + $templateSql = <<= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) + ) +SQL; + + + $filesSql = str_replace("%%columns%%", + $filesColumns, + $templateSql); + $filesSql= str_replace("%%join%%", + $filesJoin, + $filesSql); + + $streamColumns = <<= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) + ) + LEFT JOIN cc_subjs AS sub ON (ws.creator_id = sub.id) +SQL; + + $streamSql = str_replace("%%columns%%", + $streamColumns, + $templateSql); + $streamSql = str_replace("%%join%%", + $streamJoin, + $streamSql); + + + $showPredicate = ""; + if (count($p_shows) > 0) { + $showPredicate = " AND show_id IN (".implode(",", $p_shows).")"; + } + + $sql = <<= '{$p_start_str}' + AND si.starts < '{$p_end_str}') + OR (si.ends > '{$p_start_str}' + AND si.ends <= '{$p_end_str}') + OR (si.starts <= '{$p_start_str}' + AND si.ends >= '{$p_end_str}')) +ORDER BY si_starts, + sched_starts; +SQL; + + $rows = $con->query($sql)->fetchAll(PDO::FETCH_ASSOC); + + return $rows; + } + + public static function UpdateMediaPlayedStatus($p_id) + { + $con = Propel::getConnection(); + $sql = "UPDATE cc_schedule" + ." SET media_item_played=TRUE"; + // we need to update 'broadcasted' column as well + // check the current switch status + $live_dj = Application_Model_Preference::GetSourceSwitchStatus('live_dj') == 'on'; + $master_dj = Application_Model_Preference::GetSourceSwitchStatus('master_dj') == 'on'; + $scheduled_play = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play') == 'on'; + + if (!$live_dj && !$master_dj && $scheduled_play) { + $sql .= ", broadcasted=1"; + } + + $sql .= " WHERE id=$p_id"; + + $retVal = $con->exec($sql); + + return $retVal; + } + + public static function UpdateBrodcastedStatus($dateTime, $value) + { + $now = $dateTime->format("Y-m-d H:i:s"); + + $sql = <<= :ends::TIMESTAMP +SQL; + + $retVal = Application_Common_Database::prepareAndExecute($sql, array( + ':broadcastedValue' => $value, + ':starts' => $now, + ':ends' => $now), 'execute'); + return $retVal; + } + + public static function getSchduledPlaylistCount() + { + $con = Propel::getConnection(); + $sql = "SELECT count(*) as cnt FROM cc_schedule"; + + return $con->query($sql)->fetchColumn(0); + } + + /** + * Convert a time string in the format "YYYY-MM-DD HH:mm:SS" + * to "YYYY-MM-DD-HH-mm-SS". + * + * @param string $p_time + * @return string + */ + private static function AirtimeTimeToPypoTime($p_time) + { + $p_time = substr($p_time, 0, 19); + $p_time = str_replace(" ", "-", $p_time); + $p_time = str_replace(":", "-", $p_time); + + return $p_time; + } + + /** + * Convert a time string in the format "YYYY-MM-DD-HH-mm-SS" to + * "YYYY-MM-DD HH:mm:SS". + * + * @param string $p_time + * @return string + */ + private static function PypoTimeToAirtimeTime($p_time) + { + $t = explode("-", $p_time); + + return $t[0]."-".$t[1]."-".$t[2]." ".$t[3].":".$t[4].":00"; + } + + /** + * Return true if the input string is in the format YYYY-MM-DD-HH-mm + * + * @param string $p_time + * @return boolean + */ + public static function ValidPypoTimeFormat($p_time) + { + $t = explode("-", $p_time); + if (count($t) != 5) { + return false; + } + foreach ($t as $part) { + if (!is_numeric($part)) { + return false; + } + } + + return true; + } + + /** + * Converts a time value as a string (with format HH:MM:SS.mmmmmm) to + * millisecs. + * + * @param string $p_time + * @return int + */ + public static function WallTimeToMillisecs($p_time) + { + $t = explode(":", $p_time); + $millisecs = 0; + if (strpos($t[2], ".")) { + $secParts = explode(".", $t[2]); + $millisecs = $secParts[1]; + $millisecs = str_pad(substr($millisecs, 0, 3),3, '0'); + $millisecs = intval($millisecs); + $seconds = intval($secParts[0]); + } else { + $seconds = intval($t[2]); + } + $ret = $millisecs + ($seconds * 1000) + ($t[1] * 60 * 1000) + ($t[0] * 60 * 60 * 1000); + + return $ret; + } + + /** + * Compute the difference between two times in the format . + * "HH:MM:SS.mmmmmm" Note: currently only supports calculating . + * millisec differences . + * + * @param string $p_time1 + * @param string $p_time2 + * @return double + */ + private static function TimeDiff($p_time1, $p_time2) + { + $parts1 = explode(".", $p_time1); + $parts2 = explode(".", $p_time2); + $diff = 0; + if ( (count($parts1) > 1) && (count($parts2) > 1) ) { + $millisec1 = substr($parts1[1], 0, 3); + $millisec1 = str_pad($millisec1, 3, "0"); + $millisec1 = intval($millisec1); + $millisec2 = substr($parts2[1], 0, 3); + $millisec2 = str_pad($millisec2, 3, "0"); + $millisec2 = intval($millisec2); + $diff = abs($millisec1 - $millisec2)/1000; + } + + return $diff; + } + + /** + * Returns an array of schedule items from cc_schedule table. Tries + * to return at least 3 items (if they are available). The parameters + * $p_startTime and $p_endTime specify the range. Schedule items returned + * do not have to be entirely within this range. It is enough that the end + * or beginning of the scheduled item is in the range. + * + * + * @param string $p_startTime + * In the format YYYY-MM-DD HH:MM:SS.nnnnnn + * @param string $p_endTime + * In the format YYYY-MM-DD HH:MM:SS.nnnnnn + * @return array + * Returns null if nothing found, else an array of associative + * arrays representing each row. + */ + public static function getItems($p_startTime, $p_endTime) + { + $baseQuery = << :startTime1 + AND st.starts < :endTime + AND st.playout_status > 0 + AND si.ends > :startTime2 + AND si.modified_instance = 'f' +ORDER BY st.starts +SQL; + + $sql = $baseQuery." ".$predicates; + + $rows = Application_Common_Database::prepareAndExecute($sql, array( + ':startTime1' => $p_startTime, + ':endTime' => $p_endTime, + ':startTime2' => $p_startTime)); + + if (count($rows) < 3) { + $dt = new DateTime("@".time()); + $dt->add(new DateInterval("PT24H")); + $range_end = $dt->format("Y-m-d H:i:s"); + + $predicates = << :startTime1 + AND st.starts < :rangeEnd + AND st.playout_status > 0 + AND si.ends > :startTime2 + AND si.modified_instance = 'f' +ORDER BY st.starts LIMIT 3 +SQL; + + $sql = $baseQuery." ".$predicates." "; + $rows = Application_Common_Database::prepareAndExecute($sql, + array( + ':startTime1' => $p_startTime, + ':rangeEnd' => $range_end, + ':startTime2' => $p_startTime)); + } + + return $rows; + } + + /** + * This function will ensure that an existing index in the + * associative array is never overwritten, instead appending + * _0, _1, _2, ... to the end of the key to make sure it is unique + */ + private static function appendScheduleItem(&$data, $time, $item) + { + $key = $time; + $i = 0; + + while (array_key_exists($key, $data["media"])) { + $key = "{$time}_{$i}"; + $i++; + } + + $data["media"][$key] = $item; + } + + private static function createInputHarborKickTimes(&$data, $range_start, $range_end) + { + $utcTimeZone = new DateTimeZone("UTC"); + $kick_times = Application_Model_ShowInstance::GetEndTimeOfNextShowWithLiveDJ($range_start, $range_end); + foreach ($kick_times as $kick_time_info) { + $kick_time = $kick_time_info['ends']; + $temp = explode('.', Application_Model_Preference::GetDefaultTransitionFade()); + // we round down transition time since PHP cannot handle millisecond. We need to + // handle this better in the future + $transition_time = intval($temp[0]); + $switchOffDataTime = new DateTime($kick_time, $utcTimeZone); + $switch_off_time = $switchOffDataTime->sub(new DateInterval('PT'.$transition_time.'S')); + $switch_off_time = $switch_off_time->format("Y-m-d H:i:s"); + + $kick_start = self::AirtimeTimeToPypoTime($kick_time); + $data["media"][$kick_start]['start'] = $kick_start; + $data["media"][$kick_start]['end'] = $kick_start; + $data["media"][$kick_start]['event_type'] = "kick_out"; + $data["media"][$kick_start]['type'] = "event"; + $data["media"][$kick_start]['independent_event'] = true; + + if ($kick_time !== $switch_off_time) { + $switch_start = self::AirtimeTimeToPypoTime($switch_off_time); + $data["media"][$switch_start]['start'] = $switch_start; + $data["media"][$switch_start]['end'] = $switch_start; + $data["media"][$switch_start]['event_type'] = "switch_off"; + $data["media"][$switch_start]['type'] = "event"; + $data["media"][$switch_start]['independent_event'] = true; + } + } + } + + private static function createFileScheduleEvent(&$data, $item, $media_id, $uri) + { + $start = self::AirtimeTimeToPypoTime($item["start"]); + $end = self::AirtimeTimeToPypoTime($item["end"]); + + list(,,,$start_hour,,) = explode("-", $start); + list(,,,$end_hour,,) = explode("-", $end); + + $same_hour = $start_hour == $end_hour; + $independent_event = !$same_hour; + + $replay_gain = is_null($item["replay_gain"]) ? "0": $item["replay_gain"]; + $replay_gain += Application_Model_Preference::getReplayGainModifier(); + + if ( !Application_Model_Preference::GetEnableReplayGain() ) { + $replay_gain = 0; + } + + $schedule_item = array( + 'id' => $media_id, + 'type' => 'file', + 'row_id' => $item["id"], + 'uri' => $uri, + 'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]), + 'fade_out' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_out"]), + 'cue_in' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_in"]), + 'cue_out' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_out"]), + 'start' => $start, + 'end' => $end, + 'show_name' => $item["show_name"], + 'replay_gain' => $replay_gain, + 'independent_event' => $independent_event, + ); + + if ($schedule_item['cue_in'] > $schedule_item['cue_out']) { + $schedule_item['cue_in'] = $schedule_item['cue_out']; + } + self::appendScheduleItem($data, $start, $schedule_item); + } + + private static function createStreamScheduleEvent(&$data, $item, $media_id, $uri) + { + $start = self::AirtimeTimeToPypoTime($item["start"]); + $end = self::AirtimeTimeToPypoTime($item["end"]); + + //create an event to start stream buffering 5 seconds ahead of the streams actual time. + $buffer_start = new DateTime($item["start"], new DateTimeZone('UTC')); + $buffer_start->sub(new DateInterval("PT5S")); + + $stream_buffer_start = self::AirtimeTimeToPypoTime($buffer_start->format("Y-m-d H:i:s")); + + $schedule_item = array( + 'start' => $stream_buffer_start, + 'end' => $stream_buffer_start, + 'uri' => $uri, + 'row_id' => $item["id"], + 'type' => 'stream_buffer_start', + 'independent_event' => true + ); + + self::appendScheduleItem($data, $start, $schedule_item); + + $schedule_item = array( + 'id' => $media_id, + 'type' => 'stream_output_start', + 'row_id' => $item["id"], + 'uri' => $uri, + 'start' => $start, + 'end' => $end, + 'show_name' => $item["show_name"], + 'row_id' => $item["id"], + 'independent_event' => true + ); + self::appendScheduleItem($data, $start, $schedule_item); + + //since a stream never ends we have to insert an additional "kick stream" event. The "start" + //time of this event is the "end" time of the stream minus 1 second. + $dt = new DateTime($item["end"], new DateTimeZone('UTC')); + $dt->sub(new DateInterval("PT1S")); + + $stream_end = self::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s")); + + $schedule_item = array( + 'start' => $stream_end, + 'end' => $stream_end, + 'uri' => $uri, + 'type' => 'stream_buffer_end', + 'row_id' => $item["id"], + 'independent_event' => true + ); + self::appendScheduleItem($data, $stream_end, $schedule_item); + + $schedule_item = array( + 'start' => $stream_end, + 'end' => $stream_end, + 'uri' => $uri, + 'type' => 'stream_output_end', + 'independent_event' => true + ); + self::appendScheduleItem($data, $stream_end, $schedule_item); + } + + private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime) + { + $CC_CONFIG = Config::getConfig(); + + /* if $p_fromDateTime and $p_toDateTime function parameters are null, + then set range * from "now" to "now + 24 hours". */ + if (is_null($p_fromDateTime)) { + $t1 = new DateTime("@".time()); + $range_start = $t1->format("Y-m-d H:i:s"); + } else { + $range_start = Application_Model_Schedule::PypoTimeToAirtimeTime($p_fromDateTime); + } + if (is_null($p_fromDateTime)) { + $t2 = new DateTime("@".time()); + + $cache_ahead_hours = $CC_CONFIG["cache_ahead_hours"]; + + if (is_numeric($cache_ahead_hours)) { + //make sure we are not dealing with a float + $cache_ahead_hours = intval($cache_ahead_hours); + } else { + $cache_ahead_hours = 1; + } + + $t2->add(new DateInterval("PT".$cache_ahead_hours."H")); + $range_end = $t2->format("Y-m-d H:i:s"); + } else { + $range_end = Application_Model_Schedule::PypoTimeToAirtimeTime($p_toDateTime); + } + + return array($range_start, $range_end); + } + + + private static function createScheduledEvents(&$data, $range_start, $range_end) + { + $utcTimeZone = new DateTimeZone("UTC"); + $items = self::getItems($range_start, $range_end); + foreach ($items as $item) { + $showEndDateTime = new DateTime($item["show_end"], $utcTimeZone); + + $trackStartDateTime = new DateTime($item["start"], $utcTimeZone); + $trackEndDateTime = new DateTime($item["end"], $utcTimeZone); + + if ($trackStartDateTime->getTimestamp() > $showEndDateTime->getTimestamp()) { + //do not send any tracks that start past their show's end time + continue; + } + + if ($trackEndDateTime->getTimestamp() > $showEndDateTime->getTimestamp()) { + $di = $trackStartDateTime->diff($showEndDateTime); + + $item["cue_out"] = $di->format("%H:%i:%s").".000"; + $item["end"] = $showEndDateTime->format("Y-m-d H:i:s"); + } + + if (!is_null($item['file_id'])) { + //row is from "file" + $media_id = $item['file_id']; + $storedFile = Application_Model_StoredFile::Recall($media_id); + $uri = $storedFile->getFilePath(); + self::createFileScheduleEvent($data, $item, $media_id, $uri); + } elseif (!is_null($item['stream_id'])) { + //row is type "webstream" + $media_id = $item['stream_id']; + $uri = $item['url']; + self::createStreamScheduleEvent($data, $item, $media_id, $uri); + } else { + throw new Exception("Unknown schedule type: ".print_r($item, true)); + } + + } + } + + /* Check if two events are less than or equal to 1 second apart + */ + public static function areEventsLinked($event1, $event2) { + $dt1 = DateTime::createFromFormat("Y-m-d-H-i-s", $event1['start']); + $dt2 = DateTime::createFromFormat("Y-m-d-H-i-s", $event2['start']); + + $seconds = $dt2->getTimestamp() - $dt1->getTimestamp(); + return $seconds <= 1; + } + + /** + * Streams are a 4 stage process. + * 1) start buffering stream 5 seconds ahead of its start time + * 2) at the start time tell liquidsoap to switch to this source + * 3) at the end time, tell liquidsoap to stop reading this stream + * 4) at the end time, tell liquidsoap to switch away from input.http source. + * + * When we have two streams back-to-back, some of these steps are unnecessary + * for the second stream. Instead of sending commands 1,2,3,4,1,2,3,4 we should + * send 1,2,1,2,3,4 - We don't need to tell liquidsoap to stop reading (#3), because #1 + * of the next stream implies this when we pass in a new url. We also don't need #4. + * + * There's a special case here is well. When the back-to-back streams are the same, we + * can collapse the instructions 1,2,(3,4,1,2),3,4 to 1,2,3,4. We basically cut out the + * middle part. This function handles this. + */ + private static function foldData(&$data) + { + $previous_key = null; + $previous_val = null; + $previous_previous_key = null; + $previous_previous_val = null; + $previous_previous_previous_key = null; + $previous_previous_previous_val = null; + foreach ($data as $k => $v) { + + if ($v["type"] == "stream_output_start" + && !is_null($previous_previous_val) + && $previous_previous_val["type"] == "stream_output_end" + && self::areEventsLinked($previous_previous_val, $v)) { + + unset($data[$previous_previous_previous_key]); + unset($data[$previous_previous_key]); + unset($data[$previous_key]); + if ($previous_previous_val['uri'] == $v['uri']) { + unset($data[$k]); + } + } + + $previous_previous_previous_key = $previous_previous_key; + $previous_previous_previous_val = $previous_previous_val; + $previous_previous_key = $previous_key; + $previous_previous_val = $previous_val; + $previous_key = $k; + $previous_val = $v; + } + } + + public static function getSchedule($p_fromDateTime = null, $p_toDateTime = null) + { + list($range_start, $range_end) = self::getRangeStartAndEnd($p_fromDateTime, $p_toDateTime); + + $data = array(); + $data["media"] = array(); + + //Harbor kick times *MUST* be ahead of schedule events, so that pypo + //executes them first. + self::createInputHarborKickTimes($data, $range_start, $range_end); + self::createScheduledEvents($data, $range_start, $range_end); + + self::foldData($data["media"]); + return $data; + } + + public static function deleteAll() + { + $con = Propel::getConnection(); + $con->exec("TRUNCATE TABLE cc_schedule"); + } + + public static function deleteWithFileId($fileId) + { + $sql = "DELETE FROM cc_schedule WHERE file_id=:file_id"; + Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); + } + + public static function createNewFormSections($p_view) + { + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $p_view->what = $formWhat; + $p_view->when = $formWhen; + $p_view->repeats = $formRepeats; + $p_view->who = $formWho; + $p_view->style = $formStyle; + $p_view->live = $formLive; + + $formWhat->populate(array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + $formWhen->populate(array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $p_view->rr = $formRecord; + $p_view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $p_view->rebroadcast = $formRebroadcast; + $p_view->addNewShow = true; + } + + /* This function is responsible for handling the case where an individual + * show instance in a repeating show was edited (via the context menu in the Calendar). + * There is still lots of clean-up to do. For example we shouldn't be passing $controller into + * this method to manipulate the view (this should be done inside the controller function). With + * 2.1 deadline looming, this is OK for now. -Martin */ + public static function updateShowInstance($data, $controller) + { + $formWhat = new Application_Form_AddShowWhat(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formWho = new Application_Form_AddShowWho(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + $when = $formWhen->isValid($data); + + if ($when && $formWhen->checkReliantFields($data, true, null, true)) { + $start_dt = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time'], + new DateTimeZone(date_default_timezone_get())); + $start_dt->setTimezone(new DateTimeZone('UTC')); + + $end_dt = new DateTime($data['add_show_end_date_no_repeat']." ".$data['add_show_end_time'], + new DateTimeZone(date_default_timezone_get())); + $end_dt->setTimezone(new DateTimeZone('UTC')); + + $ccShowInstance = CcShowInstancesQuery::create()->findPK($data["add_show_instance_id"]); + $ccShowInstance->setDbStarts($start_dt); + $ccShowInstance->setDbEnds($end_dt); + $ccShowInstance->save(); + + Application_Model_Schedule::createNewFormSections($controller->view); + + return true; + } else { + $formWhat->disable(); + $formWhen->disableRepeatCheckbox(); + $formRepeats->disable(); + $formWho->disable(); + $formStyle->disable(); + //$formLive->disable(); + + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->live = $formLive; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + + //$formRecord->disable(); + //$formAbsoluteRebroadcast->disable(); + //$formRebroadcast->disable(); + + return false; + } + } + + /* This function is responsible for handling the case where the entire show (not a single show instance) + * was edited (via the context menu in the Calendar). + * There is still lots of clean-up to do. For example we shouldn't be passing $controller into + * this method to manipulate the view (this should be done inside the controller function). With + * 2.1 deadline looming, this is OK for now. + * Another clean-up is to move all the form manipulation to the proper form class..... + * -Martin + */ + public static function addUpdateShow($data, $controller, $validateStartDate, + $originalStartDate=null, $update=false, $instanceId=null) + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $record = false; + + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $what = $formWhat->isValid($data); + $when = $formWhen->isValid($data); + $live = $formLive->isValid($data); + if ($when) { + $when = $formWhen->checkReliantFields($data, $validateStartDate, $originalStartDate, $update, $instanceId); + } + + //The way the following code works is that is parses the hour and + //minute from a string with the format "1h 20m" or "2h" or "36m". + //So we are detecting whether an hour or minute value exists via strpos + //and then parse appropriately. A better way to do this in the future is + //actually pass the format from javascript in the format hh:mm so we don't + //have to do this extra String parsing. + $hPos = strpos($data["add_show_duration"], 'h'); + $mPos = strpos($data["add_show_duration"], 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($data["add_show_duration"], 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($data["add_show_duration"], $hPos, -1 )); + } + + $data["add_show_duration"] = $hValue.":".$mValue; + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + + $record = $formRecord->isValid($data); + + if ($data["add_show_repeats"]) { + $repeats = $formRepeats->isValid($data); + if ($repeats) { + $repeats = $formRepeats->checkReliantFields($data); + } + $formAbsoluteRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroadAb = 1; + + if ($data["add_show_rebroadcast"]) { + $rebroad = $formRebroadcast->isValid($data); + if ($rebroad) { + $rebroad = $formRebroadcast->checkReliantFields($data); + } + } else { + $rebroad = 1; + } + } else { + $repeats = 1; + $formRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroad = 1; + + if ($data["add_show_rebroadcast"]) { + $rebroadAb = $formAbsoluteRebroadcast->isValid($data); + if ($rebroadAb) { + $rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data); + } + } else { + $rebroadAb = 1; + } + } + + $who = $formWho->isValid($data); + $style = $formStyle->isValid($data); + if ($what && $when && $repeats && $who && $style && $live) { + if ($record && $rebroadAb && $rebroad) { + if ($isAdminOrPM) { + Application_Model_Show::create($data); + } + + //send back a new form for the user. + Application_Model_Schedule::createNewFormSections($controller->view); + + //$controller->view->newForm = $controller->view->render('schedule/add-show-form.phtml'); + return true; + } else { + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + $controller->view->live = $formLive; + //$controller->view->addNewShow = !$editShow; + + //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); + return false; + + } + } else { + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->live = $formLive; + + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + //$controller->view->addNewShow = !$editShow; + //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); + return false; + } + } + + public static function checkOverlappingShows($show_start, $show_end, + $update=false, $instanceId=null, $showId=null) + { + $overlapping = false; + + $params = array( + ':show_end1' => $show_end->format('Y-m-d H:i:s'), + ':show_end2' => $show_end->format('Y-m-d H:i:s'), + ':show_end3' => $show_end->format('Y-m-d H:i:s') + ); + + + /* If a show is being edited, exclude it from the query + * In both cases (new and edit) we only grab shows that + * are scheduled 2 days prior + */ + if ($update) { + $sql = <<= (date(:show_end3) - INTERVAL '2 days') + AND modified_instance = FALSE +SQL; + if (is_null($showId)) { + $sql .= <<= (date(:show_end3) - INTERVAL '2 days') + AND modified_instance = FALSE +ORDER BY ends +SQL; + + $rows = Application_Common_Database::prepareAndExecute($sql, array( + ':show_end1' => $show_end->format('Y-m-d H:i:s'), + ':show_end2' => $show_end->format('Y-m-d H:i:s'), + ':show_end3' => $show_end->format('Y-m-d H:i:s')), 'all'); + } + + foreach ($rows as $row) { + $start = new DateTime($row["starts"], new DateTimeZone('UTC')); + $end = new DateTime($row["ends"], new DateTimeZone('UTC')); + + if ($show_start->getTimestamp() < $end->getTimestamp() && + $show_end->getTimestamp() > $start->getTimestamp()) { + $overlapping = true; + break; + } + } + + return $overlapping; + } + + public static function GetType($p_scheduleId){ + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + if ($scheduledItem->getDbFileId() == null) { + return 'webstream'; + } else { + return 'file'; + } + } + + public static function GetFileId($p_scheduleId) + { + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + + return $scheduledItem->getDbFileId(); + } + + public static function GetStreamId($p_scheduleId) + { + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + + return $scheduledItem->getDbStreamId(); + } +} diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php new file mode 100644 index 000000000..983d1bd6f --- /dev/null +++ b/airtime_mvc/application/services/ScheduleService.php @@ -0,0 +1,90 @@ +removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $forms = array(); + $forms["what"] = $formWhat; + $forms["who"] = $formWho; + $forms["when"] = $formWhen; + $forms["repeats"] = $formRepeats; + $forms["style"] = $formStyle; + $forms["live"] = $formLive; + $forms["record"] = $formRecord; + $forms["abs_record"] = $formAbsoluteRebroadcast; + $forms["rebroadcast"] = $formRebroadcast; + + return $forms; + } + + /** + * + * Popluates the what, when, and repeat forms + * with default values + */ + public function populateNewShowForms($formWhat, $formWhen, $formRepeats) + { + $formWhat->populate( + array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + + $formWhen->populate( + array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + } + + public function populateForm($form, $values) + { + $form->populate($values); + } + + /** + * + * Validates show forms + * + * @return array of booleans + */ + public function validateShowForms($forms) + { + + } + + /** + * + * Creates a new show if form data is valid + */ + public function createShow() + { + + } +} \ No newline at end of file From 3e4942122187ed87bf74cf7140096bbc269730ca Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 25 Feb 2013 09:15:03 -0500 Subject: [PATCH 002/128] Added comments to Schedule Service --- .../application/controllers/ScheduleController.php | 1 + airtime_mvc/application/models/Schedule.php | 7 +++---- airtime_mvc/application/services/ScheduleService.php | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 9ca879918..ae91308e4 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -871,6 +871,7 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } + // TODO: move this to js $data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_day_check'] = $this->_getParam('days'); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 2778074d2..36aedf96c 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1220,10 +1220,9 @@ SQL; $controller->view->who = $formWho; $controller->view->style = $formStyle; $controller->view->live = $formLive; - - $controller->view->rr = $formRecord; - $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $controller->view->rebroadcast = $formRebroadcast; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; //$controller->view->addNewShow = !$editShow; //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); return false; diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 983d1bd6f..f5f397561 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -2,6 +2,13 @@ class Application_Service_ScheduleService { +/* + * Form stuff begins here + * Typically I would keep form creation and validation + * in the controller but since shows require 9 forms, + * the controller will become too fat. + * Maybe we should create a special form show service? + */ /** * * @return array of schedule forms @@ -78,7 +85,9 @@ class Application_Service_ScheduleService { } - +/* + * Form stuff ends + */ /** * * Creates a new show if form data is valid From 9f0baba4f8c6f7fbbdf5627eeb60d2e5c0961b95 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 25 Feb 2013 17:31:43 -0500 Subject: [PATCH 003/128] - Moved all form validation to it's own function in schedule service - Moved show creation to it's own function in schedule service --- .../controllers/ScheduleController.php | 29 +++-- .../forms/AddShowAbsoluteRebroadcastDates.php | 8 ++ .../forms/AddShowRebroadcastDates.php | 8 ++ .../application/forms/AddShowRepeats.php | 8 ++ airtime_mvc/application/forms/AddShowWhen.php | 8 ++ airtime_mvc/application/models/Schedule.php | 4 +- airtime_mvc/application/models/Show.php | 32 +++--- .../application/services/ScheduleService.php | 104 +++++++++++++++++- 8 files changed, 167 insertions(+), 34 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index ae91308e4..ea95d4bc7 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -104,7 +104,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->repeats = $forms["repeats"]; $this->view->live = $forms["live"]; $this->view->rr = $forms["record"]; - $this->view->absoluteRebroadcast = $forms["abs_record"]; + $this->view->absoluteRebroadcast = $forms["abs_rebroadcast"]; $this->view->rebroadcast = $forms["rebroadcast"]; $this->view->who = $forms["who"]; $this->view->style = $forms["style"]; @@ -879,19 +879,26 @@ class ScheduleController extends Zend_Controller_Action $data['add_show_day_check'] = null; } - $validateStartDate = true; - $success = Application_Model_Schedule::addUpdateShow($data, $this, - $validateStartDate); + $forms = $this->service_schedule->createShowForms(); - if ($success) { - $this->view->addNewShow = true; - $this->view->newForm = $this->view->render( - 'schedule/add-show-form.phtml'); + $this->view->what = $forms["what"]; + $this->view->when = $forms["when"]; + $this->view->repeats = $forms["repeats"]; + $this->view->live = $forms["live"]; + $this->view->rr = $forms["record"]; + $this->view->absoluteRebroadcast = $forms["abs_rebroadcast"]; + $this->view->rebroadcast = $forms["rebroadcast"]; + $this->view->who = $forms["who"]; + $this->view->style = $forms["style"]; + + $this->view->addNewShow = true; + + if ($this->service_schedule->validateShowForms($forms, $data)) { + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + $this->service_schedule->createShow($data); Logging::debug("Show creation succeeded"); } else { - $this->view->addNewShow = true; - $this->view->form = $this->view->render( - 'schedule/add-show-form.phtml'); + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); Logging::debug("Show creation failed"); } } diff --git a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php index a2f5b5cf3..4c43000c0 100644 --- a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php @@ -40,6 +40,14 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { $noError = true; diff --git a/airtime_mvc/application/forms/AddShowRebroadcastDates.php b/airtime_mvc/application/forms/AddShowRebroadcastDates.php index 74725c98c..58d6af872 100644 --- a/airtime_mvc/application/forms/AddShowRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowRebroadcastDates.php @@ -45,6 +45,14 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { $noError = true; diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index f0c2609e2..375942894 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -66,6 +66,14 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { if (!$formData['add_show_no_end']) { diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 92873f153..9f73affbd 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -87,6 +87,14 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } + public function isWhenFormValid($formData, $validateStartDate) { + if (parent::isValid($formData)) { + return self::checkReliantFields($formData, $validateStartDate); + } else { + return false; + } + } + public function checkReliantFields($formData, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) { $valid = true; diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 36aedf96c..6b19c5e3d 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1088,7 +1088,7 @@ SQL; * Another clean-up is to move all the form manipulation to the proper form class..... * -Martin */ - public static function addUpdateShow($data, $controller, $validateStartDate, + /*public static function addUpdateShow($data, $controller, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) { $userInfo = Zend_Auth::getInstance()->getStorage()->read(); @@ -1227,7 +1227,7 @@ SQL; //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); return false; } - } + }*/ public static function checkOverlappingShows($show_start, $show_end, $update=false, $instanceId=null, $showId=null) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index f485e41bc..493f3ca37 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1113,11 +1113,13 @@ SQL; */ public static function create($data) { - $startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']); - $utcStartDateTime = clone $startDateTime; - $utcStartDateTime->setTimezone(new DateTimeZone('UTC')); + /*$startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']);*/ + + // these are not used + /*$utcStartDateTime = clone $startDateTime; + $utcStartDateTime->setTimezone(new DateTimeZone('UTC'));*/ - if ($data['add_show_no_end']) { + /*if ($data['add_show_no_end']) { $endDate = NULL; } elseif ($data['add_show_repeats']) { $endDateTime = new DateTime($data['add_show_end_date']); @@ -1129,28 +1131,28 @@ SQL; //$endDateTime->setTimezone(new DateTimeZone('UTC')); $endDateTime->add(new DateInterval("P1D")); $endDate = $endDateTime->format("Y-m-d"); - } + }*/ //What we are doing here is checking if the show repeats or if //any repeating days have been checked. If not, then by default //the "selected" DOW is the initial day. //DOW in local time. - $startDow = date("w", $startDateTime->getTimestamp()); + /*$startDow = date("w", $startDateTime->getTimestamp()); if (!$data['add_show_repeats']) { $data['add_show_day_check'] = array($startDow); } elseif ($data['add_show_repeats'] && $data['add_show_day_check'] == "") { $data['add_show_day_check'] = array($startDow); - } + }*/ //find repeat type or set to a non repeating show. - $repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1; + /*$repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;*/ if ($data['add_show_id'] == -1) { - $ccShow = new CcShow(); + /*$ccShow = new CcShow();*/ } else { $ccShow = CcShowQuery::create()->findPK($data['add_show_id']); } - $ccShow->setDbName($data['add_show_name']); + /*$ccShow->setDbName($data['add_show_name']); $ccShow->setDbDescription($data['add_show_description']); $ccShow->setDbUrl($data['add_show_url']); $ccShow->setDbGenre($data['add_show_genre']); @@ -1160,11 +1162,11 @@ SQL; $ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1); $ccShow->setDbLiveStreamUser($data['custom_username']); $ccShow->setDbLiveStreamPass($data['custom_password']); - $ccShow->save(); + $ccShow->save();*/ - $showId = $ccShow->getDbId(); + /*$showId = $ccShow->getDbId();*/ - $isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0; + /*$isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0;*/ if ($data['add_show_id'] != -1) { $show = new Application_Model_Show($showId); @@ -1178,7 +1180,7 @@ SQL; } //don't set day for monthly repeat type, it's invalid. - if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { + /*if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { $showDay = new CcShowDays(); $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); @@ -1215,7 +1217,7 @@ SQL; $showDay->save(); } } - } + }*/ //check if we are adding or updating a show, and if updating //erase all the show's future show_rebroadcast information first. diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index f5f397561..1204f689c 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -43,7 +43,7 @@ class Application_Service_ScheduleService $forms["style"] = $formStyle; $forms["live"] = $formLive; $forms["record"] = $formRecord; - $forms["abs_record"] = $formAbsoluteRebroadcast; + $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; $forms["rebroadcast"] = $formRebroadcast; return $forms; @@ -79,21 +79,113 @@ class Application_Service_ScheduleService * * Validates show forms * - * @return array of booleans + * @return boolean */ - public function validateShowForms($forms) + public function validateShowForms($forms, $formData, $validateStartDate = true) { - + $what = $forms["what"]->isValid($formData); + $live = $forms["live"]->isValid($formData); + $record = $forms["record"]->isValid($formData); + $who = $forms["who"]->isValid($formData); + $style = $forms["style"]->isValid($formData); + $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate); + + $repeats = true; + if ($formData["add_show_repeats"]) { + $repeats = $forms["repeats"]->isValid($formData); + + /* + * Make the absolute rebroadcast form valid since + * it does not get used if the show is repeating + */ + $forms["abs_rebroadcast"]->reset(); + $absRebroadcast = true; + + $rebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $rebroadcast = $forms["rebroadcast"]->isValid($formData); + } + } else { + /* + * Make the rebroadcast form valid since it does + * not get used if the show is not repeating. + * Instead, we use the absolute rebroadcast form + */ + $forms["rebroadcast"]->reset(); + $rebroadcast = true; + + $absRebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); + } + } + + if ($what && $live && $record && $who && $style && $when && + $repeats && $absRebroadcast && $rebroadcast) { + return true; + } else { + return false; + } } /* * Form stuff ends */ + + public function formatShowDuration($duration) { + $hPos = strpos($duration, 'h'); + $mPos = strpos($duration, 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($duration, 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($duration, $hPos, -1 )); + } + + return $hValue.":".$mValue; + } + /** * * Creates a new show if form data is valid */ - public function createShow() + public function createShow($showData) { - + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + if ($isAdminOrPM) { + $service_show = new Application_Service_ShowService(); + + //create ccShow + $ccShow = new CcShow(); + $ccShow = $service_show->setShow($ccShow, $showData); + + //create ccShowDay + $service_show->createShowDays( + $showData, $ccShow->getDbId(), $user->getId(), $repeatType, $isRecorded); + + //create ccShowHosts + + //create ccShowRebroadcast + + //populate ccShowInstances + } } + } \ No newline at end of file From 2717c0845b47d1c4c9541cfec5e8a5219acc59dc Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 10:20:02 -0500 Subject: [PATCH 004/128] Created show service --- airtime_mvc/application/models/Show.php | 8 +- airtime_mvc/application/models/_old_Show.php | 2241 +++++++++++++++++ .../application/services/ScheduleService.php | 11 +- .../application/services/ShowService.php | 145 ++ 4 files changed, 2397 insertions(+), 8 deletions(-) create mode 100644 airtime_mvc/application/models/_old_Show.php create mode 100644 airtime_mvc/application/services/ShowService.php diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 493f3ca37..d6f9db98b 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1229,7 +1229,7 @@ SQL; //adding rows to cc_show_rebroadcast /* TODO: Document magic constant 10 and define it properly somewhere --RG */ - if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { + /*if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { for ($i=1; $i<=10; $i++) { if ($data['add_show_rebroadcast_date_'.$i]) { $showRebroad = new CcShowRebroadcast(); @@ -1266,14 +1266,14 @@ SQL; $showRebroad->save(); } } - } + }*/ //check if we are adding or updating a show, and if updating //erase all the show's show_rebroadcast information first. if ($data['add_show_id'] != -1) { CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete(); } - if (is_array($data['add_show_hosts'])) { + /*if (is_array($data['add_show_hosts'])) { //add selected hosts to cc_show_hosts table. foreach ($data['add_show_hosts'] as $host) { $showHost = new CcShowHosts(); @@ -1281,7 +1281,7 @@ SQL; $showHost->setDbHost($host); $showHost->save(); } - } + }*/ if ($data['add_show_id'] != -1) { $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); diff --git a/airtime_mvc/application/models/_old_Show.php b/airtime_mvc/application/models/_old_Show.php new file mode 100644 index 000000000..f485e41bc --- /dev/null +++ b/airtime_mvc/application/models/_old_Show.php @@ -0,0 +1,2241 @@ +_showId = $showId; + } + + public function getName() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbName(); + } + + public function setName($name) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbName($name); + Application_Model_RabbitMq::PushSchedule(); + } + + public function setAirtimeAuthFlag($flag) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingAirtimeAuth($flag); + $show->save(); + } + + public function setCustomAuthFlag($flag) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingCustomAuth($flag); + $show->save(); + } + + public function setCustomUsername($username) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUser($username); + $show->save(); + } + + public function setCustomPassword($password) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamPass($password); + $show->save(); + } + + public function getDescription() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbDescription(); + } + + public function setDescription($description) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbDescription($description); + } + + public function getColor() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbColor(); + } + + public function setColor($color) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbColor($color); + } + + public function getUrl() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbUrl(); + } + + /*TODO : This method is not actually used anywhere as far as I can tell. We + can safely remove it and probably many other superfluous methods. + --RG*/ + + public function setUrl($p_url) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbUrl($p_url); + } + + public function getGenre() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbGenre(); + } + + public function setGenre($p_genre) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbGenre($p_genre); + } + + public function getBackgroundColor() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbBackgroundColor(); + } + + public function setBackgroundColor($backgroundColor) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbBackgroundColor($backgroundColor); + } + + public function getId() + { + return $this->_showId; + } + + public function getHosts() + { + $sql = << $this->getId() ), 'all'); + + $res = array(); + foreach ($hosts as $host) { + $res[] = $host['first_name']." ".$host['last_name']; + } + return $res; + } + + public function getHostsIds() + { + $sql = << $this->getId() ), 'all'); + + return $hosts; + } + + /** + * remove everything about this show. + */ + public function delete() + { + //usually we hide the show-instance, but in this case we are deleting the show template + //so delete all show-instances as well. + CcShowInstancesQuery::create()->filterByDbOriginalShow($this->_showId)->delete(); + + $show = CcShowQuery::create()->findPK($this->_showId); + $show->delete(); + } + + public function resizeShow($deltaDay, $deltaMin) + { + $con = Propel::getConnection(); + + if ($deltaDay > 0) { + return _("Shows can have a max length of 24 hours."); + } + + $utc = new DateTimeZone("UTC"); + + $nowDateTime = new DateTime("now", $utc); + + $showInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($this->_showId) + ->find($con); + + /* Check two things: + 1. If the show being resized and any of its repeats end in the past + 2. If the show being resized and any of its repeats overlap + with other scheduled shows */ + + foreach ($showInstances as $si) { + $startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC")); + $endsDateTime = new DateTime($si->getDbEnds(), new DateTimeZone("UTC")); + + /* The user is moving the show on the calendar from the perspective + of local time. * incase a show is moved across a time change + border offsets should be added to the local * timestamp and + then converted back to UTC to avoid show time changes */ + $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $newStartsDateTime = Application_Model_ShowInstance::addDeltas($startsDateTime, $deltaDay, $deltaMin); + $newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin); + + if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) { + return _("End date/time cannot be in the past"); + } + + //convert our new starts/ends to UTC. + $newStartsDateTime->setTimezone($utc); + $newEndsDateTime->setTimezone($utc); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + $newStartsDateTime, $newEndsDateTime, true, $si->getDbId()); + + if ($overlapping) { + return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ". + "affects all of its repeats."); + } + } + + $hours = $deltaMin/60; + $hours = ($hours > 0) ? floor($hours) : ceil($hours); + $mins = abs($deltaMin % 60); + + //current timesamp in UTC. + $current_timestamp = gmdate("Y-m-d H:i:s"); + + $sql_gen = << :current_timestamp1) + AND ((ends + :deltaDay2::INTERVAL + :interval2::INTERVAL - starts) <= interval '24:00') +SQL; + + Application_Common_Database::prepareAndExecute($sql_gen, + array( + ':deltaDay1' => "$deltaDay days", + ':interval1' => "$hours:$mins", + ':show_id1' => $this->_showId, + ':current_timestamp1' => $current_timestamp, + ':deltaDay2' => "$deltaDay days", + ':interval2' => "$hours:$mins" + ), "execute"); + + $sql_gen = << "$deltaDay days", + ':interval3' => "$hours:$mins", + ':show_id2' => $this->_showId, + ':deltaDay4' => "$deltaDay days", + ':interval4' => "$hours:$mins" + ), "execute"); + + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $con->beginTransaction(); + + try { + //update the status flag in cc_schedule. + + /* Since we didn't use a propel object when updating + * cc_show_instances table we need to clear the instances + * so the correct information is retrieved from the db + */ + CcShowInstancesPeer::clearInstancePool(); + + $instances = CcShowInstancesQuery::create() + ->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN) + ->filterByDbShowId($this->_showId) + ->find($con); + + foreach ($instances as $instance) { + $instance->updateScheduleStatus($con); + } + + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + Logging::info("Couldn't update schedule status."); + Logging::info($e->getMessage()); + } + + Application_Model_RabbitMq::PushSchedule(); + } + + public function cancelShow($day_timestamp) + { + $timeinfo = explode(" ", $day_timestamp); + + CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->update(array('DbLastShow' => $timeinfo[0])); + + $sql = <<= :dayTimestamp::TIMESTAMP + AND show_id = :showId +SQL; + + $rows = Application_Common_Database::prepareAndExecute( $sql, array( + ':dayTimestamp' => $day_timestamp, + ':showId' => $this->getId()), 'all'); + + foreach ($rows as $row) { + try { + $showInstance = new Application_Model_ShowInstance($row["id"]); + $showInstance->delete($rabbitmqPush = false); + } catch (Exception $e) { + Logging::info($e->getMessage()); + } + } + + Application_Model_RabbitMq::PushSchedule(); + } + + /** + * This function is called when a repeating show is edited and the + * days that is repeats on have changed. More specifically, a day + * that the show originally repeated on has been "unchecked". + * + * Removes Show Instances that occur on days of the week specified + * by input array. For example, if array contains one value of "0", + * (0 = Sunday, 1=Monday) then all show instances that occur on + * Sunday are removed. + * + * @param array p_uncheckedDays + * An array specifying which days should be removed. (in the local timezone) + */ + public function removeUncheckedDaysInstances($p_uncheckedDays) + { + //need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC) + $daysRemovedUTC = array(); + + $showDays = CcShowDaysQuery::create() + ->filterByDbShowId($this->getId()) + ->find(); + + Logging::info("Unchecked days:"); + foreach ($p_uncheckedDays as $day) { + Logging::info($day); + } + + foreach ($showDays as $showDay) { + //Logging::info("Local show day is: {$showDay->getDbDay()}"); + //Logging::info("First show day is: {$showDay->getDbFirstShow()}"); + //Logging::info("Id show days is: {$showDay->getDbId()}"); + + if (in_array($showDay->getDbDay(), $p_uncheckedDays)) { + $showDay->reload(); + //Logging::info("Local show day is: {$showDay->getDbDay()}"); + //Logging::info("First show day is: {$showDay->getDbFirstShow()}"); + //Logging::info("Id show days is: {$showDay->getDbId()}"); + $startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone())); + //Logging::info("Show start day: {$startDay->format('Y-m-d H:i:s')}"); + $startDay->setTimezone(new DateTimeZone("UTC")); + //Logging::info("Show start day UTC: {$startDay->format('Y-m-d H:i:s')}"); + $daysRemovedUTC[] = $startDay->format('w'); + //Logging::info("UTC show day is: {$startDay->format('w')}"); + } + } + + $uncheckedDaysImploded = implode(",", $daysRemovedUTC); + $showId = $this->getId(); + + $esc_uncheckedDays = pg_escape_string($uncheckedDaysImploded); + $timestamp = gmdate("Y-m-d H:i:s"); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute( $sql, + array( + ":timestamp" => $timestamp, + ":showId" => $showId, + ), "execute"); + } + + /** + * Check whether the current show originated + * from a recording. + * + * @return boolean + * true if originated from recording, otherwise false. + */ + public function isRecorded() + { + $showInstancesRow = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getId()) + ->filterByDbRecord(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return !is_null($showInstancesRow); + } + + /** + * Check whether the current show has rebroadcasts of a recorded + * show. Should be used in conjunction with isRecorded(). + * + * @return boolean + * true if show has rebroadcasts, otherwise false. + */ + public function isRebroadcast() + { + $showInstancesRow = CcShowInstancesQuery::create() + ->filterByDbShowId($this->_showId) + ->filterByDbRebroadcast(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return !is_null($showInstancesRow); + } + + /** + * Get start time and absolute start date for a recorded + * shows rebroadcasts. For example start date format would be + * YYYY-MM-DD and time would HH:MM + * + * @return array + * array of associate arrays containing "start_date" and "start_time" + */ + public function getRebroadcastsAbsolute() + { + $sql = << $this->getId() ), 'all' ); + + $rebroadcastsLocal = array(); + //get each rebroadcast show in cc_show_instances, convert to current timezone to get start date/time. + /*TODO: refactor the following code to get rid of the $i temporary + variable. -- RG*/ + $i = 0; + + $utc = new DateTimeZone("UTC"); + $dtz = new DateTimeZone( date_default_timezone_get() ); + + foreach ($rebroadcasts as $show) { + $startDateTime = new DateTime($show["starts"], $utc); + $startDateTime->setTimezone($dtz); + + $rebroadcastsLocal[$i]["start_date"] = + $startDateTime->format("Y-m-d"); + $rebroadcastsLocal[$i]["start_time"] = + $startDateTime->format("H:i"); + + $i = $i + 1; + } + + return $rebroadcastsLocal; + } + + /** + * Get start time and relative start date for a recorded + * shows rebroadcasts. For example start date format would be + * "x days" and time would HH:MM:SS + * + * @return array + * array of associate arrays containing "day_offset" and "start_time" + */ + public function getRebroadcastsRelative() + { + $sql = << $this->getId() ), 'all' ); + } + + /** + * Check whether the current show is set to repeat + * repeating shows. + * + * @return boolean + * true if repeating shows, otherwise false. + */ + public function isRepeating() + { + $showDaysRow = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + if (!is_null($showDaysRow)) { + return ($showDaysRow->getDbRepeatType() != -1); + } else { + return false; + } + } + + /** + * Get the repeat type of the show. Show can have repeat + * type of "weekly", "bi-weekly" and "monthly". These values + * are represented by 0, 1, and 2 respectively. + * + * @return int + * Return the integer corresponding to the repeat type. + */ + public function getRepeatType() + { + $showDaysRow = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + if (!is_null($showDaysRow)) + return $showDaysRow->getDbRepeatType(); + else + return -1; + } + + /** + * Get the end date for a repeating show in the format yyyy-mm-dd + * + * @return string + * Return the end date for the repeating show or the empty + * string if there is no end. + */ + public function getRepeatingEndDate() + { + $sql = << $this->getId() ), 'column' ); + + /* TODO: Why return empty string instead of false? very confusing --RG + */ + return ($query !== false) ? $query : ""; + } + + /** + * Deletes all future instances of the current show object + * from the show_instances table. This function is used when + * a show is being edited - in some cases, when a show is edited + * we just destroy all future show instances, and let another function + * regenerate them later on. Note that this isn't always the most + * desirable thing to do. Deleting a show instance and regenerating + * it cause any scheduled playlists within those show instances to + * be gone for good. + */ + public function deleteAllInstances() + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $this->getId()), 'execute'); + } + + /** + * Deletes all future rebroadcast instances of the current + * show object from the show_instances table. + */ + public function deleteAllRebroadcasts() + { + $sql = << :timestamp::TIMESTAMP + AND show_id :showId + AND rebroadcast 1 +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':showId' => $this->getId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); + + $con->exec($sql); + } + + /** + * Deletes all show instances of current show after a + * certain date. Note that although not enforced, $p_date + * should never be in the past, as we never want to allow + * deletion of shows that have already occured. + * + * @param string $p_date + * The date which to delete after, if null deletes from the current timestamp. + */ + public function removeAllInstancesFromDate($p_date=null) + { + $con = Propel::getConnection(); + + $timestamp = gmdate("Y-m-d H:i:s"); + + if (is_null($p_date)) { + $date = new Application_Common_DateHelper; + $p_date = $date->getDate(); + } + + $showId = $this->getId(); + $sql = "DELETE FROM cc_show_instances " + ." WHERE date(starts) >= DATE '$p_date'" + ." AND starts > TIMESTAMP '$timestamp'" + ." AND show_id = $showId"; + + $con->exec($sql); + + } + + /** + * Deletes all show instances of current show before a + * certain date. + * + * This function is used in the case where a repeating show is being + * edited and the start date of the first show has been changed more + * into the future. In this case, delete any show instances that + * exist before the new start date. + * + * @param string $p_date + * The date which to delete before + */ + public function removeAllInstancesBeforeDate($p_date) + { + $con = Propel::getConnection(); + + $timestamp = gmdate("Y-m-d H:i:s"); + + $showId = $this->getId(); + $sql = "DELETE FROM cc_show_instances " + ." WHERE date(starts) < DATE '$p_date'" + ." AND starts > TIMESTAMP '$timestamp'" + ." AND show_id = $showId"; + + $con->exec($sql); + } + + public function getNextFutureRepeatShowTime() + { + $sql = << now() at time zone 'UTC' +AND show_id = :showId +ORDER BY starts +LIMIT 1 +SQL; + $result = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->getId() ), 'all' ); + + foreach ($result as $r) { + $show["starts"] = new DateTime($r["starts"], new DateTimeZone('UTC')); + $show["ends"] = new DateTime($r["ends"], new DateTimeZone('UTC')); + } + $currentUser = Application_Model_User::getCurrentUser(); + $currentUserId = $currentUser->getId(); + $userTimezone = Application_Model_Preference::GetUserTimezone($currentUserId); + $show["starts"]->setTimezone(new DateTimeZone($userTimezone)); + $show["ends"]->setTimezone(new DateTimeZone($userTimezone)); + return $show; + } + + /** + * Get the start date of the current show in UTC timezone. + * + * @return string + * The start date in the format YYYY-MM-DD or empty string in case + * start date could not be found + */ + public function getStartDateAndTime() + { + $con = Propel::getConnection(); + + $showId = $this->getId(); + $stmt = $con->prepare( + "SELECT first_show, start_time, timezone FROM cc_show_days" + ." WHERE show_id = :showId" + ." ORDER BY first_show" + ." LIMIT 1"); + + $stmt->bindParam(':showId', $showId); + $stmt->execute(); + + if (!$stmt) { + return ""; + } + + $rows = $stmt->fetchAll(); + $row = $rows[0]; + + $dt = new DateTime($row["first_show"]." ".$row["start_time"], new DateTimeZone($row["timezone"])); + $dt->setTimezone(new DateTimeZone("UTC")); + + return $dt->format("Y-m-d H:i"); + } + + /** + * Get the start date of the current show in UTC timezone. + * + * @return string + * The start date in the format YYYY-MM-DD + */ + public function getStartDate() + { + list($date,) = explode(" ", $this->getStartDateAndTime()); + + return $date; + } + + /** + * Get the start time of the current show in UTC timezone. + * + * @return string + * The start time in the format HH:MM + */ + + public function getStartTime() + { + list(,$time) = explode(" ", $this->getStartDateAndTime()); + + return $time; + } + + /** + * Get the end date of the current show. + * Note that this is not the end date of repeated show + * + * @return string + * The end date in the format YYYY-MM-DD + */ + public function getEndDate() + { + $startDate = $this->getStartDate(); + $startTime = $this->getStartTime(); + $duration = $this->getDuration(); + + $startDateTime = new DateTime($startDate.' '.$startTime); + $duration = explode(":", $duration); + + $endDate = $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); + + return $endDate->format('Y-m-d'); + } + + /** + * Get the end time of the current show. + * + * @return string + * The start time in the format HH:MM:SS + */ + public function getEndTime() + { + $startDate = $this->getStartDate(); + $startTime = $this->getStartTime(); + $duration = $this->getDuration(); + + $startDateTime = new DateTime($startDate.' '.$startTime); + $duration = explode(":", $duration); + + $endDate = $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); + + return $endDate->format('H:i:s'); + } + + /** + * Indicate whether the starting point of the show is in the + * past. + * + * @return boolean + * true if the StartDate is in the past, false otherwise + */ + public function isStartDateTimeInPast() + { + $date = new Application_Common_DateHelper; + $current_timestamp = $date->getUtcTimestamp(); + + return ($current_timestamp > ($this->getStartDate()." ".$this->getStartTime())); + } + + /** + * Get the ID's of future instance of the current show. + * + * @return array + * A simple array containing all ID's of show instance + * scheduled in the future. + */ + public function getAllFutureInstanceIds() + { + $sql = << :timestamp::TIMESTAMP + AND modified_instance != TRUE +SQL; + $rows = Application_Common_Database::prepareAndExecute($sql, + array( ':showId' => $this->getId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), "all"); + + $res = array(); + foreach ($rows as $r) { + $res[] = $r['id']; + } + return $res; + } + + /* Called when a show's duration is changed (edited). + * + * @param array $p_data + * array containing the POST data about the show from the + * browser. + * + */ + private function updateDurationTime($p_data) + { + //need to update cc_show_instances, cc_show_days + $con = Propel::getConnection(); + + $date = new Application_Common_DateHelper; + $timestamp = $date->getUtcTimestamp(); + + $stmt = $con->prepare("UPDATE cc_show_days " + ."SET duration = :add_show_duration " + ."WHERE show_id = :add_show_id" ); + $stmt->execute( array( + ':add_show_duration' => $p_data['add_show_duration'], + ':add_show_id' => $p_data['add_show_id'] + )); + + + $sql = << :timestamp::TIMESTAMP +SQL; + + Application_Common_Database::prepareAndExecute( $sql, array( + ':add_show_duration' => $p_data['add_show_duration'], + ':show_id' => $p_data['add_show_id'], + ':timestamp' => $timestamp), "execute"); + } + + private function updateStartDateTime($p_data, $p_endDate) + { + //need to update cc_schedule, cc_show_instances, cc_show_days + $con = Propel::getConnection(); + + $date = new Application_Common_DateHelper; + $timestamp = $date->getTimestamp(); + + //TODO fix this from overwriting info. + $sql = "UPDATE cc_show_days " + ."SET start_time = TIME '$p_data[add_show_start_time]', " + ."first_show = DATE '$p_data[add_show_start_date]', "; + if (strlen ($p_endDate) == 0) { + $sql .= "last_show = NULL "; + } else { + $sql .= "last_show = DATE '$p_endDate' "; + } + $sql .= "WHERE show_id = $p_data[add_show_id]"; + $con->exec($sql); + + $dtOld = new DateTime($this->getStartDate()." ".$this->getStartTime(), new DateTimeZone("UTC")); + $dtNew = new DateTime($p_data['add_show_start_date']." ".$p_data['add_show_start_time'], new DateTimeZone(date_default_timezone_get())); + $diff = $dtOld->getTimestamp() - $dtNew->getTimestamp(); + + $sql = "UPDATE cc_show_instances " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE show_id = $p_data[add_show_id] " + ."AND starts > TIMESTAMP '$timestamp'"; + $con->exec($sql); + + $showInstanceIds = $this->getAllFutureInstanceIds(); + if (count($showInstanceIds) > 0 && $diff != 0) { + $showIdsImploded = implode(",", $showInstanceIds); + $sql = "UPDATE cc_schedule " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE instance_id IN ($showIdsImploded)"; + $con->exec($sql); + } + } + + public function getDuration($format=false) + { + $showDay = CcShowDaysQuery::create()->filterByDbShowId($this->getId())->findOne(); + if (!$format) { + return $showDay->getDbDuration(); + } else { + $info = explode(':',$showDay->getDbDuration()); + + return str_pad(intval($info[0]),2,'0',STR_PAD_LEFT).'h '.str_pad(intval($info[1]),2,'0',STR_PAD_LEFT).'m'; + } + } + + public function getShowDays() + { + $showDays = CcShowDaysQuery::create()->filterByDbShowId( + $this->getId())->find(); + $res = array(); + foreach ($showDays as $showDay) { + $res[] = $showDay->getDbDay(); + } + return $res; + } + + /* Only used for shows that aren't repeating. + * + * @return Boolean: true if show has an instance, otherwise false. */ + public function hasInstance() + { + return (!is_null($this->getInstance())); + } + + /* Only used for shows that aren't repeating. + * + * @return CcShowInstancesQuery: An propel object representing a + * row in the cc_show_instances table. */ + public function getInstance() + { + $showInstance = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getId()) + ->findOne(); + + return $showInstance; + } + + /** + * returns info about live stream override info + */ + public function getLiveStreamInfo() + { + $info = array(); + if ($this->getId() == null) { + return $info; + } else { + $ccShow = CcShowQuery::create()->findPK($this->_showId); + $info['custom_username'] = $ccShow->getDbLiveStreamUser(); + $info['cb_airtime_auth'] = $ccShow->getDbLiveStreamUsingAirtimeAuth(); + $info['cb_custom_auth'] = $ccShow->getDbLiveStreamUsingCustomAuth(); + $info['custom_username'] = $ccShow->getDbLiveStreamUser(); + $info['custom_password'] = $ccShow->getDbLiveStreamPass(); + return $info; + } + } + + /* Only used for shows that are repeating. Note that this will return + * true even for dates that only have a "modified" show instance (does not + * check if the "modified_instance" column is set to true). This is intended + * behaviour. + * + * @param $p_dateTime: Date for which we are checking if instance + * exists. + * + * @return Boolean: true if show has an instance on $p_dateTime, + * otherwise false. */ + public function hasInstanceOnDate($p_dateTime) + { + return (!is_null($this->getInstanceOnDate($p_dateTime))); + } + + /* Only used for shows that are repeating. Note that this will return + * shows that have been "modified" (does not check if the "modified_instance" + * column is set to true). This is intended behaviour. + * + * @param $p_dateTime: Date for which we are getting an instance. + * + * @return CcShowInstancesQuery: An propel object representing a + * row in the cc_show_instances table. */ + public function getInstanceOnDate($p_dateTime) + { + $timestamp = $p_dateTime->format("Y-m-d H:i:s"); + $sql = << $this->getId(), + ':timestamp' => $timestamp ), 'column'); + return CcShowInstancesQuery::create() + ->findPk($row); + } catch (Exception $e) { + return null; + } + + } + + public function deletePossiblyInvalidInstances($p_data, $p_endDate, $isRecorded, $repeatType) + { + if ($p_data['add_show_repeats'] != $this->isRepeating()) { + //repeat option was toggled + $this->deleteAllInstances(); + } + + if ($p_data['add_show_duration'] != $this->getDuration()) { + //duration has changed + $this->updateDurationTime($p_data); + } + + if ($p_data['add_show_repeats']) { + if (($repeatType == 1 || $repeatType == 2) && + $p_data['add_show_start_date'] != $this->getStartDate()){ + + //start date has changed when repeat type is bi-weekly or monthly. + //This screws up the repeating positions of show instances, so lets + //just delete them for now. (CC-2351) + + $this->deleteAllInstances(); + } + + if ($repeatType != $this->getRepeatType()) { + //repeat type changed. + $this->deleteAllInstances(); + } else { + //repeat type is the same, check if the days of the week are the same + $repeatingDaysChanged = false; + $showDaysArray = $this->getShowDays(); + if (count($p_data['add_show_day_check']) == count($showDaysArray)) { + //same number of days checked, lets see if they are the same numbers + $intersect = array_intersect($p_data['add_show_day_check'], $showDaysArray); + if (count($intersect) != count($p_data['add_show_day_check'])) { + $repeatingDaysChanged = true; + } + } else { + $repeatingDaysChanged = true; + } + + if ($repeatingDaysChanged) { + $daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']); + + if (count($daysRemoved) > 0) { + + $this->removeUncheckedDaysInstances($daysRemoved); + } + } + + if ($p_data['add_show_start_date'] != $this->getStartDate() + || $p_data['add_show_start_time'] != $this->getStartTime()){ + //start date/time has changed + + $newDate = strtotime($p_data['add_show_start_date']); + $oldDate = strtotime($this->getStartDate()); + if ($newDate > $oldDate) { + $this->removeAllInstancesBeforeDate($p_data['add_show_start_date']); + } + + $this->updateStartDateTime($p_data, $p_endDate); + } + } + + //Check if end date for the repeat option has changed. If so, need to take care + //of deleting possible invalid Show Instances. + if ((strlen($this->getRepeatingEndDate()) == 0) == $p_data['add_show_no_end']) { + //show "Never Ends" option was toggled. + if ($p_data['add_show_no_end']) { + } else { + $this->removeAllInstancesFromDate($p_endDate); + } + } + if ($this->getRepeatingEndDate() != $p_data['add_show_end_date']) { + //end date was changed. + + $newDate = strtotime($p_data['add_show_end_date']); + $oldDate = strtotime($this->getRepeatingEndDate()); + if ($newDate < $oldDate) { + $this->removeAllInstancesFromDate($p_endDate); + } + } + } + } + + /** + * Create a show. + * + * Note: end dates are non inclusive. + * + * @param array $data + * @return int + * Show ID + */ + public static function create($data) + { + $startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']); + $utcStartDateTime = clone $startDateTime; + $utcStartDateTime->setTimezone(new DateTimeZone('UTC')); + + if ($data['add_show_no_end']) { + $endDate = NULL; + } elseif ($data['add_show_repeats']) { + $endDateTime = new DateTime($data['add_show_end_date']); + //$endDateTime->setTimezone(new DateTimeZone('UTC')); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($data['add_show_start_date']); + //$endDateTime->setTimezone(new DateTimeZone('UTC')); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + //What we are doing here is checking if the show repeats or if + //any repeating days have been checked. If not, then by default + //the "selected" DOW is the initial day. + //DOW in local time. + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$data['add_show_repeats']) { + $data['add_show_day_check'] = array($startDow); + } elseif ($data['add_show_repeats'] && $data['add_show_day_check'] == "") { + $data['add_show_day_check'] = array($startDow); + } + + //find repeat type or set to a non repeating show. + $repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1; + + if ($data['add_show_id'] == -1) { + $ccShow = new CcShow(); + } else { + $ccShow = CcShowQuery::create()->findPK($data['add_show_id']); + } + $ccShow->setDbName($data['add_show_name']); + $ccShow->setDbDescription($data['add_show_description']); + $ccShow->setDbUrl($data['add_show_url']); + $ccShow->setDbGenre($data['add_show_genre']); + $ccShow->setDbColor($data['add_show_color']); + $ccShow->setDbBackgroundColor($data['add_show_background_color']); + $ccShow->setDbLiveStreamUsingAirtimeAuth($data['cb_airtime_auth'] == 1); + $ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1); + $ccShow->setDbLiveStreamUser($data['custom_username']); + $ccShow->setDbLiveStreamPass($data['custom_password']); + $ccShow->save(); + + $showId = $ccShow->getDbId(); + + $isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0; + + if ($data['add_show_id'] != -1) { + $show = new Application_Model_Show($showId); + $show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType); + } + + //check if we are adding or updating a show, and if updating + //erase all the show's show_days information first. + if ($data['add_show_id'] != -1) { + CcShowDaysQuery::create()->filterByDbShowId($data['add_show_id'])->delete(); + } + + //don't set day for monthly repeat type, it's invalid. + if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(date_default_timezone_get()); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($data['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(date_default_timezone_get()); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } + + //check if we are adding or updating a show, and if updating + //erase all the show's future show_rebroadcast information first. + if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) { + CcShowRebroadcastQuery::create() + ->filterByDbShowId($data['add_show_id']) + ->delete(); + } + //adding rows to cc_show_rebroadcast + /* TODO: Document magic constant 10 and define it properly somewhere + --RG */ + if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { + for ($i=1; $i<=10; $i++) { + if ($data['add_show_rebroadcast_date_'.$i]) { + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]); + $showRebroad->setDbStartTime($data['add_show_rebroadcast_time_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } elseif ($isRecorded && $data['add_show_rebroadcast'] && ($repeatType == -1)) { + for ($i=1; $i<=10; $i++) { + if ($data['add_show_rebroadcast_date_absolute_'.$i]) { + //$con = Propel::getConnection(CcShowPeer::DATABASE_NAME); + //$sql = "SELECT date '{$data['add_show_rebroadcast_date_absolute_'.$i]}' - date '{$data['add_show_start_date']}' "; + $sql = << + $data["add_show_rebroadcast_date_absolute_$i"], + 'start' => + $data['add_show_start_date']), "column" ); + + //$r = $con->query($sql); + //$offset_days = $r->fetchColumn(0); + + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($offset_days." days"); + $showRebroad->setDbStartTime($data['add_show_rebroadcast_time_absolute_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } + + //check if we are adding or updating a show, and if updating + //erase all the show's show_rebroadcast information first. + if ($data['add_show_id'] != -1) { + CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete(); + } + if (is_array($data['add_show_hosts'])) { + //add selected hosts to cc_show_hosts table. + foreach ($data['add_show_hosts'] as $host) { + $showHost = new CcShowHosts(); + $showHost->setDbShow($showId); + $showHost->setDbHost($host); + $showHost->save(); + } + } + + if ($data['add_show_id'] != -1) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $con->beginTransaction(); + + + //current timesamp in UTC. + $current_timestamp = gmdate("Y-m-d H:i:s"); + + try { + //update the status flag in cc_schedule. + $instances = CcShowInstancesQuery::create() + ->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN) + ->filterByDbShowId($data['add_show_id']) + ->find($con); + + foreach ($instances as $instance) { + $instance->updateScheduleStatus($con); + } + + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + Logging::info("Couldn't update schedule status."); + Logging::info($e->getMessage()); + } + } + + Application_Model_Show::populateShowUntil($showId); + Application_Model_RabbitMq::PushSchedule(); + + return $showId; + } + + /** + * Generate repeating show instances for a single show up to the given date. + * It will always try to use enddate from DB but if that's empty, it will use + * time now. + * + * @param int $p_showId + */ + public static function populateShowUntil($p_showId) + { + $con = Propel::getConnection(); + $date = Application_Model_Preference::GetShowsPopulatedUntil(); + + if (is_null($date)) { + $p_populateUntilDateTime = new DateTime("now", new DateTimeZone('UTC')); + Application_Model_Preference::SetShowsPopulatedUntil($p_populateUntilDateTime); + } else { + $p_populateUntilDateTime = $date; + } + + $stmt = $con->prepare("SELECT * FROM cc_show_days WHERE show_id = :show_id"); + $stmt->bindParam(':show_id', $p_showId); + $stmt->execute(); + + $res = $stmt->fetchAll(); + + foreach ($res as $showDaysRow) { + Application_Model_Show::populateShow($showDaysRow, $p_populateUntilDateTime); + } + } + + /** + * We are going to use cc_show_days as a template, to generate Show Instances. This function + * is basically a dispatcher that looks at the show template, and sends it to the correct function + * so that Show Instance generation can begin. After the all show instances have been created, pushes + * the schedule to Pypo. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. + */ + private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) + { + // TODO : use constants instead of int values here? or maybe php will + // get enum types by the time somebody gets around to fix this. -- RG + if ($p_showDaysRow["repeat_type"] == -1) { + Application_Model_Show::populateNonRepeatingShow($p_showDaysRow, $p_populateUntilDateTime); + } elseif ($p_showDaysRow["repeat_type"] == 0) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P7D'); + } elseif ($p_showDaysRow["repeat_type"] == 1) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P14D'); + } elseif ($p_showDaysRow["repeat_type"] == 2) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P1M'); + } + Application_Model_RabbitMq::PushSchedule(); + } + + /** + * Creates a single show instance. If the show is recorded, it may have multiple + * rebroadcast dates, and so this function will create those as well. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. + */ + private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime) + { + $show_id = $p_showRow["show_id"]; + $first_show = $p_showRow["first_show"]; //non-UTC + $start_time = $p_showRow["start_time"]; //non-UTC + $duration = $p_showRow["duration"]; + $record = $p_showRow["record"]; + $timezone = $p_showRow["timezone"]; + $start = $first_show." ".$start_time; + + //start & end UTC DateTimes for the show. + list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start, $duration, $timezone); + if ($utcStartDateTime->getTimestamp() < $p_populateUntilDateTime->getTimestamp()) { + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + $show = new Application_Model_Show($show_id); + if ($show->hasInstance()) { + $ccShowInstance = $show->getInstance(); + $newInstance = false; + } else { + $ccShowInstance = new CcShowInstances(); + $newInstance = true; + } + + if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + } + + $show_instance_id = $ccShowInstance->getDbId(); + $showInstance = new Application_Model_ShowInstance($show_instance_id); + + if (!$newInstance) { + $showInstance->correctScheduleStartTimes(); + } + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, + array( ':show_id' => $show_id ), 'all'); + + if ($showInstance->isRecorded()) { + $showInstance->deleteRebroadcasts(); + self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); + } + } + } + + /** + * Creates a 1 or more than 1 show instances (user has stated this show repeats). If the show + * is recorded, it may have multiple rebroadcast dates, and so this function will create + * those as well. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. "shows_populated_until" date YY-mm-dd in cc_pref + * @param string $p_interval + * Period of time between repeating shows (in php DateInterval notation 'P7D') + */ + private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval) + { + $show_id = $p_showDaysRow["show_id"]; + $next_pop_date = $p_showDaysRow["next_pop_date"]; + $first_show = $p_showDaysRow["first_show"]; //non-UTC + $last_show = $p_showDaysRow["last_show"]; //non-UTC + $start_time = $p_showDaysRow["start_time"]; //non-UTC + $duration = $p_showDaysRow["duration"]; + $day = $p_showDaysRow["day"]; + $record = $p_showDaysRow["record"]; + $timezone = $p_showDaysRow["timezone"]; + + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + if (isset($next_pop_date)) { + $start = $next_pop_date." ".$start_time; + } else { + $start = $first_show." ".$start_time; + } + + $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); + //convert $last_show into a UTC DateTime object, or null if there is no last show. + $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + + $rebroadcasts = Application_Common_Database::prepareAndExecute( $sql, + array( ':show_id' => $show_id ), 'all'); + + $show = new Application_Model_Show($show_id); + + while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp() + && (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){ + + list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone); + + if ($show->hasInstanceOnDate($utcStartDateTime)) { + $ccShowInstance = $show->getInstanceOnDate($utcStartDateTime); + + if ($ccShowInstance->getDbModifiedInstance()) { + //show instance on this date has been deleted. + list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone); + continue; + } + + $newInstance = false; + } else { + $ccShowInstance = new CcShowInstances(); + $newInstance = true; + } + + /* When editing the start/end time of a repeating show, we don't want to + * change shows that started in the past. So check the start time. + */ + if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + } + + + $show_instance_id = $ccShowInstance->getDbId(); + $showInstance = new Application_Model_ShowInstance($show_instance_id); + + /* If we are updating a show then make sure that the scheduled content within + * the show is updated to the correct time. */ + if (!$newInstance) { + $showInstance->correctScheduleStartTimes(); + } + + $showInstance->deleteRebroadcasts(); + self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); + list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone); + + } + + Application_Model_Show::setNextPop($start, $show_id, $day); + } + + private static function advanceRepeatingDate($p_interval, $start, $timezone) + { + $startDt = new DateTime($start, new DateTimeZone($timezone)); + if ($p_interval == 'P1M') { + /* When adding months, there is a problem if we are on January 31st and add one month with PHP. + * What ends up happening is that since February 31st doesn't exist, the date returned is + * March 3rd. For now let's ignore the day and assume we are always working with the + * first of each month, and use PHP to add 1 month to this (this will take care of rolling + * over the years 2011->2012, etc.). Then let's append the actual day, and use the php + * checkdate() function, to see if it is valid. If not, then we'll just skip this month. */ + + /* pass in only the year and month (not the day) */ + $dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone)); + + + /* Keep adding 1 month, until we find the next month that contains the day + * we are looking for (31st day for example) */ + do { + $dt->add(new DateInterval($p_interval)); + } while (!checkdate($dt->format("m"), $startDt->format("d"), $dt->format("Y"))); + + $dt->setDate($dt->format("Y"), $dt->format("m"), $startDt->format("d")); + + } else { + $dt = new DateTime($start, new DateTimeZone($timezone)); + $dt->add(new DateInterval($p_interval)); + } + + $start = $dt->format("Y-m-d H:i:s"); + + $dt->setTimezone(new DateTimeZone('UTC')); + $utcStartDateTime = $dt; + + return array($start, $utcStartDateTime); + } + + /* + * @param $p_start + * timestring format "Y-m-d H:i:s" (not UTC) + * @param $p_duration + * string time interval (h)h:(m)m(:ss) + * @param $p_timezone + * string "Europe/Prague" + * @param $p_offset + * array (days, hours, mins) used for rebroadcast shows. + * + * @return + * array of 2 DateTime objects, start/end time of the show in UTC. + */ + private static function createUTCStartEndDateTime($p_start, $p_duration, $p_timezone=null, $p_offset=null) + { + $timezone = $p_timezone ? $p_timezone : date_default_timezone_get(); + + $startDateTime = new DateTime($p_start, new DateTimeZone($timezone)); + if (isset($p_offset)) { + $startDateTime->add(new DateInterval("P{$p_offset["days"]}DT{$p_offset["hours"]}H{$p_offset["mins"]}M")); + } + //convert time to UTC + $startDateTime->setTimezone(new DateTimeZone('UTC')); + + $endDateTime = clone $startDateTime; + $duration = explode(":", $p_duration); + list($hours, $mins) = array_slice($duration, 0, 2); + $endDateTime->add(new DateInterval("PT{$hours}H{$mins}M")); + + return array($startDateTime, $endDateTime); + } + + /* Create rebroadcast instances for a created show marked for recording + * + * @param $p_rebroadcasts + * rows gotten from the db table cc_show_rebroadcasts, tells airtime when to schedule the rebroadcasts. + * @param $p_currentUtcTimestamp + * a timestring in format "Y-m-d H:i:s", current UTC time. + * @param $p_showId + * int of the show it belongs to (from cc_show) + * @param $p_showInstanceId + * the instance id of the created recorded show instance + * (from cc_show_instances), used to associate rebroadcasts to this show. + * @param $p_startTime + * a timestring in format "Y-m-d H:i:s" in the timezone, not UTC of the rebroadcasts' parent recorded show. + * @param $p_duration + * string time interval (h)h:(m)m:(ss) length of the show. + * @param $p_timezone + * string of user's timezone "Europe/Prague" + * + */ + private static function createRebroadcastInstances($p_rebroadcasts, $p_currentUtcTimestamp, $p_showId, $p_showInstanceId, $p_startTime, $p_duration, $p_timezone=null) + { + //Y-m-d + //use only the date part of the show start time stamp for the offsets to work properly. + $date = explode(" ", $p_startTime); + $start_date = $date[0]; + + foreach ($p_rebroadcasts as $rebroadcast) { + + $days = explode(" ", $rebroadcast["day_offset"]); + $time = explode(":", $rebroadcast["start_time"]); + $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); + + list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start_date, $p_duration, $p_timezone, $offset); + + if ($utcStartDateTime->format("Y-m-d H:i:s") > $p_currentUtcTimestamp) { + + $newRebroadcastInstance = new CcShowInstances(); + $newRebroadcastInstance->setDbShowId($p_showId); + $newRebroadcastInstance->setDbStarts($utcStartDateTime); + $newRebroadcastInstance->setDbEnds($utcEndDateTime); + $newRebroadcastInstance->setDbRecord(0); + $newRebroadcastInstance->setDbRebroadcast(1); + $newRebroadcastInstance->setDbOriginalShow($p_showInstanceId); + $newRebroadcastInstance->save(); + } + } + } + + /** + * Get all the show instances in the given time range (inclusive). + * + * @param DateTime $start_timestamp + * In UTC time. + * @param DateTime $end_timestamp + * In UTC time. + * @param unknown_type $excludeInstance + * @param boolean $onlyRecord + * @return array + */ + public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE) + { + //UTC DateTime object + $showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil(); + //if application is requesting shows past our previous populated until date, generate shows up until this point. + if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) { + Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp); + Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp); + } + + $sql = <<format("Y-m-d H:i:s"); + $end_string = $end_timestamp->format("Y-m-d H:i:s"); + if ($onlyRecord) { + $sql .= " AND (si1.starts >= :start::TIMESTAMP AND si1.starts < :end::TIMESTAMP)"; + $sql .= " AND (si1.record = 1)"; + + return Application_Common_Database::prepareAndExecute( $sql, + array( ':start' => $start_string, + ':end' => $end_string ), 'all'); + + } else { + $sql .= " ". <<= :start1::TIMESTAMP AND si1.starts < :end1::TIMESTAMP) + OR (si1.ends > :start2::TIMESTAMP AND si1.ends <= :end2::TIMESTAMP) + OR (si1.starts <= :start3::TIMESTAMP AND si1.ends >= :end3::TIMESTAMP)) +SQL; + return Application_Common_Database::prepareAndExecute( $sql, + array( + 'start1' => $start_string, + 'start2' => $start_string, + 'start3' => $start_string, + 'end1' => $end_string, + 'end2' => $end_string, + 'end3' => $end_string + ), 'all'); + } + } + + private static function setNextPop($next_date, $show_id, $day) + { + $nextInfo = explode(" ", $next_date); + + $repeatInfo = CcShowDaysQuery::create() + ->filterByDbShowId($show_id) + ->filterByDbDay($day) + ->findOne(); + + $repeatInfo->setDbNextPopDate($nextInfo[0]) + ->save(); + } + + /** + * Generate all the repeating shows in the given range. + * + * @param DateTime $p_startTimestamp + * In UTC format. + * @param DateTime $p_endTimestamp + * In UTC format. + */ + public static function populateAllShowsInRange($p_startTimestamp, $p_endTimestamp) + { + $con = Propel::getConnection(); + + $endTimeString = $p_endTimestamp->format("Y-m-d H:i:s"); + if (!is_null($p_startTimestamp)) { + $startTimeString = $p_startTimestamp->format("Y-m-d H:i:s"); + } else { + $today_timestamp = new DateTime("now", new DateTimeZone("UTC")); + $startTimeString = $today_timestamp->format("Y-m-d H:i:s"); + } + + $stmt = $con->prepare(" + SELECT * FROM cc_show_days + WHERE last_show IS NULL + OR first_show < :endTimeString AND last_show > :startTimeString"); + + $stmt->bindParam(':endTimeString', $endTimeString); + $stmt->bindParam(':startTimeString', $startTimeString); + $stmt->execute(); + + $res = $stmt->fetchAll(); + foreach ($res as $row) { + Application_Model_Show::populateShow($row, $p_endTimestamp); + } + } + + /** + * + * @param DateTime $start + * -in UTC time + * @param DateTime $end + * -in UTC time + * @param boolean $editable + */ + public static function &getFullCalendarEvents($p_start, $p_end, $p_editable=false) + { + $events = array(); + $interval = $p_start->diff($p_end); + $days = $interval->format('%a'); + $shows = Application_Model_Show::getShows($p_start, $p_end); + $content_count = Application_Model_ShowInstance::getContentCount( + $p_start, $p_end); + $isFull = Application_Model_ShowInstance::getIsFull($p_start, $p_end); + $timezone = date_default_timezone_get(); + $current_timezone = new DateTimeZone($timezone); + $utc = new DateTimeZone("UTC"); + $now = new DateTime("now", $utc); + + foreach ($shows as &$show) { + $options = array(); + + //only bother calculating percent for week or day view. + if (intval($days) <= 7) { + $options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]); + } + + if (isset($show["parent_starts"])) { + $parentStartsDT = new DateTime($show["parent_starts"], $utc); + } + + $startsDT = DateTime::createFromFormat("Y-m-d G:i:s", + $show["starts"],$utc); + $endsDT = DateTime::createFromFormat("Y-m-d G:i:s", + $show["ends"], $utc); + + if( $p_editable ) { + if ($show["record"] && $now > $startsDT) { + $options["editable"] = false; + } elseif ($show["rebroadcast"] && + $now > $parentStartsDT) { + $options["editable"] = false; + } elseif ($now < $endsDT) { + $options["editable"] = true; + } + } + + $startsDT->setTimezone($current_timezone); + $endsDT->setTimezone($current_timezone); + + $options["show_empty"] = (array_key_exists($show['instance_id'], + $content_count)) ? 0 : 1; + + $options["show_partial_filled"] = !$isFull[$show['instance_id']]; + + $event = array(); + + $event["id"] = intval($show["instance_id"]); + $event["title"] = $show["name"]; + $event["start"] = $startsDT->format("Y-m-d H:i:s"); + $event["end"] = $endsDT->format("Y-m-d H:i:s"); + $event["allDay"] = false; + $event["showId"] = intval($show["show_id"]); + $event["record"] = intval($show["record"]); + $event["rebroadcast"] = intval($show["rebroadcast"]); + $event["soundcloud_id"] = is_null($show["soundcloud_id"]) + ? -1 : $show["soundcloud_id"]; + + //event colouring + if ($show["color"] != "") { + $event["textColor"] = "#".$show["color"]; + } + + if ($show["background_color"] != "") { + $event["color"] = "#".$show["background_color"]; + } + + foreach ($options as $key => $value) { + $event[$key] = $value; + } + + $events[] = $event; + } + return $events; + } + + /** + * Calculates the percentage of a show scheduled given the start and end times in date/time format + * and the time_filled as the total time the schow is scheduled for in time format. + **/ + private static function getPercentScheduled($p_starts, $p_ends, $p_time_filled) + { + $durationSeconds = (strtotime($p_ends) - strtotime($p_starts)); + $time_filled = Application_Model_Schedule::WallTimeToMillisecs($p_time_filled) / 1000; + $percent = ceil(( $time_filled / $durationSeconds) * 100); + + return $percent; + } + +/* private static function &makeFullCalendarEvent(&$show, $options=array(), $startDateTime, $endDateTime, $startsEpoch, $endsEpoch) + { + $event = array(); + + $event["id"] = intval($show["instance_id"]); + $event["title"] = $show["name"]; + $event["start"] = $startDateTime->format("Y-m-d H:i:s"); + $event["startUnix"] = $startsEpoch; + $event["end"] = $endDateTime->format("Y-m-d H:i:s"); + $event["endUnix"] = $endsEpoch; + $event["allDay"] = false; + $event["showId"] = intval($show["show_id"]); + $event["record"] = intval($show["record"]); + $event["rebroadcast"] = intval($show["rebroadcast"]); + $event["soundcloud_id"] = is_null($show["soundcloud_id"]) + ? -1 : $show["soundcloud_id"]; + + //event colouring + if ($show["color"] != "") { + $event["textColor"] = "#".$show["color"]; + } + + if ($show["background_color"] != "") { + $event["color"] = "#".$show["background_color"]; + } + + foreach ($options as $key => $value) { + $event[$key] = $value; + } + + return $event; + }*/ + + /* Takes in a UTC DateTime object. + * Converts this to local time, since cc_show days + * requires local time. */ + public function setShowFirstShow($p_dt) + { + //clone object since we are modifying it and it was passed by reference. + $dt = clone $p_dt; + + $dt->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbFirstShow($dt)->setDbStartTime($dt) + ->save(); + + //Logging::info("setting show's first show."); + } + + /* Takes in a UTC DateTime object + * Converts this to local time, since cc_show days + * requires local time. */ + public function setShowLastShow($p_dt) + { + //clone object since we are modifying it and it was passed by reference. + $dt = clone $p_dt; + + $dt->setTimezone(new DateTimeZone(date_default_timezone_get())); + + //add one day since the Last Show date in CcShowDays is non-inclusive. + $dt->add(new DateInterval("P1D")); + + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbLastShow($dt) + ->save(); + } + + /** + * Given time $timeNow, returns the show being played right now. + * Times are all in UTC time. + * + * @param String $timeNow - current time (in UTC) + * @return array - show being played right now + */ + public static function getCurrentShow($timeNow=null) + { + $CC_CONFIG = Config::getConfig(); + $con = Propel::getConnection(); + if ($timeNow == null) { + $date = new Application_Common_DateHelper; + $timeNow = $date->getUtcTimestamp(); + } + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = << :timeNow2::timestamp + AND modified_instance != TRUE +SQL; + + $stmt = $con->prepare($sql); + $stmt->bindParam(':timeNow1', $timeNow); + $stmt->bindParam(':timeNow2', $timeNow); + + if ($stmt->execute()) { + $rows = $stmt->fetchAll(); + } else { + $msg = implode(',', $stmt->errorInfo()); + throw new Exception("Error: $msg"); + } + + return $rows; + } + + /** + * Gets the current show, previous and next with an 2day window from + * the given timeNow, so timeNow-2days and timeNow+2days. + */ + public static function getPrevCurrentNext($p_timeNow) + { + $CC_CONFIG = Config::getConfig(); + $con = Propel::getConnection(); + // + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = << :timeNow1::timestamp - INTERVAL '2 days' + AND si.ends < :timeNow2::timestamp + INTERVAL '2 days' + AND modified_instance != TRUE +ORDER BY si.starts +SQL; + + $stmt = $con->prepare($sql); + + $stmt->bindValue(':timeNow1', $p_timeNow); + $stmt->bindValue(':timeNow2', $p_timeNow); + + if ($stmt->execute()) { + $rows = $stmt->fetchAll(); + } else { + $msg = implode(',', $stmt->errorInfo()); + throw new Exception("Error: $msg"); + } + + $numberOfRows = count($rows); + + $results['previousShow'] = array(); + $results['currentShow'] = array(); + $results['nextShow'] = array(); + + $timeNowAsMillis = strtotime($p_timeNow); + + for ($i = 0; $i < $numberOfRows; ++$i) { + //Find the show that is within the current time. + if ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) + && (strtotime($rows[$i]['ends']) > $timeNowAsMillis)) { + if ($i-1 >= 0) { + $results['previousShow'][0] = array( + "id" => $rows[$i-1]['id'], + "instance_id" => $rows[$i-1]['instance_id'], + "name" => $rows[$i-1]['name'], + "url" => $rows[$i-1]['url'], + "start_timestamp" => $rows[$i-1]['start_timestamp'], + "end_timestamp" => $rows[$i-1]['end_timestamp'], + "starts" => $rows[$i-1]['starts'], + "ends" => $rows[$i-1]['ends'], + "record" => $rows[$i-1]['record'], + "type" => "show"); + } + + $results['currentShow'][0] = $rows[$i]; + + if (isset($rows[$i+1])) { + $results['nextShow'][0] = array( + "id" => $rows[$i+1]['id'], + "instance_id" => $rows[$i+1]['instance_id'], + "name" => $rows[$i+1]['name'], + "url" => $rows[$i+1]['url'], + "start_timestamp" => $rows[$i+1]['start_timestamp'], + "end_timestamp" => $rows[$i+1]['end_timestamp'], + "starts" => $rows[$i+1]['starts'], + "ends" => $rows[$i+1]['ends'], + "record" => $rows[$i+1]['record'], + "type" => "show"); + } + break; + } + //Previous is any row that ends after time now capture it in case we need it later. + if (strtotime($rows[$i]['ends']) < $timeNowAsMillis ) { + $previousShowIndex = $i; + } + //if we hit this we know we've gone to far and can stop looping. + if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) { + $results['nextShow'][0] = array( + "id" => $rows[$i]['id'], + "instance_id" => $rows[$i]['instance_id'], + "name" => $rows[$i]['name'], + "url" => $rows[$i]['url'], + "start_timestamp" => $rows[$i]['start_timestamp'], + "end_timestamp" => $rows[$i]['end_timestamp'], + "starts" => $rows[$i]['starts'], + "ends" => $rows[$i]['ends'], + "record" => $rows[$i]['record'], + "type" => "show"); + break; + } + } + //If we didn't find a a current show because the time didn't fit we may still have + //found a previous show so use it. + if (count($results['previousShow']) == 0 && isset($previousShowIndex)) { + $results['previousShow'][0] = array( + "id" => $rows[$previousShowIndex]['id'], + "instance_id" => $rows[$previousShowIndex]['instance_id'], + "name" => $rows[$previousShowIndex]['name'], + "start_timestamp" => $rows[$previousShowIndex]['start_timestamp'], + "end_timestamp" => $rows[$previousShowIndex]['end_timestamp'], + "starts" => $rows[$previousShowIndex]['starts'], + "ends" => $rows[$previousShowIndex]['ends'], + "record" => $rows[$previousShowIndex]['record'], + "type" => "show"); + } + + return $results; + } + + /** + * Given a start time $timeStart and end time $timeEnd, returns the next $limit + * number of shows within the time interval + * If $timeEnd not given, shows within next 48 hours from $timeStart are returned + * If $limit not given, all shows within the intervals are returned + * Times are all in UTC time. + * + * @param String $timeStart - interval start time (in UTC) + * @param int $limit - number of shows to return + * @param String $timeEnd - interval end time (in UTC) + * @return array - the next $limit number of shows within the time interval + */ + public static function getNextShows($timeStart, $limit = "ALL", $timeEnd = "") + { + // defaults to retrieving shows from next 2 days if no end time has + // been specified + if ($timeEnd == "") { + $timeEnd = "'$timeStart' + INTERVAL '2 days'"; + } + + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = <<= :timeStart::timestamp + AND si.starts < :timeEnd::timestamp + AND modified_instance != TRUE +ORDER BY si.starts +SQL; + + //PDO won't accept "ALL" as a limit value (complains it is not an + //integer, and so we must completely remove the limit clause if we + //want to show all results - MK + if ($limit != "ALL") { + $sql .= PHP_EOL."LIMIT :lim"; + $params = array( + ':timeStart' => $timeStart, + ':timeEnd' => $timeEnd, + ':lim' => $limit); + } else { + $params = array( + ':timeStart' => $timeStart, + ':timeEnd' => $timeEnd); + } + + return Application_Common_Database::prepareAndExecute( $sql, $params, 'all'); + } + + /** + * Convert the columns given in the array $columnsToConvert in the + * database result $rows to local timezone. + * + * @param type $rows arrays of arrays containing database query result + * @param type $columnsToConvert array of column names to convert + */ + public static function convertToLocalTimeZone(&$rows, $columnsToConvert) + { + if (!is_array($rows)) { + return; + } + foreach ($rows as &$row) { + foreach ($columnsToConvert as $column) { + $row[$column] = Application_Common_DateHelper::ConvertToLocalDateTimeString($row[$column]); + } + } + } + + public static function getMaxLengths() + { + $con = Propel::getConnection(); + $sql = << 0 +SQL; + $result = $con->query($sql)->fetchAll(); + $assocArray = array(); + foreach ($result as $row) { + $assocArray[$row['column_name']] = $row['character_maximum_length']; + } + return $assocArray; + } + + public static function getStartEndCurrentMonthView() { + $first_day_of_calendar_month_view = mktime(0, 0, 0, date("n"), 1); + $weekStart = Application_Model_Preference::GetWeekStartDay(); + while (date('w', $first_day_of_calendar_month_view) != $weekStart) { + $first_day_of_calendar_month_view -= 60*60*24; + } + $last_day_of_calendar_view = $first_day_of_calendar_month_view + 3600*24*42; + + $start = new DateTime("@".$first_day_of_calendar_month_view); + $end = new DateTime("@".$last_day_of_calendar_view); + + return array($start, $end); + } + + public static function getStartEndCurrentWeekView() { + $first_day_of_calendar_week_view = mktime(0, 0, 0, date("n"), date("j")); + $weekStart = Application_Model_Preference::GetWeekStartDay(); + while (date('w', $first_day_of_calendar_week_view) != $weekStart) { + $first_day_of_calendar_week_view -= 60*60*24; + } + $last_day_of_calendar_view = $first_day_of_calendar_week_view + 3600*24*7; + + $start = new DateTime("@".$first_day_of_calendar_week_view); + $end = new DateTime("@".$last_day_of_calendar_view); + + return array($start, $end); + } + + public static function getStartEndCurrentDayView() { + $today = mktime(0, 0, 0, date("n"), date("j")); + $tomorrow = $today + 3600*24; + + $start = new DateTime("@".$today); + $end = new DateTime("@".$tomorrow); + + return array($start, $end); + } +} diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 1204f689c..e8322882b 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -175,15 +175,18 @@ class Application_Service_ScheduleService //create ccShow $ccShow = new CcShow(); $ccShow = $service_show->setShow($ccShow, $showData); + $showId = $ccShow->getDbId(); //create ccShowDay $service_show->createShowDays( - $showData, $ccShow->getDbId(), $user->getId(), $repeatType, $isRecorded); + $showData, $showId, $user->getId(), $repeatType, $isRecorded); + + //create ccShowRebroadcast + $service_show->createShowRebroadcast($showData, $showId, $repeatType, $isRecorded); //create ccShowHosts - - //create ccShowRebroadcast - + $service_show->createShowHosts($showData, $showId); + //populate ccShowInstances } } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php new file mode 100644 index 000000000..458cc4bd8 --- /dev/null +++ b/airtime_mvc/application/services/ShowService.php @@ -0,0 +1,145 @@ +setDbName($showData['add_show_name']); + $ccShow->setDbDescription($showData['add_show_description']); + $ccShow->setDbUrl($showData['add_show_url']); + $ccShow->setDbGenre($showData['add_show_genre']); + $ccShow->setDbColor($showData['add_show_color']); + $ccShow->setDbBackgroundColor($showData['add_show_background_color']); + $ccShow->setDbLiveStreamUsingAirtimeAuth($showData['cb_airtime_auth'] == 1); + $ccShow->setDbLiveStreamUsingCustomAuth($showData['cb_custom_auth'] == 1); + $ccShow->setDbLiveStreamUser($showData['custom_username']); + $ccShow->setDbLiveStreamPass($showData['custom_password']); + + $ccShow->save(); + return $ccShow; + } + + /** + * Creates new cc_show_days entries + */ + public function createShowDays($showData, $showId, $userId, $repeatType, $isRecorded) + { + $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); + + if ($showData['add_show_no_end']) { + $endDate = NULL; + } elseif ($showData['add_show_repeats']) { + $endDateTime = new DateTime($showData['add_show_end_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($showData['add_show_start_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + /* What we are doing here is checking if the show repeats or if + * any repeating days have been checked. If not, then by default + * the "selected" DOW is the initial day. + * DOW in local time. + */ + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$showData['add_show_repeats']) { + $showData['add_show_day_check'] = array($startDow); + } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { + $showData['add_show_day_check'] = array($startDow); + } + + // Don't set day for monthly repeat type, it's invalid + if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($showData['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } + } + + /** + * Creates new cc_show_rebroadcast entries + */ + public function createShowRebroadcast($showData, $showId, $repeatType, $isRecorded) + { + define("MAX_REBROADCAST_DATES", 10); + + if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { + for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + if ($showData['add_show_rebroadcast_date_'.$i]) { + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_'.$i]); + $showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } elseif ($isRecorded && $showData['add_show_rebroadcast'] && ($repeatType == -1)) { + for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + if ($showData['add_show_rebroadcast_date_absolute_'.$i]) { + $rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_$i"]); + $startDate = new DateTime($showData['add_show_start_date']); + $offsetDays = $startDate->diff($rebroadcastDate); + + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($offsetDays->format("%a days")); + $showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_absolute_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } + } + + /** + * Creates cc_show_hosts entries + */ + public function createShowHosts($showData, $showId) + { + if (is_array($showData['add_show_hosts'])) { + foreach ($showData['add_show_hosts'] as $host) { + $showHost = new CcShowHosts(); + $showHost->setDbShow($showId); + $showHost->setDbHost($host); + $showHost->save(); + } + } + } +} \ No newline at end of file From 8c8a7d11e1276a59df5b4e309395ae02c73dada2 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 13:21:39 -0500 Subject: [PATCH 005/128] Created empty showInstance service. Split populateShowUntil into 2 new functions: getPopulateDateUntil, and getShowDays --- .../application/services/ScheduleService.php | 5 ++- .../services/ShowInstanceService.php | 8 +++++ .../application/services/ShowService.php | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 airtime_mvc/application/services/ShowInstanceService.php diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index e8322882b..c0bc1a844 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -171,6 +171,7 @@ class Application_Service_ScheduleService if ($isAdminOrPM) { $service_show = new Application_Service_ShowService(); + $service_showInstances = new Application_Service_ShowInstanceService(); //create ccShow $ccShow = new CcShow(); @@ -187,7 +188,9 @@ class Application_Service_ScheduleService //create ccShowHosts $service_show->createShowHosts($showData, $showId); - //populate ccShowInstances + $populateShowsUntil = $service_show->getPopulateShowUntilDateTIme(); + //create ccShowInstances + $service_showInstances->createShowInstances($showId, $populateShowsUntil); } } diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php new file mode 100644 index 000000000..1f7a2eedc --- /dev/null +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -0,0 +1,8 @@ + $showId), 'all'); + } } \ No newline at end of file From c7203aa40dd6a4b92b198671e83b2d43e7b6c774 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 17:41:35 -0500 Subject: [PATCH 006/128] CC-4961: Show linking Refactored some more show instance creation functions --- airtime_mvc/application/models/Show.php | 10 +-- .../application/services/ScheduleService.php | 26 +++--- .../services/ShowInstanceService.php | 81 ++++++++++++++++++- .../application/services/ShowService.php | 70 +++++++++++++--- 4 files changed, 160 insertions(+), 27 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index d6f9db98b..23cc4d02e 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1310,7 +1310,7 @@ SQL; } } - Application_Model_Show::populateShowUntil($showId); + /*Application_Model_Show::populateShowUntil($showId);*/ Application_Model_RabbitMq::PushSchedule(); return $showId; @@ -1323,7 +1323,7 @@ SQL; * * @param int $p_showId */ - public static function populateShowUntil($p_showId) + /*public static function populateShowUntil($p_showId) { $con = Propel::getConnection(); $date = Application_Model_Preference::GetShowsPopulatedUntil(); @@ -1344,7 +1344,7 @@ SQL; foreach ($res as $showDaysRow) { Application_Model_Show::populateShow($showDaysRow, $p_populateUntilDateTime); } - } + }*/ /** * We are going to use cc_show_days as a template, to generate Show Instances. This function @@ -1357,7 +1357,7 @@ SQL; * @param DateTime $p_populateUntilDateTime * DateTime object in UTC time. */ - private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) + /*private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) { // TODO : use constants instead of int values here? or maybe php will // get enum types by the time somebody gets around to fix this. -- RG @@ -1371,7 +1371,7 @@ SQL; Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P1M'); } Application_Model_RabbitMq::PushSchedule(); - } + }*/ /** * Creates a single show instance. If the show is recorded, it may have multiple diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index c0bc1a844..0e6bbf2ff 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -2,6 +2,14 @@ class Application_Service_ScheduleService { + private $service_show; + private $service_showInstances; + + public function __construct() + { + $this->service_show = new Application_Service_ShowService(); + $this->service_showInstances = new Application_Service_ShowInstanceService(); + } /* * Form stuff begins here * Typically I would keep form creation and validation @@ -170,27 +178,23 @@ class Application_Service_ScheduleService $showData["add_show_duration"]); if ($isAdminOrPM) { - $service_show = new Application_Service_ShowService(); - $service_showInstances = new Application_Service_ShowInstanceService(); - //create ccShow $ccShow = new CcShow(); - $ccShow = $service_show->setShow($ccShow, $showData); + $ccShow = $this->service_show->setShow($ccShow, $showData); $showId = $ccShow->getDbId(); - //create ccShowDay - $service_show->createShowDays( + //create ccShowDays + $this->service_show->createShowDays( $showData, $showId, $user->getId(), $repeatType, $isRecorded); - //create ccShowRebroadcast - $service_show->createShowRebroadcast($showData, $showId, $repeatType, $isRecorded); + //create ccShowRebroadcasts + $this->service_show->createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); //create ccShowHosts - $service_show->createShowHosts($showData, $showId); + $this->service_show->createShowHosts($showData, $showId); - $populateShowsUntil = $service_show->getPopulateShowUntilDateTIme(); //create ccShowInstances - $service_showInstances->createShowInstances($showId, $populateShowsUntil); + $this->service_showInstances->createShowInstances($showId); } } diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 1f7a2eedc..2b4d9a5f8 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -1,8 +1,85 @@ service_show = new Application_Service_ShowService(); + } + + /** + * + * Receives a cc_show id and determines whether to create a + * single show_instance or repeating show instances + */ + public function createShowInstances($showId) + { + $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); + + $showDays = $this->service_show->getShowDays($showId); + foreach ($showDays as $day) { + switch ($day["repeat_type"]) { + case self::NO_REPEAT: + $this->createNonRepeatingShowInstance($day, $populateUntil); + break; + case self::REPEAT_WEEKLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P7D"); + break; + case self::REPEAT_BI_WEEKLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P14D"); + break; + case self::REPEAT_MONTHLY_MONTHLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P1M"); + break; + case self::REPEAT_MONTHLY_WEEKLY: + // do something here + break; + } + } + } + + /** + * + * Enter description here ... + * @param $showDay + * @param $populateUntil + */ + private function createNonRepeatingShowInstance($showDay, $populateUntil) + { + $start = $showDay["first_show"]." ".$showDay["start_time"]; + + list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( + $start, $showDay["duration"], $showDay["timezone"]); + + if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + $ccShowInstance = new CcShowInstances(); + if ($ccShowInstance->getTimestamp() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($showDay["show_id"]); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($showDay["record"]); + $ccShowInstance->save(); + } + } + } + + /** + * + * Enter description here ... + * @param $showDay + * @param $populateUntil + * @param $repeatInterval + */ + private function createRepeatingShowInstances($showDay, $populateUntil, $repeatInterval) + { + Logging::info("repeating"); } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 82153300a..f69d42e42 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -2,8 +2,13 @@ class Application_Service_ShowService { + const MAX_REBROADCAST_DATES = 10; + /** - * Sets a cc_show entry + * + * Enter description here ... + * @param $ccShow + * @param $showData */ public function setShow($ccShow, $showData) { @@ -23,7 +28,13 @@ class Application_Service_ShowService } /** - * Creates new cc_show_days entries + * + * Enter description here ... + * @param $showData + * @param $showId + * @param $userId + * @param $repeatType + * @param $isRecorded */ public function createShowDays($showData, $showId, $userId, $repeatType, $isRecorded) { @@ -95,14 +106,17 @@ class Application_Service_ShowService } /** - * Creates new cc_show_rebroadcast entries + * + * Enter description here ... + * @param $showData + * @param $showId + * @param $repeatType + * @param $isRecorded */ - public function createShowRebroadcast($showData, $showId, $repeatType, $isRecorded) + public function createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded) { - define("MAX_REBROADCAST_DATES", 10); - if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { - for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_'.$i]) { $showRebroad = new CcShowRebroadcast(); $showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_'.$i]); @@ -112,7 +126,7 @@ class Application_Service_ShowService } } } elseif ($isRecorded && $showData['add_show_rebroadcast'] && ($repeatType == -1)) { - for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_absolute_'.$i]) { $rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_$i"]); $startDate = new DateTime($showData['add_show_start_date']); @@ -129,7 +143,10 @@ class Application_Service_ShowService } /** - * Creates cc_show_hosts entries + * + * Enter description here ... + * @param $showData + * @param $showId */ public function createShowHosts($showData, $showId) { @@ -174,4 +191,39 @@ class Application_Service_ShowService return Application_Common_Database::prepareAndExecute( $sql, array(":show_id" => $showId), 'all'); } + + /** + * + * Enter description here ... + * @param $localStart timestring format "Y-m-d H:i:s" (not UTC) + * @param $duration string time interval (h)h:(m)m(:ss) + * @param $timezone string "Europe/Prague" + * @param $offset array (days, hours, mins) used for rebroadcast shows + * + * @return array of 2 DateTime objects, start/end time of the show in UTC + */ + public function createUTCStartEndDateTime($localStart, $duration, $timezone=null, $offset=null) + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + if (!isset($timezone)) { + $timezone = Application_Model_Preference::GetUserTimezone($user->getId()); + } + + $startDateTime = new DateTime($localStart, new DateTimeZone($timezone)); + if (isset($offset)) { + $startDateTime->add(new DateInterval("P{$offset["days"]}DT{$offset["hours"]}H{$offset["mins"]}M")); + } + //convert time to UTC + $startDateTime->setTimezone(new DateTimeZone('UTC')); + + $endDateTime = clone $startDateTime; + $duration = explode(":", $duration); + list($hours, $mins) = array_slice($duration, 0, 2); + $endDateTime->add(new DateInterval("PT{$hours}H{$mins}M")); + + return array($startDateTime, $endDateTime); + } } \ No newline at end of file From d08f6cf3e17591faa34cae0ac7a3cf63017b436c Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 21 Feb 2013 17:57:56 -0500 Subject: [PATCH 007/128] CC-4961: Show linking -initial schedule service experimentation --- .../controllers/ScheduleController.php | 20 +- .../controllers/_old_ScheduleController.php | 1002 +++++++++++++ airtime_mvc/application/models/Schedule.php | 36 +- .../application/models/_old_Schedule.php | 1329 +++++++++++++++++ .../application/services/ScheduleService.php | 90 ++ 5 files changed, 2458 insertions(+), 19 deletions(-) create mode 100644 airtime_mvc/application/controllers/_old_ScheduleController.php create mode 100644 airtime_mvc/application/models/_old_Schedule.php create mode 100644 airtime_mvc/application/services/ScheduleService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 08fde37dc..9ca879918 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -5,6 +5,8 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; + private $service_schedule; + public function init() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); @@ -38,6 +40,8 @@ class ScheduleController extends Zend_Controller_Action ->initContext(); $this->sched_sess = new Zend_Session_Namespace("schedule"); + + $this->service_schedule = new Application_Service_ScheduleService(); } public function indexAction() @@ -90,13 +94,27 @@ class ScheduleController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']); //End Show builder JS/CSS requirements + $forms = $this->service_schedule->createShowForms(); + // populate forms with default values + $this->service_schedule->populateNewShowForms( + $forms["what"], $forms["when"], $forms["repeats"]); + + $this->view->what = $forms["what"]; + $this->view->when = $forms["when"]; + $this->view->repeats = $forms["repeats"]; + $this->view->live = $forms["live"]; + $this->view->rr = $forms["record"]; + $this->view->absoluteRebroadcast = $forms["abs_record"]; + $this->view->rebroadcast = $forms["rebroadcast"]; + $this->view->who = $forms["who"]; + $this->view->style = $forms["style"]; - Application_Model_Schedule::createNewFormSections($this->view); $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { $this->view->preloadShowForm = true; } + $this->view->addNewShow = true; $this->view->headScript()->appendScript( "var calendarPref = {};\n". "calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n". diff --git a/airtime_mvc/application/controllers/_old_ScheduleController.php b/airtime_mvc/application/controllers/_old_ScheduleController.php new file mode 100644 index 000000000..08fde37dc --- /dev/null +++ b/airtime_mvc/application/controllers/_old_ScheduleController.php @@ -0,0 +1,1002 @@ +_helper->getHelper('AjaxContext'); + $ajaxContext->addActionContext('event-feed', 'json') + ->addActionContext('event-feed-preload', 'json') + ->addActionContext('make-context-menu', 'json') + ->addActionContext('add-show-dialog', 'json') + ->addActionContext('add-show', 'json') + ->addActionContext('edit-show', 'json') + ->addActionContext('move-show', 'json') + ->addActionContext('resize-show', 'json') + ->addActionContext('delete-show', 'json') + ->addActionContext('show-content-dialog', 'json') + ->addActionContext('clear-show', 'json') + ->addActionContext('get-current-playlist', 'json') + ->addActionContext('remove-group', 'json') + ->addActionContext('populate-show-form', 'json') + ->addActionContext('populate-show-instance-form', 'json') + ->addActionContext('cancel-show', 'json') + ->addActionContext('cancel-current-show', 'json') + ->addActionContext('get-form', 'json') + ->addActionContext('upload-to-sound-cloud', 'json') + ->addActionContext('content-context-menu', 'json') + ->addActionContext('set-time-scale', 'json') + ->addActionContext('set-time-interval', 'json') + ->addActionContext('edit-show-instance', 'json') + ->addActionContext('dj-edit-show', 'json') + ->addActionContext('calculate-duration', 'json') + ->addActionContext('get-current-show', 'json') + ->addActionContext('update-future-is-scheduled', 'json') + ->initContext(); + + $this->sched_sess = new Zend_Session_Namespace("schedule"); + } + + public function indexAction() + { + $CC_CONFIG = Config::getConfig(); + + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + //full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time + $this->view->headScript()->appendScript("var timezoneOffset = ".date("Z")."; //in seconds"); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/full-calendar-functions.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/fullcalendar/fullcalendar.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/colorpicker/js/colorpicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/add-show.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/schedule/schedule.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/fullcalendar.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/colorpicker/css/colorpicker.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/add-show.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']); + + //Start Show builder JS/CSS requirements + $this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.TableTools.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.js?'.$CC_CONFIG['airtime_version'], 'text/javascript'); + + $this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + + $this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/TableTools.css?'.$CC_CONFIG['airtime_version']); + $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']); + //End Show builder JS/CSS requirements + + + Application_Model_Schedule::createNewFormSections($this->view); + $user = Application_Model_User::getCurrentUser(); + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $this->view->preloadShowForm = true; + } + + $this->view->headScript()->appendScript( + "var calendarPref = {};\n". + "calendarPref.weekStart = ".Application_Model_Preference::GetWeekStartDay().";\n". + "calendarPref.timestamp = ".time().";\n". + "calendarPref.timezoneOffset = ".date("Z").";\n". + "calendarPref.timeScale = '".Application_Model_Preference::GetCalendarTimeScale()."';\n". + "calendarPref.timeInterval = ".Application_Model_Preference::GetCalendarTimeInterval().";\n". + "calendarPref.weekStartDay = ".Application_Model_Preference::GetWeekStartDay().";\n". + "var calendarEvents = null;" + ); + } + + public function eventFeedAction() + { + $start = new DateTime($this->_getParam('start', null)); + $start->setTimezone(new DateTimeZone("UTC")); + $end = new DateTime($this->_getParam('end', null)); + $end->setTimezone(new DateTimeZone("UTC")); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable); + $this->view->events = $events; + } + + public function eventFeedPreloadAction() + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $calendar_interval = Application_Model_Preference::GetCalendarTimeScale(); + Logging::info($calendar_interval); + if ($calendar_interval == "agendaDay") { + list($start, $end) = Application_Model_Show::getStartEndCurrentDayView(); + } else if ($calendar_interval == "agendaWeek") { + list($start, $end) = Application_Model_Show::getStartEndCurrentWeekView(); + } else if ($calendar_interval == "month") { + list($start, $end) = Application_Model_Show::getStartEndCurrentMonthView(); + } else { + Logging::error("Invalid Calendar Interval '$calendar_interval'"); + } + + $events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable); + $this->view->events = $events; + } + + public function getCurrentShowAction() + { + $currentShow = Application_Model_Show::getCurrentShow(); + if (!empty($currentShow)) { + $this->view->si_id = $currentShow[0]["instance_id"]; + $this->view->current_show = true; + } else { + $this->view->current_show = false; + } + } + + public function moveShowAction() + { + $deltaDay = $this->_getParam('day'); + $deltaMin = $this->_getParam('min'); + $showInstanceId = $this->_getParam('showInstanceId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $error = $showInstance->moveShow($deltaDay, $deltaMin); + } + + if (isset($error)) { + $this->view->error = $error; + } + } + + public function resizeShowAction() + { + $deltaDay = $this->_getParam('day'); + $deltaMin = $this->_getParam('min'); + $showId = $this->_getParam('showId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + try { + $show = new Application_Model_Show($showId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $error = $show->resizeShow($deltaDay, $deltaMin); + } + + if (isset($error)) { + $this->view->error = $error; + } + } + + public function deleteShowAction() + { + $showInstanceId = $this->_getParam('id'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + Logging::info($e->getMessage()); + $this->view->show_error = true; + + return false; + } + + $showInstance->delete(); + + $this->view->show_id = $showInstance->getShowId(); + } + } + + public function uploadToSoundCloudAction() + { + $show_instance = $this->_getParam('id'); + try { + $show_inst = new Application_Model_ShowInstance($show_instance); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $file = $show_inst->getRecordedFile(); + $id = $file->getId(); + Application_Model_Soundcloud::uploadSoundcloud($id); + // we should die with ui info + $this->_helper->json->sendJson(null); + } + + public function makeContextMenuAction() + { + $id = $this->_getParam('id'); + $menu = array(); + $epochNow = time(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $instance = new Application_Model_ShowInstance($id); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $isDJ = $user->isHostOfShow($instance->getShowId()); + + $showStartLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceStart()); + $showEndLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceEnd()); + + if ($instance->isRecorded() && $epochNow > $showEndLocalDT->getTimestamp()) { + + $file = $instance->getRecordedFile(); + $fileId = $file->getId(); + + $menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview", + "url" => $baseUrl."library/edit-file-md/id/".$fileId); + } + + if ($epochNow < $showStartLocalDT->getTimestamp()) { + if ( ($isAdminOrPM || $isDJ) + && !$instance->isRecorded() + && !$instance->isRebroadcast()) { + + $menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content", + "url" => $baseUrl."showbuilder/builder-dialog/"); + + $menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content", + "url" => $baseUrl."schedule/clear-show"); + } + } + + if (!$instance->isRecorded()) { + + $menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog"); + } + + if ($showEndLocalDT->getTimestamp() <= $epochNow + && $instance->isRecorded() + && Application_Model_Preference::GetUploadToSoundcloudOption()) { + + $file = $instance->getRecordedFile(); + $fileId = $file->getId(); + $scid = $instance->getSoundCloudFileId(); + + if ($scid > 0) { + $url = $file->getSoundCloudLinkToFile(); + $menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url); + } + + $text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud'); + $menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud"); + } + + if ($showStartLocalDT->getTimestamp() <= $epochNow && + $epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) { + + if ($instance->isRecorded()) { + $menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); + } else { + + if (!$instance->isRebroadcast()) { + $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); + } + + $menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); + } + } + + if ($epochNow < $showStartLocalDT->getTimestamp()) { + + if (!$instance->isRebroadcast() && $isAdminOrPM) { + $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); + } + + if ($instance->getShow()->isRepeating() && $isAdminOrPM) { + + //create delete sub menu. + $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "items" => array()); + + $menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); + + $menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show"); + } elseif ($isAdminOrPM) { + + $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); + } + } + + $this->view->items = $menu; + } + + public function clearShowAction() + { + $showInstanceId = $this->_getParam('id'); + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)) || $user->isHostOfShow($show->getShowId())) + $show->clearShow(); + } + + public function getCurrentPlaylistAction() + { + $range = Application_Model_Schedule::GetPlayOrderRange(); + $show = Application_Model_Show::getCurrentShow(); + + /* Convert all UTC times to localtime before sending back to user. */ + if (isset($range["previous"])) { + $range["previous"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["previous"]["starts"]); + $range["previous"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["previous"]["ends"]); + } + if (isset($range["current"])) { + $range["current"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["current"]["starts"]); + $range["current"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["current"]["ends"]); + } + if (isset($range["next"])) { + $range["next"]["starts"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["next"]["starts"]); + $range["next"]["ends"] = Application_Common_DateHelper::ConvertToLocalDateTimeString($range["next"]["ends"]); + } + + Application_Model_Show::convertToLocalTimeZone($range["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); + Application_Model_Show::convertToLocalTimeZone($range["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); + + $source_status = array(); + $switch_status = array(); + $live_dj = Application_Model_Preference::GetSourceStatus("live_dj"); + $master_dj = Application_Model_Preference::GetSourceStatus("master_dj"); + + $scheduled_play_switch = Application_Model_Preference::GetSourceSwitchStatus("scheduled_play"); + $live_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("live_dj"); + $master_dj_switch = Application_Model_Preference::GetSourceSwitchStatus("master_dj"); + + //might not be the correct place to implement this but for now let's just do it here + $source_status['live_dj_source'] = $live_dj; + $source_status['master_dj_source'] = $master_dj; + $this->view->source_status = $source_status; + + $switch_status['live_dj_source'] = $live_dj_switch; + $switch_status['master_dj_source'] = $master_dj_switch; + $switch_status['scheduled_play'] = $scheduled_play_switch; + $this->view->switch_status = $switch_status; + + $this->view->entries = $range; + $this->view->show_name = isset($show[0])?$show[0]["name"]:""; + } + + public function removeGroupAction() + { + $showInstanceId = $this->sched_sess->showInstanceId; + $group_id = $this->_getParam('groupId'); + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)) || $user->isHostOfShow($show->getShowId())) { + $show->removeGroupFromShow($group_id); + } + + $this->view->showContent = $show->getShowContent(); + $this->view->timeFilled = $show->getTimeScheduled(); + $this->view->percentFilled = $show->getPercentScheduled(); + $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); + unset($this->view->showContent); + } + + public function showContentDialogAction() + { + $showInstanceId = $this->_getParam('id'); + try { + $show = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $originalShowId = $show->isRebroadcast(); + if (!is_null($originalShowId)) { + try { + $originalShow = new Application_Model_ShowInstance($originalShowId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $originalShowName = $originalShow->getName(); + $originalShowStart = $originalShow->getShowInstanceStart(); + + //convert from UTC to user's timezone for display. + $originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC")); + $originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + //$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s")); + $this->view->additionalShowInfo = + sprintf(_("Rebroadcast of show %s from %s at %s"), + $originalShowName, + $originalDateTime->format("l, F jS"), + $originalDateTime->format("G:i")); + } + $this->view->showLength = $show->getShowLength(); + $this->view->timeFilled = $show->getTimeScheduled(); + $this->view->percentFilled = $show->getPercentScheduled(); + $this->view->showContent = $show->getShowListContent(); + $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); + $this->view->showTitle = htmlspecialchars($show->getName()); + unset($this->view->showContent); + } + + // we removed edit show instance option in menu item + // this feature is disabled in 2.1 and should be back in 2.2 + /*public function populateShowInstanceFormAction(){ + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $this->view->live = $formLive; + $this->view->addNewShow = false; + + $showInstanceId = $this->_getParam('id'); + + $show_instance = CcShowInstancesQuery::create()->findPK($showInstanceId); + $show = new Application_Model_Show($show_instance->getDbShowId()); + + $starts_string = $show_instance->getDbStarts(); + $ends_string = $show_instance->getDbEnds(); + + $starts_datetime = new DateTime($starts_string, new DateTimeZone("UTC")); + $ends_datetime = new DateTime($ends_string, new DateTimeZone("UTC")); + + $starts_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $ends_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $instance_duration = $starts_datetime->diff($ends_datetime); + + $formWhat->populate(array('add_show_id' => $show->getId(), + 'add_show_instance_id' => $showInstanceId, + 'add_show_name' => $show->getName(), + 'add_show_url' => $show->getUrl(), + 'add_show_genre' => $show->getGenre(), + 'add_show_description' => $show->getDescription())); + + $formWhen->populate(array('add_show_start_date' => $starts_datetime->format("Y-m-d"), + 'add_show_start_time' => $starts_datetime->format("H:i"), + 'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"), + 'add_show_end_time' => $ends_datetime->format("H:i"), + 'add_show_duration' => $instance_duration->format("%h"))); + + $formWhat->disable(); + $formWho->disable(); + $formWhen->disableRepeatCheckbox(); + $formRepeats->disable(); + $formStyle->disable(); + + //$formRecord->disable(); + //$formAbsoluteRebroadcast->disable(); + //$formRebroadcast->disable(); + + $this->view->action = "edit-show-instance"; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + }*/ + + public function populateShowFormAction() + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + + $showInstanceId = $this->_getParam('id'); + + $this->view->action = "edit-show"; + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $isDJ = $user->isHostOfShow($showInstance->getShowId()); + + if (!($isAdminOrPM || $isDJ)) { + return; + } + + // in case a user was once a dj and had been assigned to a show + // but was then changed to an admin user we need to allow + // the user to edit the show as an admin (CC-4925) + if ($isDJ && !$isAdminOrPM) { + $this->view->action = "dj-edit-show"; + } + + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $this->view->live = $formLive; + $this->view->addNewShow = false; + + $show = new Application_Model_Show($showInstance->getShowId()); + + $formWhat->populate(array('add_show_id' => $show->getId(), + 'add_show_instance_id' => $showInstanceId, + 'add_show_name' => $show->getName(), + 'add_show_url' => $show->getUrl(), + 'add_show_genre' => $show->getGenre(), + 'add_show_description' => $show->getDescription())); + + $startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone("UTC")); + $endsDateTime = new DateTime($show->getEndDate()." ".$show->getEndTime(), new DateTimeZone("UTC")); + + $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"), + 'add_show_start_time' => $startsDateTime->format("H:i"), + 'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"), + 'add_show_end_time' => $endsDateTime->format("H:i"), + 'add_show_duration' => $show->getDuration(true), + 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); + + if ($show->isStartDateTimeInPast()) { + // for a non-repeating show, we should never allow user to change the start time. + // for the repeating show, we should allow because the form works as repeating template form + if (!$showInstance->getShow()->isRepeating()) { + $formWhen->disableStartDateAndTime(); + } else { + $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); + $formWhen->getElement('add_show_start_date')->setValue($nextFutureRepeatShow["starts"]->format("Y-m-d")); + $formWhen->getElement('add_show_start_time')->setValue($nextFutureRepeatShow["starts"]->format("H:i")); + $formWhen->getElement('add_show_end_date_no_repeat')->setValue($nextFutureRepeatShow["ends"]->format("Y-m-d")); + $formWhen->getElement('add_show_end_time')->setValue($nextFutureRepeatShow["ends"]->format("H:i")); + } + } + + //need to get the days of the week in the php timezone (for the front end). + $days = array(); + $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find(); + foreach ($showDays as $showDay) { + $showStartDay = new DateTime($showDay->getDbFirstShow(), new DateTimeZone($showDay->getDbTimezone())); + $showStartDay->setTimezone(new DateTimeZone(date_default_timezone_get())); + array_push($days, $showStartDay->format('w')); + } + + $displayedEndDate = new DateTime($show->getRepeatingEndDate(), new DateTimeZone($showDays[0]->getDbTimezone())); + $displayedEndDate->sub(new DateInterval("P1D"));//end dates are stored non-inclusively. + $displayedEndDate->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(), + 'add_show_day_check' => $days, + 'add_show_end_date' => $displayedEndDate->format("Y-m-d"), + 'add_show_no_end' => ($show->getRepeatingEndDate() == ''))); + + $hosts = array(); + $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find(); + foreach ($showHosts as $showHost) { + array_push($hosts, $showHost->getDbHost()); + } + $formWho->populate(array('add_show_hosts' => $hosts)); + $formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), + 'add_show_color' => $show->getColor())); + + $formLive->populate($show->getLiveStreamInfo()); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $this->view->rr = $formRecord; + $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $this->view->rebroadcast = $formRebroadcast; + + $formRecord->populate(array('add_show_record' => $show->isRecorded(), + 'add_show_rebroadcast' => $show->isRebroadcast())); + + $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true)); + + + + $rebroadcastsRelative = $show->getRebroadcastsRelative(); + $rebroadcastFormValues = array(); + $i = 1; + foreach ($rebroadcastsRelative as $rebroadcast) { + $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; + $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']); + $i++; + } + $formRebroadcast->populate($rebroadcastFormValues); + + $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute(); + $rebroadcastAbsoluteFormValues = array(); + $i = 1; + foreach ($rebroadcastsAbsolute as $rebroadcast) { + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time']; + $i++; + } + $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); + if (!$isAdminOrPM) { + $formRecord->disable(); + $formAbsoluteRebroadcast->disable(); + $formRebroadcast->disable(); + } + + if (!$isAdminOrPM) { + $formWhat->disable(); + $formWho->disable(); + $formWhen->disable(); + $formRepeats->disable(); + $formStyle->disable(); + } + + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + $this->view->entries = 5; + } + + public function getFormAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + Application_Model_Schedule::createNewFormSections($this->view); + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + } + + public function djEditShowAction() + { + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + //update cc_show + $show = new Application_Model_Show($data["add_show_id"]); + $show->setAirtimeAuthFlag($data["cb_airtime_auth"]); + $show->setCustomAuthFlag($data["cb_custom_auth"]); + $show->setCustomUsername($data["custom_username"]); + $show->setCustomPassword($data["custom_password"]); + + $this->view->edit = true; + } + + /*public function editShowInstanceAction(){ + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $success = Application_Model_Schedule::updateShowInstance($data, $this); + if ($success) { + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + } else { + $this->view->addNewShow = false; + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + }*/ + + public function editShowAction() + { + //1) Get add_show_start_date since it might not have been sent + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $data['add_show_hosts'] = $this->_getParam('hosts'); + $data['add_show_day_check'] = $this->_getParam('days'); + + if ($data['add_show_day_check'] == "") { + $data['add_show_day_check'] = null; + } + + $show = new Application_Model_Show($data['add_show_id']); + + $validateStartDate = true; + $validateStartTime = true; + if (!array_key_exists('add_show_start_date', $data)) { + //Changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + //The start date will be returned in UTC time, so lets convert it to local time. + $dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDateAndTime()); + $data['add_show_start_date'] = $dt->format("Y-m-d"); + + if (!array_key_exists('add_show_start_time', $data)) { + $data['add_show_start_time'] = $dt->format("H:i"); + $validateStartTime = false; + } + $validateStartDate = false; + } + $data['add_show_record'] = $show->isRecorded(); + + if ($show->isRepeating()) { + $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); + $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; + } else { + $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( + $show->getStartDateAndTime()); + } + + $success = Application_Model_Schedule::addUpdateShow($data, $this, + $validateStartDate, $originalShowStartDateTime, true, + $data['add_show_instance_id']); + + if ($success) { + $scheduler = new Application_Model_Scheduler(); + $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); + foreach ($showInstances as $si) { + $scheduler->removeGaps($si->getDbId()); + } + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + } else { + if (!$validateStartDate) { + $this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } + if (!$validateStartTime) { + $this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true)); + } + $this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true)); + $this->view->addNewShow = false; + $this->view->action = "edit-show"; + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } + } + + public function addShowAction() + { + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach ($js as $j) { + $data[$j["name"]] = $j["value"]; + } + + $data['add_show_hosts'] = $this->_getParam('hosts'); + $data['add_show_day_check'] = $this->_getParam('days'); + + if ($data['add_show_day_check'] == "") { + $data['add_show_day_check'] = null; + } + + $validateStartDate = true; + $success = Application_Model_Schedule::addUpdateShow($data, $this, + $validateStartDate); + + if ($success) { + $this->view->addNewShow = true; + $this->view->newForm = $this->view->render( + 'schedule/add-show-form.phtml'); + Logging::debug("Show creation succeeded"); + } else { + $this->view->addNewShow = true; + $this->view->form = $this->view->render( + 'schedule/add-show-form.phtml'); + Logging::debug("Show creation failed"); + } + } + + public function cancelShowAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $showInstanceId = $this->_getParam('id'); + + try { + $showInstance = new Application_Model_ShowInstance($showInstanceId); + } catch (Exception $e) { + $this->view->show_error = true; + + return false; + } + $show = new Application_Model_Show($showInstance->getShowId()); + + $show->cancelShow($showInstance->getShowInstanceStart()); + $this->view->show_id = $showInstance->getShowId(); + } + } + + public function cancelCurrentShowAction() + { + $user = Application_Model_User::getCurrentUser(); + + if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + $id = $this->_getParam('id'); + + try { + $scheduler = new Application_Model_Scheduler(); + $scheduler->cancelShow($id); + Application_Model_StoredFile::updatePastFilesIsScheduled(); + // send kick out source stream signal to pypo + $data = array("sourcename"=>"live_dj"); + Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data); + } catch (Exception $e) { + $this->view->error = $e->getMessage(); + Logging::info($e->getMessage()); + } + } + } + + public function contentContextMenuAction() + { + $id = $this->_getParam('id'); + + $params = '/format/json/id/#id#/'; + + $paramsPop = str_replace('#id#', $id, $params); + + // added for downlaod + $id = $this->_getParam('id'); + + $file_id = $this->_getParam('id', null); + $file = Application_Model_StoredFile::Recall($file_id); + + $baseUrl = $this->getRequest()->getBaseUrl(); + $url = $file->getRelativeFileUrl($baseUrl).'download/true'; + $menu[] = array('action' => array('type' => 'gourl', 'url' => $url), + 'title' => _('Download')); + + //returns format jjmenu is looking for. + $this->_helper->json->sendJson($menu); + } + + /** + * Sets the user specific preference for which time scale to use in Calendar. + * This is only being used by schedule.js at the moment. + */ + public function setTimeScaleAction() + { + Application_Model_Preference::SetCalendarTimeScale($this->_getParam('timeScale')); + } + +/** + * Sets the user specific preference for which time interval to use in Calendar. + * This is only being used by schedule.js at the moment. + */ + public function setTimeIntervalAction() + { + Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval')); + } + + public function calculateDurationAction() + { + $startParam = $this->_getParam('startTime'); + $endParam = $this->_getParam('endTime'); + + try { + $startDateTime = new DateTime($startParam); + $endDateTime = new DateTime($endParam); + + $UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC')); + $UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC')); + + $duration = $UTCEndDateTime->diff($UTCStartDateTime); + + $day = intval($duration->format('%d')); + if ($day > 0) { + $hour = intval($duration->format('%h')); + $min = intval($duration->format('%i')); + $hour += $day * 24; + $hour = min($hour, 99); + $sign = $duration->format('%r'); + $result = sprintf('%s%02dh %02dm', $sign, $hour, $min); + } else { + $result = $duration->format('%r%Hh %Im'); + } + } catch (Exception $e) { + $result = "Invalid Date"; + } + + echo Zend_Json::encode($result); + exit(); + } + + public function updateFutureIsScheduledAction() + { + $schedId = $this->_getParam('schedId'); + $redrawLibTable = Application_Model_StoredFile::setIsScheduled($schedId, false); + $this->_helper->json->sendJson(array("redrawLibTable" => $redrawLibTable)); + } +} diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 1aac2566e..2778074d2 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -960,7 +960,7 @@ SQL; Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); } - public static function createNewFormSections($p_view) + /*public static function createNewFormSections($p_view) { $formWhat = new Application_Form_AddShowWhat(); $formWho = new Application_Form_AddShowWho(); @@ -1005,7 +1005,7 @@ SQL; $p_view->absoluteRebroadcast = $formAbsoluteRebroadcast; $p_view->rebroadcast = $formRebroadcast; $p_view->addNewShow = true; - } + }*/ /* This function is responsible for handling the case where an individual * show instance in a repeating show was edited (via the context menu in the Calendar). @@ -1140,13 +1140,13 @@ SQL; $data["add_show_duration"] = $hValue.":".$mValue; - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); - $formRecord->removeDecorator('DtDdWrapper'); - $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); - $formRebroadcast->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); $record = $formRecord->isValid($data); @@ -1156,18 +1156,18 @@ SQL; if ($repeats) { $repeats = $formRepeats->checkReliantFields($data); } - $formAbsoluteRebroadcast->reset(); - //make it valid, results don't matter anyways. - $rebroadAb = 1; + $formAbsoluteRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroadAb = 1; - if ($data["add_show_rebroadcast"]) { - $rebroad = $formRebroadcast->isValid($data); - if ($rebroad) { - $rebroad = $formRebroadcast->checkReliantFields($data); - } - } else { - $rebroad = 1; + if ($data["add_show_rebroadcast"]) { + $rebroad = $formRebroadcast->isValid($data); + if ($rebroad) { + $rebroad = $formRebroadcast->checkReliantFields($data); } + } else { + $rebroad = 1; + } } else { $repeats = 1; $formRebroadcast->reset(); diff --git a/airtime_mvc/application/models/_old_Schedule.php b/airtime_mvc/application/models/_old_Schedule.php new file mode 100644 index 000000000..1aac2566e --- /dev/null +++ b/airtime_mvc/application/models/_old_Schedule.php @@ -0,0 +1,1329 @@ + NOW() AT TIME ZONE 'UTC' +SQL; + $count = Application_Common_Database::prepareAndExecute( $sql, array( + ':file_id'=>$p_fileId), 'column'); + return (is_numeric($count) && ($count != '0')); + } + + public static function getAllFutureScheduledFiles() + { + $con = Propel::getConnection(); + $sql = << now() AT TIME ZONE 'UTC' +AND file_id is not null +SQL; + $files = $con->query($sql)->fetchAll(); + $real_files = array(); + foreach ($files as $f) { + $real_files[] = $f['file_id']; + } + + return $real_files; + } + + public static function getAllFutureScheduledWebstreams() + { + $con = Propel::getConnection(); + $sql = << now() AT TIME ZONE 'UTC' +AND stream_id is not null +SQL; + $streams = $con->query($sql)->fetchAll(); + $real_streams = array(); + foreach ($streams as $s) { + $real_streams[] = $s['stream_id']; + } + + return $real_streams; + } + /** + * Returns data related to the scheduled items. + * + * @param int $p_prev + * @param int $p_next + * @return date + */ + public static function GetPlayOrderRange($p_prev = 1, $p_next = 1) + { + if (!is_int($p_prev) || !is_int($p_next)) { + //must enter integers to specify ranges + Logging::info("Invalid range parameters: $p_prev or $p_next"); + + return array(); + } + + $date = new Application_Common_DateHelper; + $timeNow = $date->getTimestamp(); + $utcTimeNow = $date->getUtcTimestamp(); + + $shows = Application_Model_Show::getPrevCurrentNext($utcTimeNow); + $previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['instance_id']:null; + $currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['instance_id']:null; + $nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['instance_id']:null; + $results = self::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow); + + $range = array("env"=>APPLICATION_ENV, + "schedulerTime"=>$timeNow, + "previous"=>$results['previous'] !=null?$results['previous']:(count($shows['previousShow'])>0?$shows['previousShow'][0]:null), + "current"=>$results['current'] !=null?$results['current']:((count($shows['currentShow'])>0 && $shows['currentShow'][0]['record'] == 1)?$shows['currentShow'][0]:null), + "next"=> $results['next'] !=null?$results['next']:(count($shows['nextShow'])>0?$shows['nextShow'][0]:null), + "currentShow"=>$shows['currentShow'], + "nextShow"=>$shows['nextShow'], + "timezone"=> date("T"), + "timezoneOffset"=> date("Z") + ); + + return $range; + } + + /** + * Queries the database for the set of schedules one hour before + * and after the given time. If a show starts and ends within that + * time that is considered the current show. Then the scheduled item + * before it is the previous show, and the scheduled item after it + * is the next show. This way the dashboard getCurrentPlaylist is + * very fast. But if any one of the three show types are not found + * through this mechanism a call is made to the old way of querying + * the database to find the track info. + **/ + public static function GetPrevCurrentNext($p_previousShowID, $p_currentShowID, $p_nextShowID, $p_timeNow) + { + if ($p_previousShowID == null && $p_currentShowID == null && $p_nextShowID == null) { + return; + } + + $sql = "SELECT %%columns%% st.starts as starts, st.ends as ends, + st.media_item_played as media_item_played, si.ends as show_ends + %%tables%% WHERE "; + + $fileColumns = "ft.artist_name, ft.track_title, "; + $fileJoin = "FROM cc_schedule st JOIN cc_files ft ON st.file_id = ft.id + LEFT JOIN cc_show_instances si ON st.instance_id = si.id"; + + $streamColumns = "ws.name AS artist_name, wm.liquidsoap_data AS track_title, "; + $streamJoin = << $rows[$i]["show_ends"]) { + $rows[$i]['ends'] = $rows[$i]["show_ends"]; + } + + if ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) && (strtotime($rows[$i]['ends']) >= $timeNowAsMillis)) { + if ($i - 1 >= 0) { + $results['previous'] = array("name"=>$rows[$i-1]["artist_name"]." - ".$rows[$i-1]["track_title"], + "starts"=>$rows[$i-1]["starts"], + "ends"=>$rows[$i-1]["ends"], + "type"=>'track'); + } + $results['current'] = array("name"=>$rows[$i]["artist_name"]." - ".$rows[$i]["track_title"], + "starts"=>$rows[$i]["starts"], + "ends"=> (($rows[$i]["ends"] > $rows[$i]["show_ends"]) ? $rows[$i]["show_ends"]: $rows[$i]["ends"]), + "media_item_played"=>$rows[$i]["media_item_played"], + "record"=>0, + "type"=>'track'); + if (isset($rows[$i+1])) { + $results['next'] = array("name"=>$rows[$i+1]["artist_name"]." - ".$rows[$i+1]["track_title"], + "starts"=>$rows[$i+1]["starts"], + "ends"=>$rows[$i+1]["ends"], + "type"=>'track'); + } + break; + } + if (strtotime($rows[$i]['ends']) < $timeNowAsMillis ) { + $previousIndex = $i; + } + if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) { + $results['next'] = array("name"=>$rows[$i]["artist_name"]." - ".$rows[$i]["track_title"], + "starts"=>$rows[$i]["starts"], + "ends"=>$rows[$i]["ends"], + "type"=>'track'); + break; + } + } + //If we didn't find a a current show because the time didn't fit we may still have + //found a previous show so use it. + if ($results['previous'] === null && isset($previousIndex)) { + $results['previous'] = array("name"=>$rows[$previousIndex]["artist_name"]." - ".$rows[$previousIndex]["track_title"], + "starts"=>$rows[$previousIndex]["starts"], + "ends"=>$rows[$previousIndex]["ends"]);; + } + + return $results; + } + + public static function GetLastScheduleItem($p_timeNow) + { + $sql = <<= sit.starts + AND st.starts < sit.ends +ORDER BY st.ends DESC LIMIT 1; +SQL; + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow'=>$p_timeNow)); + + return $row; + } + + public static function GetCurrentScheduleItem($p_timeNow, $p_instanceId) + { + /* Note that usually there will be one result returned. In some + * rare cases two songs are returned. This happens when a track + * that was overbooked from a previous show appears as if it + * hasnt ended yet (track end time hasn't been reached yet). For + * this reason, we need to get the track that starts later, as + * this is the *real* track that is currently playing. So this + * is why we are ordering by track start time. */ + $sql = "SELECT *" + ." FROM cc_schedule st" + ." LEFT JOIN cc_files ft" + ." ON st.file_id = ft.id" + ." WHERE st.starts <= TIMESTAMP :timeNow1" + ." AND st.instance_id = :instanceId" + ." AND st.ends > TIMESTAMP :timeNow2" + ." ORDER BY st.starts DESC" + ." LIMIT 1"; + + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow1'=>$p_timeNow, ':instanceId'=>$p_instanceId, ':timeNow2'=>$p_timeNow,)); + + return $row; + } + + public static function GetNextScheduleItem($p_timeNow) + { + $sql = "SELECT" + ." ft.artist_name, ft.track_title," + ." st.starts as starts, st.ends as ends" + ." FROM cc_schedule st" + ." LEFT JOIN cc_files ft" + ." ON st.file_id = ft.id" + ." LEFT JOIN cc_show_instances sit" + ." ON st.instance_id = sit.id" + ." WHERE st.starts > TIMESTAMP :timeNow" + ." AND st.starts >= sit.starts" //this and the next line are necessary since we can overbook shows. + ." AND st.starts < sit.ends" + ." ORDER BY st.starts" + ." LIMIT 1"; + + $row = Application_Common_Database::prepareAndExecute($sql, array(':timeNow'=>$p_timeNow)); + + return $row; + } + + /* + * + * @param DateTime $p_startDateTime + * + * @param DateTime $p_endDateTime + * + * @return array $scheduledItems + * + */ + public static function GetScheduleDetailItems($p_start, $p_end, $p_shows) + { + $con = Propel::getConnection(); + + $p_start_str = $p_start->format("Y-m-d H:i:s"); + $p_end_str = $p_end->format("Y-m-d H:i:s"); + + + //We need to search 24 hours before and after the show times so that that we + //capture all of the show's contents. + $p_track_start= $p_start->sub(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + $p_track_end = $p_end->add(new DateInterval("PT24H"))->format("Y-m-d H:i:s"); + + $templateSql = <<= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) + ) +SQL; + + + $filesSql = str_replace("%%columns%%", + $filesColumns, + $templateSql); + $filesSql= str_replace("%%join%%", + $filesJoin, + $filesSql); + + $streamColumns = <<= '{$p_track_start}' + AND sched.starts < '{$p_track_end}') + OR (sched.ends > '{$p_track_start}' + AND sched.ends <= '{$p_track_end}') + OR (sched.starts <= '{$p_track_start}' + AND sched.ends >= '{$p_track_end}')) + ) + LEFT JOIN cc_subjs AS sub ON (ws.creator_id = sub.id) +SQL; + + $streamSql = str_replace("%%columns%%", + $streamColumns, + $templateSql); + $streamSql = str_replace("%%join%%", + $streamJoin, + $streamSql); + + + $showPredicate = ""; + if (count($p_shows) > 0) { + $showPredicate = " AND show_id IN (".implode(",", $p_shows).")"; + } + + $sql = <<= '{$p_start_str}' + AND si.starts < '{$p_end_str}') + OR (si.ends > '{$p_start_str}' + AND si.ends <= '{$p_end_str}') + OR (si.starts <= '{$p_start_str}' + AND si.ends >= '{$p_end_str}')) +ORDER BY si_starts, + sched_starts; +SQL; + + $rows = $con->query($sql)->fetchAll(PDO::FETCH_ASSOC); + + return $rows; + } + + public static function UpdateMediaPlayedStatus($p_id) + { + $con = Propel::getConnection(); + $sql = "UPDATE cc_schedule" + ." SET media_item_played=TRUE"; + // we need to update 'broadcasted' column as well + // check the current switch status + $live_dj = Application_Model_Preference::GetSourceSwitchStatus('live_dj') == 'on'; + $master_dj = Application_Model_Preference::GetSourceSwitchStatus('master_dj') == 'on'; + $scheduled_play = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play') == 'on'; + + if (!$live_dj && !$master_dj && $scheduled_play) { + $sql .= ", broadcasted=1"; + } + + $sql .= " WHERE id=$p_id"; + + $retVal = $con->exec($sql); + + return $retVal; + } + + public static function UpdateBrodcastedStatus($dateTime, $value) + { + $now = $dateTime->format("Y-m-d H:i:s"); + + $sql = <<= :ends::TIMESTAMP +SQL; + + $retVal = Application_Common_Database::prepareAndExecute($sql, array( + ':broadcastedValue' => $value, + ':starts' => $now, + ':ends' => $now), 'execute'); + return $retVal; + } + + public static function getSchduledPlaylistCount() + { + $con = Propel::getConnection(); + $sql = "SELECT count(*) as cnt FROM cc_schedule"; + + return $con->query($sql)->fetchColumn(0); + } + + /** + * Convert a time string in the format "YYYY-MM-DD HH:mm:SS" + * to "YYYY-MM-DD-HH-mm-SS". + * + * @param string $p_time + * @return string + */ + private static function AirtimeTimeToPypoTime($p_time) + { + $p_time = substr($p_time, 0, 19); + $p_time = str_replace(" ", "-", $p_time); + $p_time = str_replace(":", "-", $p_time); + + return $p_time; + } + + /** + * Convert a time string in the format "YYYY-MM-DD-HH-mm-SS" to + * "YYYY-MM-DD HH:mm:SS". + * + * @param string $p_time + * @return string + */ + private static function PypoTimeToAirtimeTime($p_time) + { + $t = explode("-", $p_time); + + return $t[0]."-".$t[1]."-".$t[2]." ".$t[3].":".$t[4].":00"; + } + + /** + * Return true if the input string is in the format YYYY-MM-DD-HH-mm + * + * @param string $p_time + * @return boolean + */ + public static function ValidPypoTimeFormat($p_time) + { + $t = explode("-", $p_time); + if (count($t) != 5) { + return false; + } + foreach ($t as $part) { + if (!is_numeric($part)) { + return false; + } + } + + return true; + } + + /** + * Converts a time value as a string (with format HH:MM:SS.mmmmmm) to + * millisecs. + * + * @param string $p_time + * @return int + */ + public static function WallTimeToMillisecs($p_time) + { + $t = explode(":", $p_time); + $millisecs = 0; + if (strpos($t[2], ".")) { + $secParts = explode(".", $t[2]); + $millisecs = $secParts[1]; + $millisecs = str_pad(substr($millisecs, 0, 3),3, '0'); + $millisecs = intval($millisecs); + $seconds = intval($secParts[0]); + } else { + $seconds = intval($t[2]); + } + $ret = $millisecs + ($seconds * 1000) + ($t[1] * 60 * 1000) + ($t[0] * 60 * 60 * 1000); + + return $ret; + } + + /** + * Compute the difference between two times in the format . + * "HH:MM:SS.mmmmmm" Note: currently only supports calculating . + * millisec differences . + * + * @param string $p_time1 + * @param string $p_time2 + * @return double + */ + private static function TimeDiff($p_time1, $p_time2) + { + $parts1 = explode(".", $p_time1); + $parts2 = explode(".", $p_time2); + $diff = 0; + if ( (count($parts1) > 1) && (count($parts2) > 1) ) { + $millisec1 = substr($parts1[1], 0, 3); + $millisec1 = str_pad($millisec1, 3, "0"); + $millisec1 = intval($millisec1); + $millisec2 = substr($parts2[1], 0, 3); + $millisec2 = str_pad($millisec2, 3, "0"); + $millisec2 = intval($millisec2); + $diff = abs($millisec1 - $millisec2)/1000; + } + + return $diff; + } + + /** + * Returns an array of schedule items from cc_schedule table. Tries + * to return at least 3 items (if they are available). The parameters + * $p_startTime and $p_endTime specify the range. Schedule items returned + * do not have to be entirely within this range. It is enough that the end + * or beginning of the scheduled item is in the range. + * + * + * @param string $p_startTime + * In the format YYYY-MM-DD HH:MM:SS.nnnnnn + * @param string $p_endTime + * In the format YYYY-MM-DD HH:MM:SS.nnnnnn + * @return array + * Returns null if nothing found, else an array of associative + * arrays representing each row. + */ + public static function getItems($p_startTime, $p_endTime) + { + $baseQuery = << :startTime1 + AND st.starts < :endTime + AND st.playout_status > 0 + AND si.ends > :startTime2 + AND si.modified_instance = 'f' +ORDER BY st.starts +SQL; + + $sql = $baseQuery." ".$predicates; + + $rows = Application_Common_Database::prepareAndExecute($sql, array( + ':startTime1' => $p_startTime, + ':endTime' => $p_endTime, + ':startTime2' => $p_startTime)); + + if (count($rows) < 3) { + $dt = new DateTime("@".time()); + $dt->add(new DateInterval("PT24H")); + $range_end = $dt->format("Y-m-d H:i:s"); + + $predicates = << :startTime1 + AND st.starts < :rangeEnd + AND st.playout_status > 0 + AND si.ends > :startTime2 + AND si.modified_instance = 'f' +ORDER BY st.starts LIMIT 3 +SQL; + + $sql = $baseQuery." ".$predicates." "; + $rows = Application_Common_Database::prepareAndExecute($sql, + array( + ':startTime1' => $p_startTime, + ':rangeEnd' => $range_end, + ':startTime2' => $p_startTime)); + } + + return $rows; + } + + /** + * This function will ensure that an existing index in the + * associative array is never overwritten, instead appending + * _0, _1, _2, ... to the end of the key to make sure it is unique + */ + private static function appendScheduleItem(&$data, $time, $item) + { + $key = $time; + $i = 0; + + while (array_key_exists($key, $data["media"])) { + $key = "{$time}_{$i}"; + $i++; + } + + $data["media"][$key] = $item; + } + + private static function createInputHarborKickTimes(&$data, $range_start, $range_end) + { + $utcTimeZone = new DateTimeZone("UTC"); + $kick_times = Application_Model_ShowInstance::GetEndTimeOfNextShowWithLiveDJ($range_start, $range_end); + foreach ($kick_times as $kick_time_info) { + $kick_time = $kick_time_info['ends']; + $temp = explode('.', Application_Model_Preference::GetDefaultTransitionFade()); + // we round down transition time since PHP cannot handle millisecond. We need to + // handle this better in the future + $transition_time = intval($temp[0]); + $switchOffDataTime = new DateTime($kick_time, $utcTimeZone); + $switch_off_time = $switchOffDataTime->sub(new DateInterval('PT'.$transition_time.'S')); + $switch_off_time = $switch_off_time->format("Y-m-d H:i:s"); + + $kick_start = self::AirtimeTimeToPypoTime($kick_time); + $data["media"][$kick_start]['start'] = $kick_start; + $data["media"][$kick_start]['end'] = $kick_start; + $data["media"][$kick_start]['event_type'] = "kick_out"; + $data["media"][$kick_start]['type'] = "event"; + $data["media"][$kick_start]['independent_event'] = true; + + if ($kick_time !== $switch_off_time) { + $switch_start = self::AirtimeTimeToPypoTime($switch_off_time); + $data["media"][$switch_start]['start'] = $switch_start; + $data["media"][$switch_start]['end'] = $switch_start; + $data["media"][$switch_start]['event_type'] = "switch_off"; + $data["media"][$switch_start]['type'] = "event"; + $data["media"][$switch_start]['independent_event'] = true; + } + } + } + + private static function createFileScheduleEvent(&$data, $item, $media_id, $uri) + { + $start = self::AirtimeTimeToPypoTime($item["start"]); + $end = self::AirtimeTimeToPypoTime($item["end"]); + + list(,,,$start_hour,,) = explode("-", $start); + list(,,,$end_hour,,) = explode("-", $end); + + $same_hour = $start_hour == $end_hour; + $independent_event = !$same_hour; + + $replay_gain = is_null($item["replay_gain"]) ? "0": $item["replay_gain"]; + $replay_gain += Application_Model_Preference::getReplayGainModifier(); + + if ( !Application_Model_Preference::GetEnableReplayGain() ) { + $replay_gain = 0; + } + + $schedule_item = array( + 'id' => $media_id, + 'type' => 'file', + 'row_id' => $item["id"], + 'uri' => $uri, + 'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_in"]), + 'fade_out' => Application_Model_Schedule::WallTimeToMillisecs($item["fade_out"]), + 'cue_in' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_in"]), + 'cue_out' => Application_Common_DateHelper::CalculateLengthInSeconds($item["cue_out"]), + 'start' => $start, + 'end' => $end, + 'show_name' => $item["show_name"], + 'replay_gain' => $replay_gain, + 'independent_event' => $independent_event, + ); + + if ($schedule_item['cue_in'] > $schedule_item['cue_out']) { + $schedule_item['cue_in'] = $schedule_item['cue_out']; + } + self::appendScheduleItem($data, $start, $schedule_item); + } + + private static function createStreamScheduleEvent(&$data, $item, $media_id, $uri) + { + $start = self::AirtimeTimeToPypoTime($item["start"]); + $end = self::AirtimeTimeToPypoTime($item["end"]); + + //create an event to start stream buffering 5 seconds ahead of the streams actual time. + $buffer_start = new DateTime($item["start"], new DateTimeZone('UTC')); + $buffer_start->sub(new DateInterval("PT5S")); + + $stream_buffer_start = self::AirtimeTimeToPypoTime($buffer_start->format("Y-m-d H:i:s")); + + $schedule_item = array( + 'start' => $stream_buffer_start, + 'end' => $stream_buffer_start, + 'uri' => $uri, + 'row_id' => $item["id"], + 'type' => 'stream_buffer_start', + 'independent_event' => true + ); + + self::appendScheduleItem($data, $start, $schedule_item); + + $schedule_item = array( + 'id' => $media_id, + 'type' => 'stream_output_start', + 'row_id' => $item["id"], + 'uri' => $uri, + 'start' => $start, + 'end' => $end, + 'show_name' => $item["show_name"], + 'row_id' => $item["id"], + 'independent_event' => true + ); + self::appendScheduleItem($data, $start, $schedule_item); + + //since a stream never ends we have to insert an additional "kick stream" event. The "start" + //time of this event is the "end" time of the stream minus 1 second. + $dt = new DateTime($item["end"], new DateTimeZone('UTC')); + $dt->sub(new DateInterval("PT1S")); + + $stream_end = self::AirtimeTimeToPypoTime($dt->format("Y-m-d H:i:s")); + + $schedule_item = array( + 'start' => $stream_end, + 'end' => $stream_end, + 'uri' => $uri, + 'type' => 'stream_buffer_end', + 'row_id' => $item["id"], + 'independent_event' => true + ); + self::appendScheduleItem($data, $stream_end, $schedule_item); + + $schedule_item = array( + 'start' => $stream_end, + 'end' => $stream_end, + 'uri' => $uri, + 'type' => 'stream_output_end', + 'independent_event' => true + ); + self::appendScheduleItem($data, $stream_end, $schedule_item); + } + + private static function getRangeStartAndEnd($p_fromDateTime, $p_toDateTime) + { + $CC_CONFIG = Config::getConfig(); + + /* if $p_fromDateTime and $p_toDateTime function parameters are null, + then set range * from "now" to "now + 24 hours". */ + if (is_null($p_fromDateTime)) { + $t1 = new DateTime("@".time()); + $range_start = $t1->format("Y-m-d H:i:s"); + } else { + $range_start = Application_Model_Schedule::PypoTimeToAirtimeTime($p_fromDateTime); + } + if (is_null($p_fromDateTime)) { + $t2 = new DateTime("@".time()); + + $cache_ahead_hours = $CC_CONFIG["cache_ahead_hours"]; + + if (is_numeric($cache_ahead_hours)) { + //make sure we are not dealing with a float + $cache_ahead_hours = intval($cache_ahead_hours); + } else { + $cache_ahead_hours = 1; + } + + $t2->add(new DateInterval("PT".$cache_ahead_hours."H")); + $range_end = $t2->format("Y-m-d H:i:s"); + } else { + $range_end = Application_Model_Schedule::PypoTimeToAirtimeTime($p_toDateTime); + } + + return array($range_start, $range_end); + } + + + private static function createScheduledEvents(&$data, $range_start, $range_end) + { + $utcTimeZone = new DateTimeZone("UTC"); + $items = self::getItems($range_start, $range_end); + foreach ($items as $item) { + $showEndDateTime = new DateTime($item["show_end"], $utcTimeZone); + + $trackStartDateTime = new DateTime($item["start"], $utcTimeZone); + $trackEndDateTime = new DateTime($item["end"], $utcTimeZone); + + if ($trackStartDateTime->getTimestamp() > $showEndDateTime->getTimestamp()) { + //do not send any tracks that start past their show's end time + continue; + } + + if ($trackEndDateTime->getTimestamp() > $showEndDateTime->getTimestamp()) { + $di = $trackStartDateTime->diff($showEndDateTime); + + $item["cue_out"] = $di->format("%H:%i:%s").".000"; + $item["end"] = $showEndDateTime->format("Y-m-d H:i:s"); + } + + if (!is_null($item['file_id'])) { + //row is from "file" + $media_id = $item['file_id']; + $storedFile = Application_Model_StoredFile::Recall($media_id); + $uri = $storedFile->getFilePath(); + self::createFileScheduleEvent($data, $item, $media_id, $uri); + } elseif (!is_null($item['stream_id'])) { + //row is type "webstream" + $media_id = $item['stream_id']; + $uri = $item['url']; + self::createStreamScheduleEvent($data, $item, $media_id, $uri); + } else { + throw new Exception("Unknown schedule type: ".print_r($item, true)); + } + + } + } + + /* Check if two events are less than or equal to 1 second apart + */ + public static function areEventsLinked($event1, $event2) { + $dt1 = DateTime::createFromFormat("Y-m-d-H-i-s", $event1['start']); + $dt2 = DateTime::createFromFormat("Y-m-d-H-i-s", $event2['start']); + + $seconds = $dt2->getTimestamp() - $dt1->getTimestamp(); + return $seconds <= 1; + } + + /** + * Streams are a 4 stage process. + * 1) start buffering stream 5 seconds ahead of its start time + * 2) at the start time tell liquidsoap to switch to this source + * 3) at the end time, tell liquidsoap to stop reading this stream + * 4) at the end time, tell liquidsoap to switch away from input.http source. + * + * When we have two streams back-to-back, some of these steps are unnecessary + * for the second stream. Instead of sending commands 1,2,3,4,1,2,3,4 we should + * send 1,2,1,2,3,4 - We don't need to tell liquidsoap to stop reading (#3), because #1 + * of the next stream implies this when we pass in a new url. We also don't need #4. + * + * There's a special case here is well. When the back-to-back streams are the same, we + * can collapse the instructions 1,2,(3,4,1,2),3,4 to 1,2,3,4. We basically cut out the + * middle part. This function handles this. + */ + private static function foldData(&$data) + { + $previous_key = null; + $previous_val = null; + $previous_previous_key = null; + $previous_previous_val = null; + $previous_previous_previous_key = null; + $previous_previous_previous_val = null; + foreach ($data as $k => $v) { + + if ($v["type"] == "stream_output_start" + && !is_null($previous_previous_val) + && $previous_previous_val["type"] == "stream_output_end" + && self::areEventsLinked($previous_previous_val, $v)) { + + unset($data[$previous_previous_previous_key]); + unset($data[$previous_previous_key]); + unset($data[$previous_key]); + if ($previous_previous_val['uri'] == $v['uri']) { + unset($data[$k]); + } + } + + $previous_previous_previous_key = $previous_previous_key; + $previous_previous_previous_val = $previous_previous_val; + $previous_previous_key = $previous_key; + $previous_previous_val = $previous_val; + $previous_key = $k; + $previous_val = $v; + } + } + + public static function getSchedule($p_fromDateTime = null, $p_toDateTime = null) + { + list($range_start, $range_end) = self::getRangeStartAndEnd($p_fromDateTime, $p_toDateTime); + + $data = array(); + $data["media"] = array(); + + //Harbor kick times *MUST* be ahead of schedule events, so that pypo + //executes them first. + self::createInputHarborKickTimes($data, $range_start, $range_end); + self::createScheduledEvents($data, $range_start, $range_end); + + self::foldData($data["media"]); + return $data; + } + + public static function deleteAll() + { + $con = Propel::getConnection(); + $con->exec("TRUNCATE TABLE cc_schedule"); + } + + public static function deleteWithFileId($fileId) + { + $sql = "DELETE FROM cc_schedule WHERE file_id=:file_id"; + Application_Common_Database::prepareAndExecute($sql, array(':file_id'=>$fileId), 'execute'); + } + + public static function createNewFormSections($p_view) + { + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $p_view->what = $formWhat; + $p_view->when = $formWhen; + $p_view->repeats = $formRepeats; + $p_view->who = $formWho; + $p_view->style = $formStyle; + $p_view->live = $formLive; + + $formWhat->populate(array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + $formWhen->populate(array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $p_view->rr = $formRecord; + $p_view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $p_view->rebroadcast = $formRebroadcast; + $p_view->addNewShow = true; + } + + /* This function is responsible for handling the case where an individual + * show instance in a repeating show was edited (via the context menu in the Calendar). + * There is still lots of clean-up to do. For example we shouldn't be passing $controller into + * this method to manipulate the view (this should be done inside the controller function). With + * 2.1 deadline looming, this is OK for now. -Martin */ + public static function updateShowInstance($data, $controller) + { + $formWhat = new Application_Form_AddShowWhat(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formWho = new Application_Form_AddShowWho(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + $when = $formWhen->isValid($data); + + if ($when && $formWhen->checkReliantFields($data, true, null, true)) { + $start_dt = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time'], + new DateTimeZone(date_default_timezone_get())); + $start_dt->setTimezone(new DateTimeZone('UTC')); + + $end_dt = new DateTime($data['add_show_end_date_no_repeat']." ".$data['add_show_end_time'], + new DateTimeZone(date_default_timezone_get())); + $end_dt->setTimezone(new DateTimeZone('UTC')); + + $ccShowInstance = CcShowInstancesQuery::create()->findPK($data["add_show_instance_id"]); + $ccShowInstance->setDbStarts($start_dt); + $ccShowInstance->setDbEnds($end_dt); + $ccShowInstance->save(); + + Application_Model_Schedule::createNewFormSections($controller->view); + + return true; + } else { + $formWhat->disable(); + $formWhen->disableRepeatCheckbox(); + $formRepeats->disable(); + $formWho->disable(); + $formStyle->disable(); + //$formLive->disable(); + + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->live = $formLive; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + + //$formRecord->disable(); + //$formAbsoluteRebroadcast->disable(); + //$formRebroadcast->disable(); + + return false; + } + } + + /* This function is responsible for handling the case where the entire show (not a single show instance) + * was edited (via the context menu in the Calendar). + * There is still lots of clean-up to do. For example we shouldn't be passing $controller into + * this method to manipulate the view (this should be done inside the controller function). With + * 2.1 deadline looming, this is OK for now. + * Another clean-up is to move all the form manipulation to the proper form class..... + * -Martin + */ + public static function addUpdateShow($data, $controller, $validateStartDate, + $originalStartDate=null, $update=false, $instanceId=null) + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $record = false; + + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + + $what = $formWhat->isValid($data); + $when = $formWhen->isValid($data); + $live = $formLive->isValid($data); + if ($when) { + $when = $formWhen->checkReliantFields($data, $validateStartDate, $originalStartDate, $update, $instanceId); + } + + //The way the following code works is that is parses the hour and + //minute from a string with the format "1h 20m" or "2h" or "36m". + //So we are detecting whether an hour or minute value exists via strpos + //and then parse appropriately. A better way to do this in the future is + //actually pass the format from javascript in the format hh:mm so we don't + //have to do this extra String parsing. + $hPos = strpos($data["add_show_duration"], 'h'); + $mPos = strpos($data["add_show_duration"], 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($data["add_show_duration"], 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($data["add_show_duration"], $hPos, -1 )); + } + + $data["add_show_duration"] = $hValue.":".$mValue; + + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + + $record = $formRecord->isValid($data); + + if ($data["add_show_repeats"]) { + $repeats = $formRepeats->isValid($data); + if ($repeats) { + $repeats = $formRepeats->checkReliantFields($data); + } + $formAbsoluteRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroadAb = 1; + + if ($data["add_show_rebroadcast"]) { + $rebroad = $formRebroadcast->isValid($data); + if ($rebroad) { + $rebroad = $formRebroadcast->checkReliantFields($data); + } + } else { + $rebroad = 1; + } + } else { + $repeats = 1; + $formRebroadcast->reset(); + //make it valid, results don't matter anyways. + $rebroad = 1; + + if ($data["add_show_rebroadcast"]) { + $rebroadAb = $formAbsoluteRebroadcast->isValid($data); + if ($rebroadAb) { + $rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data); + } + } else { + $rebroadAb = 1; + } + } + + $who = $formWho->isValid($data); + $style = $formStyle->isValid($data); + if ($what && $when && $repeats && $who && $style && $live) { + if ($record && $rebroadAb && $rebroad) { + if ($isAdminOrPM) { + Application_Model_Show::create($data); + } + + //send back a new form for the user. + Application_Model_Schedule::createNewFormSections($controller->view); + + //$controller->view->newForm = $controller->view->render('schedule/add-show-form.phtml'); + return true; + } else { + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + $controller->view->live = $formLive; + //$controller->view->addNewShow = !$editShow; + + //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); + return false; + + } + } else { + $controller->view->what = $formWhat; + $controller->view->when = $formWhen; + $controller->view->repeats = $formRepeats; + $controller->view->who = $formWho; + $controller->view->style = $formStyle; + $controller->view->live = $formLive; + + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; + //$controller->view->addNewShow = !$editShow; + //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); + return false; + } + } + + public static function checkOverlappingShows($show_start, $show_end, + $update=false, $instanceId=null, $showId=null) + { + $overlapping = false; + + $params = array( + ':show_end1' => $show_end->format('Y-m-d H:i:s'), + ':show_end2' => $show_end->format('Y-m-d H:i:s'), + ':show_end3' => $show_end->format('Y-m-d H:i:s') + ); + + + /* If a show is being edited, exclude it from the query + * In both cases (new and edit) we only grab shows that + * are scheduled 2 days prior + */ + if ($update) { + $sql = <<= (date(:show_end3) - INTERVAL '2 days') + AND modified_instance = FALSE +SQL; + if (is_null($showId)) { + $sql .= <<= (date(:show_end3) - INTERVAL '2 days') + AND modified_instance = FALSE +ORDER BY ends +SQL; + + $rows = Application_Common_Database::prepareAndExecute($sql, array( + ':show_end1' => $show_end->format('Y-m-d H:i:s'), + ':show_end2' => $show_end->format('Y-m-d H:i:s'), + ':show_end3' => $show_end->format('Y-m-d H:i:s')), 'all'); + } + + foreach ($rows as $row) { + $start = new DateTime($row["starts"], new DateTimeZone('UTC')); + $end = new DateTime($row["ends"], new DateTimeZone('UTC')); + + if ($show_start->getTimestamp() < $end->getTimestamp() && + $show_end->getTimestamp() > $start->getTimestamp()) { + $overlapping = true; + break; + } + } + + return $overlapping; + } + + public static function GetType($p_scheduleId){ + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + if ($scheduledItem->getDbFileId() == null) { + return 'webstream'; + } else { + return 'file'; + } + } + + public static function GetFileId($p_scheduleId) + { + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + + return $scheduledItem->getDbFileId(); + } + + public static function GetStreamId($p_scheduleId) + { + $scheduledItem = CcScheduleQuery::create()->findPK($p_scheduleId); + + return $scheduledItem->getDbStreamId(); + } +} diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php new file mode 100644 index 000000000..983d1bd6f --- /dev/null +++ b/airtime_mvc/application/services/ScheduleService.php @@ -0,0 +1,90 @@ +removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $forms = array(); + $forms["what"] = $formWhat; + $forms["who"] = $formWho; + $forms["when"] = $formWhen; + $forms["repeats"] = $formRepeats; + $forms["style"] = $formStyle; + $forms["live"] = $formLive; + $forms["record"] = $formRecord; + $forms["abs_record"] = $formAbsoluteRebroadcast; + $forms["rebroadcast"] = $formRebroadcast; + + return $forms; + } + + /** + * + * Popluates the what, when, and repeat forms + * with default values + */ + public function populateNewShowForms($formWhat, $formWhen, $formRepeats) + { + $formWhat->populate( + array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + + $formWhen->populate( + array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + } + + public function populateForm($form, $values) + { + $form->populate($values); + } + + /** + * + * Validates show forms + * + * @return array of booleans + */ + public function validateShowForms($forms) + { + + } + + /** + * + * Creates a new show if form data is valid + */ + public function createShow() + { + + } +} \ No newline at end of file From bdab294fce0085b99927aaa33aa5ba5f16bd4135 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 25 Feb 2013 09:15:03 -0500 Subject: [PATCH 008/128] Added comments to Schedule Service --- .../application/controllers/ScheduleController.php | 1 + airtime_mvc/application/models/Schedule.php | 7 +++---- airtime_mvc/application/services/ScheduleService.php | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 9ca879918..ae91308e4 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -871,6 +871,7 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } + // TODO: move this to js $data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_day_check'] = $this->_getParam('days'); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 2778074d2..36aedf96c 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1220,10 +1220,9 @@ SQL; $controller->view->who = $formWho; $controller->view->style = $formStyle; $controller->view->live = $formLive; - - $controller->view->rr = $formRecord; - $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $controller->view->rebroadcast = $formRebroadcast; + $controller->view->rr = $formRecord; + $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; + $controller->view->rebroadcast = $formRebroadcast; //$controller->view->addNewShow = !$editShow; //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); return false; diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 983d1bd6f..f5f397561 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -2,6 +2,13 @@ class Application_Service_ScheduleService { +/* + * Form stuff begins here + * Typically I would keep form creation and validation + * in the controller but since shows require 9 forms, + * the controller will become too fat. + * Maybe we should create a special form show service? + */ /** * * @return array of schedule forms @@ -78,7 +85,9 @@ class Application_Service_ScheduleService { } - +/* + * Form stuff ends + */ /** * * Creates a new show if form data is valid From 99c07272fd51340b7341a9ad65193b46aa9f065c Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 25 Feb 2013 17:31:43 -0500 Subject: [PATCH 009/128] - Moved all form validation to it's own function in schedule service - Moved show creation to it's own function in schedule service --- .../controllers/ScheduleController.php | 29 +++-- .../forms/AddShowAbsoluteRebroadcastDates.php | 8 ++ .../forms/AddShowRebroadcastDates.php | 8 ++ .../application/forms/AddShowRepeats.php | 8 ++ airtime_mvc/application/forms/AddShowWhen.php | 8 ++ airtime_mvc/application/models/Schedule.php | 4 +- airtime_mvc/application/models/Show.php | 32 +++--- .../application/services/ScheduleService.php | 104 +++++++++++++++++- 8 files changed, 167 insertions(+), 34 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index ae91308e4..ea95d4bc7 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -104,7 +104,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->repeats = $forms["repeats"]; $this->view->live = $forms["live"]; $this->view->rr = $forms["record"]; - $this->view->absoluteRebroadcast = $forms["abs_record"]; + $this->view->absoluteRebroadcast = $forms["abs_rebroadcast"]; $this->view->rebroadcast = $forms["rebroadcast"]; $this->view->who = $forms["who"]; $this->view->style = $forms["style"]; @@ -879,19 +879,26 @@ class ScheduleController extends Zend_Controller_Action $data['add_show_day_check'] = null; } - $validateStartDate = true; - $success = Application_Model_Schedule::addUpdateShow($data, $this, - $validateStartDate); + $forms = $this->service_schedule->createShowForms(); - if ($success) { - $this->view->addNewShow = true; - $this->view->newForm = $this->view->render( - 'schedule/add-show-form.phtml'); + $this->view->what = $forms["what"]; + $this->view->when = $forms["when"]; + $this->view->repeats = $forms["repeats"]; + $this->view->live = $forms["live"]; + $this->view->rr = $forms["record"]; + $this->view->absoluteRebroadcast = $forms["abs_rebroadcast"]; + $this->view->rebroadcast = $forms["rebroadcast"]; + $this->view->who = $forms["who"]; + $this->view->style = $forms["style"]; + + $this->view->addNewShow = true; + + if ($this->service_schedule->validateShowForms($forms, $data)) { + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + $this->service_schedule->createShow($data); Logging::debug("Show creation succeeded"); } else { - $this->view->addNewShow = true; - $this->view->form = $this->view->render( - 'schedule/add-show-form.phtml'); + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); Logging::debug("Show creation failed"); } } diff --git a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php index a2f5b5cf3..4c43000c0 100644 --- a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php @@ -40,6 +40,14 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { $noError = true; diff --git a/airtime_mvc/application/forms/AddShowRebroadcastDates.php b/airtime_mvc/application/forms/AddShowRebroadcastDates.php index 74725c98c..58d6af872 100644 --- a/airtime_mvc/application/forms/AddShowRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowRebroadcastDates.php @@ -45,6 +45,14 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { $noError = true; diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index f0c2609e2..375942894 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -66,6 +66,14 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm } } + public function isValid($formData) { + if (parent::isValid($formData)) { + return $this->checkReliantFields($formData); + } else { + return false; + } + } + public function checkReliantFields($formData) { if (!$formData['add_show_no_end']) { diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 92873f153..9f73affbd 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -87,6 +87,14 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } + public function isWhenFormValid($formData, $validateStartDate) { + if (parent::isValid($formData)) { + return self::checkReliantFields($formData, $validateStartDate); + } else { + return false; + } + } + public function checkReliantFields($formData, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) { $valid = true; diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 36aedf96c..6b19c5e3d 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1088,7 +1088,7 @@ SQL; * Another clean-up is to move all the form manipulation to the proper form class..... * -Martin */ - public static function addUpdateShow($data, $controller, $validateStartDate, + /*public static function addUpdateShow($data, $controller, $validateStartDate, $originalStartDate=null, $update=false, $instanceId=null) { $userInfo = Zend_Auth::getInstance()->getStorage()->read(); @@ -1227,7 +1227,7 @@ SQL; //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); return false; } - } + }*/ public static function checkOverlappingShows($show_start, $show_end, $update=false, $instanceId=null, $showId=null) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index f485e41bc..493f3ca37 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1113,11 +1113,13 @@ SQL; */ public static function create($data) { - $startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']); - $utcStartDateTime = clone $startDateTime; - $utcStartDateTime->setTimezone(new DateTimeZone('UTC')); + /*$startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']);*/ + + // these are not used + /*$utcStartDateTime = clone $startDateTime; + $utcStartDateTime->setTimezone(new DateTimeZone('UTC'));*/ - if ($data['add_show_no_end']) { + /*if ($data['add_show_no_end']) { $endDate = NULL; } elseif ($data['add_show_repeats']) { $endDateTime = new DateTime($data['add_show_end_date']); @@ -1129,28 +1131,28 @@ SQL; //$endDateTime->setTimezone(new DateTimeZone('UTC')); $endDateTime->add(new DateInterval("P1D")); $endDate = $endDateTime->format("Y-m-d"); - } + }*/ //What we are doing here is checking if the show repeats or if //any repeating days have been checked. If not, then by default //the "selected" DOW is the initial day. //DOW in local time. - $startDow = date("w", $startDateTime->getTimestamp()); + /*$startDow = date("w", $startDateTime->getTimestamp()); if (!$data['add_show_repeats']) { $data['add_show_day_check'] = array($startDow); } elseif ($data['add_show_repeats'] && $data['add_show_day_check'] == "") { $data['add_show_day_check'] = array($startDow); - } + }*/ //find repeat type or set to a non repeating show. - $repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1; + /*$repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;*/ if ($data['add_show_id'] == -1) { - $ccShow = new CcShow(); + /*$ccShow = new CcShow();*/ } else { $ccShow = CcShowQuery::create()->findPK($data['add_show_id']); } - $ccShow->setDbName($data['add_show_name']); + /*$ccShow->setDbName($data['add_show_name']); $ccShow->setDbDescription($data['add_show_description']); $ccShow->setDbUrl($data['add_show_url']); $ccShow->setDbGenre($data['add_show_genre']); @@ -1160,11 +1162,11 @@ SQL; $ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1); $ccShow->setDbLiveStreamUser($data['custom_username']); $ccShow->setDbLiveStreamPass($data['custom_password']); - $ccShow->save(); + $ccShow->save();*/ - $showId = $ccShow->getDbId(); + /*$showId = $ccShow->getDbId();*/ - $isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0; + /*$isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0;*/ if ($data['add_show_id'] != -1) { $show = new Application_Model_Show($showId); @@ -1178,7 +1180,7 @@ SQL; } //don't set day for monthly repeat type, it's invalid. - if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { + /*if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { $showDay = new CcShowDays(); $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); @@ -1215,7 +1217,7 @@ SQL; $showDay->save(); } } - } + }*/ //check if we are adding or updating a show, and if updating //erase all the show's future show_rebroadcast information first. diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index f5f397561..1204f689c 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -43,7 +43,7 @@ class Application_Service_ScheduleService $forms["style"] = $formStyle; $forms["live"] = $formLive; $forms["record"] = $formRecord; - $forms["abs_record"] = $formAbsoluteRebroadcast; + $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; $forms["rebroadcast"] = $formRebroadcast; return $forms; @@ -79,21 +79,113 @@ class Application_Service_ScheduleService * * Validates show forms * - * @return array of booleans + * @return boolean */ - public function validateShowForms($forms) + public function validateShowForms($forms, $formData, $validateStartDate = true) { - + $what = $forms["what"]->isValid($formData); + $live = $forms["live"]->isValid($formData); + $record = $forms["record"]->isValid($formData); + $who = $forms["who"]->isValid($formData); + $style = $forms["style"]->isValid($formData); + $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate); + + $repeats = true; + if ($formData["add_show_repeats"]) { + $repeats = $forms["repeats"]->isValid($formData); + + /* + * Make the absolute rebroadcast form valid since + * it does not get used if the show is repeating + */ + $forms["abs_rebroadcast"]->reset(); + $absRebroadcast = true; + + $rebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $rebroadcast = $forms["rebroadcast"]->isValid($formData); + } + } else { + /* + * Make the rebroadcast form valid since it does + * not get used if the show is not repeating. + * Instead, we use the absolute rebroadcast form + */ + $forms["rebroadcast"]->reset(); + $rebroadcast = true; + + $absRebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); + } + } + + if ($what && $live && $record && $who && $style && $when && + $repeats && $absRebroadcast && $rebroadcast) { + return true; + } else { + return false; + } } /* * Form stuff ends */ + + public function formatShowDuration($duration) { + $hPos = strpos($duration, 'h'); + $mPos = strpos($duration, 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($duration, 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($duration, $hPos, -1 )); + } + + return $hValue.":".$mValue; + } + /** * * Creates a new show if form data is valid */ - public function createShow() + public function createShow($showData) { - + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + if ($isAdminOrPM) { + $service_show = new Application_Service_ShowService(); + + //create ccShow + $ccShow = new CcShow(); + $ccShow = $service_show->setShow($ccShow, $showData); + + //create ccShowDay + $service_show->createShowDays( + $showData, $ccShow->getDbId(), $user->getId(), $repeatType, $isRecorded); + + //create ccShowHosts + + //create ccShowRebroadcast + + //populate ccShowInstances + } } + } \ No newline at end of file From d497cfa85791f1edf07d128e357404da1f000c0e Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 10:20:02 -0500 Subject: [PATCH 010/128] Created show service --- airtime_mvc/application/models/Show.php | 8 +- airtime_mvc/application/models/_old_Show.php | 2241 +++++++++++++++++ .../application/services/ScheduleService.php | 11 +- .../application/services/ShowService.php | 145 ++ 4 files changed, 2397 insertions(+), 8 deletions(-) create mode 100644 airtime_mvc/application/models/_old_Show.php create mode 100644 airtime_mvc/application/services/ShowService.php diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 493f3ca37..d6f9db98b 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1229,7 +1229,7 @@ SQL; //adding rows to cc_show_rebroadcast /* TODO: Document magic constant 10 and define it properly somewhere --RG */ - if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { + /*if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { for ($i=1; $i<=10; $i++) { if ($data['add_show_rebroadcast_date_'.$i]) { $showRebroad = new CcShowRebroadcast(); @@ -1266,14 +1266,14 @@ SQL; $showRebroad->save(); } } - } + }*/ //check if we are adding or updating a show, and if updating //erase all the show's show_rebroadcast information first. if ($data['add_show_id'] != -1) { CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete(); } - if (is_array($data['add_show_hosts'])) { + /*if (is_array($data['add_show_hosts'])) { //add selected hosts to cc_show_hosts table. foreach ($data['add_show_hosts'] as $host) { $showHost = new CcShowHosts(); @@ -1281,7 +1281,7 @@ SQL; $showHost->setDbHost($host); $showHost->save(); } - } + }*/ if ($data['add_show_id'] != -1) { $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); diff --git a/airtime_mvc/application/models/_old_Show.php b/airtime_mvc/application/models/_old_Show.php new file mode 100644 index 000000000..f485e41bc --- /dev/null +++ b/airtime_mvc/application/models/_old_Show.php @@ -0,0 +1,2241 @@ +_showId = $showId; + } + + public function getName() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbName(); + } + + public function setName($name) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbName($name); + Application_Model_RabbitMq::PushSchedule(); + } + + public function setAirtimeAuthFlag($flag) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingAirtimeAuth($flag); + $show->save(); + } + + public function setCustomAuthFlag($flag) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingCustomAuth($flag); + $show->save(); + } + + public function setCustomUsername($username) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUser($username); + $show->save(); + } + + public function setCustomPassword($password) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamPass($password); + $show->save(); + } + + public function getDescription() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbDescription(); + } + + public function setDescription($description) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbDescription($description); + } + + public function getColor() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbColor(); + } + + public function setColor($color) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbColor($color); + } + + public function getUrl() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbUrl(); + } + + /*TODO : This method is not actually used anywhere as far as I can tell. We + can safely remove it and probably many other superfluous methods. + --RG*/ + + public function setUrl($p_url) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbUrl($p_url); + } + + public function getGenre() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbGenre(); + } + + public function setGenre($p_genre) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbGenre($p_genre); + } + + public function getBackgroundColor() + { + $show = CcShowQuery::create()->findPK($this->_showId); + + return $show->getDbBackgroundColor(); + } + + public function setBackgroundColor($backgroundColor) + { + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbBackgroundColor($backgroundColor); + } + + public function getId() + { + return $this->_showId; + } + + public function getHosts() + { + $sql = << $this->getId() ), 'all'); + + $res = array(); + foreach ($hosts as $host) { + $res[] = $host['first_name']." ".$host['last_name']; + } + return $res; + } + + public function getHostsIds() + { + $sql = << $this->getId() ), 'all'); + + return $hosts; + } + + /** + * remove everything about this show. + */ + public function delete() + { + //usually we hide the show-instance, but in this case we are deleting the show template + //so delete all show-instances as well. + CcShowInstancesQuery::create()->filterByDbOriginalShow($this->_showId)->delete(); + + $show = CcShowQuery::create()->findPK($this->_showId); + $show->delete(); + } + + public function resizeShow($deltaDay, $deltaMin) + { + $con = Propel::getConnection(); + + if ($deltaDay > 0) { + return _("Shows can have a max length of 24 hours."); + } + + $utc = new DateTimeZone("UTC"); + + $nowDateTime = new DateTime("now", $utc); + + $showInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($this->_showId) + ->find($con); + + /* Check two things: + 1. If the show being resized and any of its repeats end in the past + 2. If the show being resized and any of its repeats overlap + with other scheduled shows */ + + foreach ($showInstances as $si) { + $startsDateTime = new DateTime($si->getDbStarts(), new DateTimeZone("UTC")); + $endsDateTime = new DateTime($si->getDbEnds(), new DateTimeZone("UTC")); + + /* The user is moving the show on the calendar from the perspective + of local time. * incase a show is moved across a time change + border offsets should be added to the local * timestamp and + then converted back to UTC to avoid show time changes */ + $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $newStartsDateTime = Application_Model_ShowInstance::addDeltas($startsDateTime, $deltaDay, $deltaMin); + $newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin); + + if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) { + return _("End date/time cannot be in the past"); + } + + //convert our new starts/ends to UTC. + $newStartsDateTime->setTimezone($utc); + $newEndsDateTime->setTimezone($utc); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + $newStartsDateTime, $newEndsDateTime, true, $si->getDbId()); + + if ($overlapping) { + return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ". + "affects all of its repeats."); + } + } + + $hours = $deltaMin/60; + $hours = ($hours > 0) ? floor($hours) : ceil($hours); + $mins = abs($deltaMin % 60); + + //current timesamp in UTC. + $current_timestamp = gmdate("Y-m-d H:i:s"); + + $sql_gen = << :current_timestamp1) + AND ((ends + :deltaDay2::INTERVAL + :interval2::INTERVAL - starts) <= interval '24:00') +SQL; + + Application_Common_Database::prepareAndExecute($sql_gen, + array( + ':deltaDay1' => "$deltaDay days", + ':interval1' => "$hours:$mins", + ':show_id1' => $this->_showId, + ':current_timestamp1' => $current_timestamp, + ':deltaDay2' => "$deltaDay days", + ':interval2' => "$hours:$mins" + ), "execute"); + + $sql_gen = << "$deltaDay days", + ':interval3' => "$hours:$mins", + ':show_id2' => $this->_showId, + ':deltaDay4' => "$deltaDay days", + ':interval4' => "$hours:$mins" + ), "execute"); + + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $con->beginTransaction(); + + try { + //update the status flag in cc_schedule. + + /* Since we didn't use a propel object when updating + * cc_show_instances table we need to clear the instances + * so the correct information is retrieved from the db + */ + CcShowInstancesPeer::clearInstancePool(); + + $instances = CcShowInstancesQuery::create() + ->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN) + ->filterByDbShowId($this->_showId) + ->find($con); + + foreach ($instances as $instance) { + $instance->updateScheduleStatus($con); + } + + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + Logging::info("Couldn't update schedule status."); + Logging::info($e->getMessage()); + } + + Application_Model_RabbitMq::PushSchedule(); + } + + public function cancelShow($day_timestamp) + { + $timeinfo = explode(" ", $day_timestamp); + + CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->update(array('DbLastShow' => $timeinfo[0])); + + $sql = <<= :dayTimestamp::TIMESTAMP + AND show_id = :showId +SQL; + + $rows = Application_Common_Database::prepareAndExecute( $sql, array( + ':dayTimestamp' => $day_timestamp, + ':showId' => $this->getId()), 'all'); + + foreach ($rows as $row) { + try { + $showInstance = new Application_Model_ShowInstance($row["id"]); + $showInstance->delete($rabbitmqPush = false); + } catch (Exception $e) { + Logging::info($e->getMessage()); + } + } + + Application_Model_RabbitMq::PushSchedule(); + } + + /** + * This function is called when a repeating show is edited and the + * days that is repeats on have changed. More specifically, a day + * that the show originally repeated on has been "unchecked". + * + * Removes Show Instances that occur on days of the week specified + * by input array. For example, if array contains one value of "0", + * (0 = Sunday, 1=Monday) then all show instances that occur on + * Sunday are removed. + * + * @param array p_uncheckedDays + * An array specifying which days should be removed. (in the local timezone) + */ + public function removeUncheckedDaysInstances($p_uncheckedDays) + { + //need to convert local doftw to UTC doftw (change made for 2.0 since shows are stored in UTC) + $daysRemovedUTC = array(); + + $showDays = CcShowDaysQuery::create() + ->filterByDbShowId($this->getId()) + ->find(); + + Logging::info("Unchecked days:"); + foreach ($p_uncheckedDays as $day) { + Logging::info($day); + } + + foreach ($showDays as $showDay) { + //Logging::info("Local show day is: {$showDay->getDbDay()}"); + //Logging::info("First show day is: {$showDay->getDbFirstShow()}"); + //Logging::info("Id show days is: {$showDay->getDbId()}"); + + if (in_array($showDay->getDbDay(), $p_uncheckedDays)) { + $showDay->reload(); + //Logging::info("Local show day is: {$showDay->getDbDay()}"); + //Logging::info("First show day is: {$showDay->getDbFirstShow()}"); + //Logging::info("Id show days is: {$showDay->getDbId()}"); + $startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone())); + //Logging::info("Show start day: {$startDay->format('Y-m-d H:i:s')}"); + $startDay->setTimezone(new DateTimeZone("UTC")); + //Logging::info("Show start day UTC: {$startDay->format('Y-m-d H:i:s')}"); + $daysRemovedUTC[] = $startDay->format('w'); + //Logging::info("UTC show day is: {$startDay->format('w')}"); + } + } + + $uncheckedDaysImploded = implode(",", $daysRemovedUTC); + $showId = $this->getId(); + + $esc_uncheckedDays = pg_escape_string($uncheckedDaysImploded); + $timestamp = gmdate("Y-m-d H:i:s"); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute( $sql, + array( + ":timestamp" => $timestamp, + ":showId" => $showId, + ), "execute"); + } + + /** + * Check whether the current show originated + * from a recording. + * + * @return boolean + * true if originated from recording, otherwise false. + */ + public function isRecorded() + { + $showInstancesRow = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getId()) + ->filterByDbRecord(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return !is_null($showInstancesRow); + } + + /** + * Check whether the current show has rebroadcasts of a recorded + * show. Should be used in conjunction with isRecorded(). + * + * @return boolean + * true if show has rebroadcasts, otherwise false. + */ + public function isRebroadcast() + { + $showInstancesRow = CcShowInstancesQuery::create() + ->filterByDbShowId($this->_showId) + ->filterByDbRebroadcast(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return !is_null($showInstancesRow); + } + + /** + * Get start time and absolute start date for a recorded + * shows rebroadcasts. For example start date format would be + * YYYY-MM-DD and time would HH:MM + * + * @return array + * array of associate arrays containing "start_date" and "start_time" + */ + public function getRebroadcastsAbsolute() + { + $sql = << $this->getId() ), 'all' ); + + $rebroadcastsLocal = array(); + //get each rebroadcast show in cc_show_instances, convert to current timezone to get start date/time. + /*TODO: refactor the following code to get rid of the $i temporary + variable. -- RG*/ + $i = 0; + + $utc = new DateTimeZone("UTC"); + $dtz = new DateTimeZone( date_default_timezone_get() ); + + foreach ($rebroadcasts as $show) { + $startDateTime = new DateTime($show["starts"], $utc); + $startDateTime->setTimezone($dtz); + + $rebroadcastsLocal[$i]["start_date"] = + $startDateTime->format("Y-m-d"); + $rebroadcastsLocal[$i]["start_time"] = + $startDateTime->format("H:i"); + + $i = $i + 1; + } + + return $rebroadcastsLocal; + } + + /** + * Get start time and relative start date for a recorded + * shows rebroadcasts. For example start date format would be + * "x days" and time would HH:MM:SS + * + * @return array + * array of associate arrays containing "day_offset" and "start_time" + */ + public function getRebroadcastsRelative() + { + $sql = << $this->getId() ), 'all' ); + } + + /** + * Check whether the current show is set to repeat + * repeating shows. + * + * @return boolean + * true if repeating shows, otherwise false. + */ + public function isRepeating() + { + $showDaysRow = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + if (!is_null($showDaysRow)) { + return ($showDaysRow->getDbRepeatType() != -1); + } else { + return false; + } + } + + /** + * Get the repeat type of the show. Show can have repeat + * type of "weekly", "bi-weekly" and "monthly". These values + * are represented by 0, 1, and 2 respectively. + * + * @return int + * Return the integer corresponding to the repeat type. + */ + public function getRepeatType() + { + $showDaysRow = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + if (!is_null($showDaysRow)) + return $showDaysRow->getDbRepeatType(); + else + return -1; + } + + /** + * Get the end date for a repeating show in the format yyyy-mm-dd + * + * @return string + * Return the end date for the repeating show or the empty + * string if there is no end. + */ + public function getRepeatingEndDate() + { + $sql = << $this->getId() ), 'column' ); + + /* TODO: Why return empty string instead of false? very confusing --RG + */ + return ($query !== false) ? $query : ""; + } + + /** + * Deletes all future instances of the current show object + * from the show_instances table. This function is used when + * a show is being edited - in some cases, when a show is edited + * we just destroy all future show instances, and let another function + * regenerate them later on. Note that this isn't always the most + * desirable thing to do. Deleting a show instance and regenerating + * it cause any scheduled playlists within those show instances to + * be gone for good. + */ + public function deleteAllInstances() + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $this->getId()), 'execute'); + } + + /** + * Deletes all future rebroadcast instances of the current + * show object from the show_instances table. + */ + public function deleteAllRebroadcasts() + { + $sql = << :timestamp::TIMESTAMP + AND show_id :showId + AND rebroadcast 1 +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':showId' => $this->getId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); + + $con->exec($sql); + } + + /** + * Deletes all show instances of current show after a + * certain date. Note that although not enforced, $p_date + * should never be in the past, as we never want to allow + * deletion of shows that have already occured. + * + * @param string $p_date + * The date which to delete after, if null deletes from the current timestamp. + */ + public function removeAllInstancesFromDate($p_date=null) + { + $con = Propel::getConnection(); + + $timestamp = gmdate("Y-m-d H:i:s"); + + if (is_null($p_date)) { + $date = new Application_Common_DateHelper; + $p_date = $date->getDate(); + } + + $showId = $this->getId(); + $sql = "DELETE FROM cc_show_instances " + ." WHERE date(starts) >= DATE '$p_date'" + ." AND starts > TIMESTAMP '$timestamp'" + ." AND show_id = $showId"; + + $con->exec($sql); + + } + + /** + * Deletes all show instances of current show before a + * certain date. + * + * This function is used in the case where a repeating show is being + * edited and the start date of the first show has been changed more + * into the future. In this case, delete any show instances that + * exist before the new start date. + * + * @param string $p_date + * The date which to delete before + */ + public function removeAllInstancesBeforeDate($p_date) + { + $con = Propel::getConnection(); + + $timestamp = gmdate("Y-m-d H:i:s"); + + $showId = $this->getId(); + $sql = "DELETE FROM cc_show_instances " + ." WHERE date(starts) < DATE '$p_date'" + ." AND starts > TIMESTAMP '$timestamp'" + ." AND show_id = $showId"; + + $con->exec($sql); + } + + public function getNextFutureRepeatShowTime() + { + $sql = << now() at time zone 'UTC' +AND show_id = :showId +ORDER BY starts +LIMIT 1 +SQL; + $result = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->getId() ), 'all' ); + + foreach ($result as $r) { + $show["starts"] = new DateTime($r["starts"], new DateTimeZone('UTC')); + $show["ends"] = new DateTime($r["ends"], new DateTimeZone('UTC')); + } + $currentUser = Application_Model_User::getCurrentUser(); + $currentUserId = $currentUser->getId(); + $userTimezone = Application_Model_Preference::GetUserTimezone($currentUserId); + $show["starts"]->setTimezone(new DateTimeZone($userTimezone)); + $show["ends"]->setTimezone(new DateTimeZone($userTimezone)); + return $show; + } + + /** + * Get the start date of the current show in UTC timezone. + * + * @return string + * The start date in the format YYYY-MM-DD or empty string in case + * start date could not be found + */ + public function getStartDateAndTime() + { + $con = Propel::getConnection(); + + $showId = $this->getId(); + $stmt = $con->prepare( + "SELECT first_show, start_time, timezone FROM cc_show_days" + ." WHERE show_id = :showId" + ." ORDER BY first_show" + ." LIMIT 1"); + + $stmt->bindParam(':showId', $showId); + $stmt->execute(); + + if (!$stmt) { + return ""; + } + + $rows = $stmt->fetchAll(); + $row = $rows[0]; + + $dt = new DateTime($row["first_show"]." ".$row["start_time"], new DateTimeZone($row["timezone"])); + $dt->setTimezone(new DateTimeZone("UTC")); + + return $dt->format("Y-m-d H:i"); + } + + /** + * Get the start date of the current show in UTC timezone. + * + * @return string + * The start date in the format YYYY-MM-DD + */ + public function getStartDate() + { + list($date,) = explode(" ", $this->getStartDateAndTime()); + + return $date; + } + + /** + * Get the start time of the current show in UTC timezone. + * + * @return string + * The start time in the format HH:MM + */ + + public function getStartTime() + { + list(,$time) = explode(" ", $this->getStartDateAndTime()); + + return $time; + } + + /** + * Get the end date of the current show. + * Note that this is not the end date of repeated show + * + * @return string + * The end date in the format YYYY-MM-DD + */ + public function getEndDate() + { + $startDate = $this->getStartDate(); + $startTime = $this->getStartTime(); + $duration = $this->getDuration(); + + $startDateTime = new DateTime($startDate.' '.$startTime); + $duration = explode(":", $duration); + + $endDate = $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); + + return $endDate->format('Y-m-d'); + } + + /** + * Get the end time of the current show. + * + * @return string + * The start time in the format HH:MM:SS + */ + public function getEndTime() + { + $startDate = $this->getStartDate(); + $startTime = $this->getStartTime(); + $duration = $this->getDuration(); + + $startDateTime = new DateTime($startDate.' '.$startTime); + $duration = explode(":", $duration); + + $endDate = $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); + + return $endDate->format('H:i:s'); + } + + /** + * Indicate whether the starting point of the show is in the + * past. + * + * @return boolean + * true if the StartDate is in the past, false otherwise + */ + public function isStartDateTimeInPast() + { + $date = new Application_Common_DateHelper; + $current_timestamp = $date->getUtcTimestamp(); + + return ($current_timestamp > ($this->getStartDate()." ".$this->getStartTime())); + } + + /** + * Get the ID's of future instance of the current show. + * + * @return array + * A simple array containing all ID's of show instance + * scheduled in the future. + */ + public function getAllFutureInstanceIds() + { + $sql = << :timestamp::TIMESTAMP + AND modified_instance != TRUE +SQL; + $rows = Application_Common_Database::prepareAndExecute($sql, + array( ':showId' => $this->getId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), "all"); + + $res = array(); + foreach ($rows as $r) { + $res[] = $r['id']; + } + return $res; + } + + /* Called when a show's duration is changed (edited). + * + * @param array $p_data + * array containing the POST data about the show from the + * browser. + * + */ + private function updateDurationTime($p_data) + { + //need to update cc_show_instances, cc_show_days + $con = Propel::getConnection(); + + $date = new Application_Common_DateHelper; + $timestamp = $date->getUtcTimestamp(); + + $stmt = $con->prepare("UPDATE cc_show_days " + ."SET duration = :add_show_duration " + ."WHERE show_id = :add_show_id" ); + $stmt->execute( array( + ':add_show_duration' => $p_data['add_show_duration'], + ':add_show_id' => $p_data['add_show_id'] + )); + + + $sql = << :timestamp::TIMESTAMP +SQL; + + Application_Common_Database::prepareAndExecute( $sql, array( + ':add_show_duration' => $p_data['add_show_duration'], + ':show_id' => $p_data['add_show_id'], + ':timestamp' => $timestamp), "execute"); + } + + private function updateStartDateTime($p_data, $p_endDate) + { + //need to update cc_schedule, cc_show_instances, cc_show_days + $con = Propel::getConnection(); + + $date = new Application_Common_DateHelper; + $timestamp = $date->getTimestamp(); + + //TODO fix this from overwriting info. + $sql = "UPDATE cc_show_days " + ."SET start_time = TIME '$p_data[add_show_start_time]', " + ."first_show = DATE '$p_data[add_show_start_date]', "; + if (strlen ($p_endDate) == 0) { + $sql .= "last_show = NULL "; + } else { + $sql .= "last_show = DATE '$p_endDate' "; + } + $sql .= "WHERE show_id = $p_data[add_show_id]"; + $con->exec($sql); + + $dtOld = new DateTime($this->getStartDate()." ".$this->getStartTime(), new DateTimeZone("UTC")); + $dtNew = new DateTime($p_data['add_show_start_date']." ".$p_data['add_show_start_time'], new DateTimeZone(date_default_timezone_get())); + $diff = $dtOld->getTimestamp() - $dtNew->getTimestamp(); + + $sql = "UPDATE cc_show_instances " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE show_id = $p_data[add_show_id] " + ."AND starts > TIMESTAMP '$timestamp'"; + $con->exec($sql); + + $showInstanceIds = $this->getAllFutureInstanceIds(); + if (count($showInstanceIds) > 0 && $diff != 0) { + $showIdsImploded = implode(",", $showInstanceIds); + $sql = "UPDATE cc_schedule " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE instance_id IN ($showIdsImploded)"; + $con->exec($sql); + } + } + + public function getDuration($format=false) + { + $showDay = CcShowDaysQuery::create()->filterByDbShowId($this->getId())->findOne(); + if (!$format) { + return $showDay->getDbDuration(); + } else { + $info = explode(':',$showDay->getDbDuration()); + + return str_pad(intval($info[0]),2,'0',STR_PAD_LEFT).'h '.str_pad(intval($info[1]),2,'0',STR_PAD_LEFT).'m'; + } + } + + public function getShowDays() + { + $showDays = CcShowDaysQuery::create()->filterByDbShowId( + $this->getId())->find(); + $res = array(); + foreach ($showDays as $showDay) { + $res[] = $showDay->getDbDay(); + } + return $res; + } + + /* Only used for shows that aren't repeating. + * + * @return Boolean: true if show has an instance, otherwise false. */ + public function hasInstance() + { + return (!is_null($this->getInstance())); + } + + /* Only used for shows that aren't repeating. + * + * @return CcShowInstancesQuery: An propel object representing a + * row in the cc_show_instances table. */ + public function getInstance() + { + $showInstance = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getId()) + ->findOne(); + + return $showInstance; + } + + /** + * returns info about live stream override info + */ + public function getLiveStreamInfo() + { + $info = array(); + if ($this->getId() == null) { + return $info; + } else { + $ccShow = CcShowQuery::create()->findPK($this->_showId); + $info['custom_username'] = $ccShow->getDbLiveStreamUser(); + $info['cb_airtime_auth'] = $ccShow->getDbLiveStreamUsingAirtimeAuth(); + $info['cb_custom_auth'] = $ccShow->getDbLiveStreamUsingCustomAuth(); + $info['custom_username'] = $ccShow->getDbLiveStreamUser(); + $info['custom_password'] = $ccShow->getDbLiveStreamPass(); + return $info; + } + } + + /* Only used for shows that are repeating. Note that this will return + * true even for dates that only have a "modified" show instance (does not + * check if the "modified_instance" column is set to true). This is intended + * behaviour. + * + * @param $p_dateTime: Date for which we are checking if instance + * exists. + * + * @return Boolean: true if show has an instance on $p_dateTime, + * otherwise false. */ + public function hasInstanceOnDate($p_dateTime) + { + return (!is_null($this->getInstanceOnDate($p_dateTime))); + } + + /* Only used for shows that are repeating. Note that this will return + * shows that have been "modified" (does not check if the "modified_instance" + * column is set to true). This is intended behaviour. + * + * @param $p_dateTime: Date for which we are getting an instance. + * + * @return CcShowInstancesQuery: An propel object representing a + * row in the cc_show_instances table. */ + public function getInstanceOnDate($p_dateTime) + { + $timestamp = $p_dateTime->format("Y-m-d H:i:s"); + $sql = << $this->getId(), + ':timestamp' => $timestamp ), 'column'); + return CcShowInstancesQuery::create() + ->findPk($row); + } catch (Exception $e) { + return null; + } + + } + + public function deletePossiblyInvalidInstances($p_data, $p_endDate, $isRecorded, $repeatType) + { + if ($p_data['add_show_repeats'] != $this->isRepeating()) { + //repeat option was toggled + $this->deleteAllInstances(); + } + + if ($p_data['add_show_duration'] != $this->getDuration()) { + //duration has changed + $this->updateDurationTime($p_data); + } + + if ($p_data['add_show_repeats']) { + if (($repeatType == 1 || $repeatType == 2) && + $p_data['add_show_start_date'] != $this->getStartDate()){ + + //start date has changed when repeat type is bi-weekly or monthly. + //This screws up the repeating positions of show instances, so lets + //just delete them for now. (CC-2351) + + $this->deleteAllInstances(); + } + + if ($repeatType != $this->getRepeatType()) { + //repeat type changed. + $this->deleteAllInstances(); + } else { + //repeat type is the same, check if the days of the week are the same + $repeatingDaysChanged = false; + $showDaysArray = $this->getShowDays(); + if (count($p_data['add_show_day_check']) == count($showDaysArray)) { + //same number of days checked, lets see if they are the same numbers + $intersect = array_intersect($p_data['add_show_day_check'], $showDaysArray); + if (count($intersect) != count($p_data['add_show_day_check'])) { + $repeatingDaysChanged = true; + } + } else { + $repeatingDaysChanged = true; + } + + if ($repeatingDaysChanged) { + $daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']); + + if (count($daysRemoved) > 0) { + + $this->removeUncheckedDaysInstances($daysRemoved); + } + } + + if ($p_data['add_show_start_date'] != $this->getStartDate() + || $p_data['add_show_start_time'] != $this->getStartTime()){ + //start date/time has changed + + $newDate = strtotime($p_data['add_show_start_date']); + $oldDate = strtotime($this->getStartDate()); + if ($newDate > $oldDate) { + $this->removeAllInstancesBeforeDate($p_data['add_show_start_date']); + } + + $this->updateStartDateTime($p_data, $p_endDate); + } + } + + //Check if end date for the repeat option has changed. If so, need to take care + //of deleting possible invalid Show Instances. + if ((strlen($this->getRepeatingEndDate()) == 0) == $p_data['add_show_no_end']) { + //show "Never Ends" option was toggled. + if ($p_data['add_show_no_end']) { + } else { + $this->removeAllInstancesFromDate($p_endDate); + } + } + if ($this->getRepeatingEndDate() != $p_data['add_show_end_date']) { + //end date was changed. + + $newDate = strtotime($p_data['add_show_end_date']); + $oldDate = strtotime($this->getRepeatingEndDate()); + if ($newDate < $oldDate) { + $this->removeAllInstancesFromDate($p_endDate); + } + } + } + } + + /** + * Create a show. + * + * Note: end dates are non inclusive. + * + * @param array $data + * @return int + * Show ID + */ + public static function create($data) + { + $startDateTime = new DateTime($data['add_show_start_date']." ".$data['add_show_start_time']); + $utcStartDateTime = clone $startDateTime; + $utcStartDateTime->setTimezone(new DateTimeZone('UTC')); + + if ($data['add_show_no_end']) { + $endDate = NULL; + } elseif ($data['add_show_repeats']) { + $endDateTime = new DateTime($data['add_show_end_date']); + //$endDateTime->setTimezone(new DateTimeZone('UTC')); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($data['add_show_start_date']); + //$endDateTime->setTimezone(new DateTimeZone('UTC')); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + //What we are doing here is checking if the show repeats or if + //any repeating days have been checked. If not, then by default + //the "selected" DOW is the initial day. + //DOW in local time. + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$data['add_show_repeats']) { + $data['add_show_day_check'] = array($startDow); + } elseif ($data['add_show_repeats'] && $data['add_show_day_check'] == "") { + $data['add_show_day_check'] = array($startDow); + } + + //find repeat type or set to a non repeating show. + $repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1; + + if ($data['add_show_id'] == -1) { + $ccShow = new CcShow(); + } else { + $ccShow = CcShowQuery::create()->findPK($data['add_show_id']); + } + $ccShow->setDbName($data['add_show_name']); + $ccShow->setDbDescription($data['add_show_description']); + $ccShow->setDbUrl($data['add_show_url']); + $ccShow->setDbGenre($data['add_show_genre']); + $ccShow->setDbColor($data['add_show_color']); + $ccShow->setDbBackgroundColor($data['add_show_background_color']); + $ccShow->setDbLiveStreamUsingAirtimeAuth($data['cb_airtime_auth'] == 1); + $ccShow->setDbLiveStreamUsingCustomAuth($data['cb_custom_auth'] == 1); + $ccShow->setDbLiveStreamUser($data['custom_username']); + $ccShow->setDbLiveStreamPass($data['custom_password']); + $ccShow->save(); + + $showId = $ccShow->getDbId(); + + $isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0; + + if ($data['add_show_id'] != -1) { + $show = new Application_Model_Show($showId); + $show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType); + } + + //check if we are adding or updating a show, and if updating + //erase all the show's show_days information first. + if ($data['add_show_id'] != -1) { + CcShowDaysQuery::create()->filterByDbShowId($data['add_show_id'])->delete(); + } + + //don't set day for monthly repeat type, it's invalid. + if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(date_default_timezone_get()); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($data['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(date_default_timezone_get()); + $showDay->setDbDuration($data['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } + + //check if we are adding or updating a show, and if updating + //erase all the show's future show_rebroadcast information first. + if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) { + CcShowRebroadcastQuery::create() + ->filterByDbShowId($data['add_show_id']) + ->delete(); + } + //adding rows to cc_show_rebroadcast + /* TODO: Document magic constant 10 and define it properly somewhere + --RG */ + if (($isRecorded && $data['add_show_rebroadcast']) && ($repeatType != -1)) { + for ($i=1; $i<=10; $i++) { + if ($data['add_show_rebroadcast_date_'.$i]) { + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]); + $showRebroad->setDbStartTime($data['add_show_rebroadcast_time_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } elseif ($isRecorded && $data['add_show_rebroadcast'] && ($repeatType == -1)) { + for ($i=1; $i<=10; $i++) { + if ($data['add_show_rebroadcast_date_absolute_'.$i]) { + //$con = Propel::getConnection(CcShowPeer::DATABASE_NAME); + //$sql = "SELECT date '{$data['add_show_rebroadcast_date_absolute_'.$i]}' - date '{$data['add_show_start_date']}' "; + $sql = << + $data["add_show_rebroadcast_date_absolute_$i"], + 'start' => + $data['add_show_start_date']), "column" ); + + //$r = $con->query($sql); + //$offset_days = $r->fetchColumn(0); + + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($offset_days." days"); + $showRebroad->setDbStartTime($data['add_show_rebroadcast_time_absolute_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } + + //check if we are adding or updating a show, and if updating + //erase all the show's show_rebroadcast information first. + if ($data['add_show_id'] != -1) { + CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete(); + } + if (is_array($data['add_show_hosts'])) { + //add selected hosts to cc_show_hosts table. + foreach ($data['add_show_hosts'] as $host) { + $showHost = new CcShowHosts(); + $showHost->setDbShow($showId); + $showHost->setDbHost($host); + $showHost->save(); + } + } + + if ($data['add_show_id'] != -1) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $con->beginTransaction(); + + + //current timesamp in UTC. + $current_timestamp = gmdate("Y-m-d H:i:s"); + + try { + //update the status flag in cc_schedule. + $instances = CcShowInstancesQuery::create() + ->filterByDbEnds($current_timestamp, Criteria::GREATER_THAN) + ->filterByDbShowId($data['add_show_id']) + ->find($con); + + foreach ($instances as $instance) { + $instance->updateScheduleStatus($con); + } + + $con->commit(); + } catch (Exception $e) { + $con->rollback(); + Logging::info("Couldn't update schedule status."); + Logging::info($e->getMessage()); + } + } + + Application_Model_Show::populateShowUntil($showId); + Application_Model_RabbitMq::PushSchedule(); + + return $showId; + } + + /** + * Generate repeating show instances for a single show up to the given date. + * It will always try to use enddate from DB but if that's empty, it will use + * time now. + * + * @param int $p_showId + */ + public static function populateShowUntil($p_showId) + { + $con = Propel::getConnection(); + $date = Application_Model_Preference::GetShowsPopulatedUntil(); + + if (is_null($date)) { + $p_populateUntilDateTime = new DateTime("now", new DateTimeZone('UTC')); + Application_Model_Preference::SetShowsPopulatedUntil($p_populateUntilDateTime); + } else { + $p_populateUntilDateTime = $date; + } + + $stmt = $con->prepare("SELECT * FROM cc_show_days WHERE show_id = :show_id"); + $stmt->bindParam(':show_id', $p_showId); + $stmt->execute(); + + $res = $stmt->fetchAll(); + + foreach ($res as $showDaysRow) { + Application_Model_Show::populateShow($showDaysRow, $p_populateUntilDateTime); + } + } + + /** + * We are going to use cc_show_days as a template, to generate Show Instances. This function + * is basically a dispatcher that looks at the show template, and sends it to the correct function + * so that Show Instance generation can begin. After the all show instances have been created, pushes + * the schedule to Pypo. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. + */ + private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) + { + // TODO : use constants instead of int values here? or maybe php will + // get enum types by the time somebody gets around to fix this. -- RG + if ($p_showDaysRow["repeat_type"] == -1) { + Application_Model_Show::populateNonRepeatingShow($p_showDaysRow, $p_populateUntilDateTime); + } elseif ($p_showDaysRow["repeat_type"] == 0) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P7D'); + } elseif ($p_showDaysRow["repeat_type"] == 1) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P14D'); + } elseif ($p_showDaysRow["repeat_type"] == 2) { + Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P1M'); + } + Application_Model_RabbitMq::PushSchedule(); + } + + /** + * Creates a single show instance. If the show is recorded, it may have multiple + * rebroadcast dates, and so this function will create those as well. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. + */ + private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime) + { + $show_id = $p_showRow["show_id"]; + $first_show = $p_showRow["first_show"]; //non-UTC + $start_time = $p_showRow["start_time"]; //non-UTC + $duration = $p_showRow["duration"]; + $record = $p_showRow["record"]; + $timezone = $p_showRow["timezone"]; + $start = $first_show." ".$start_time; + + //start & end UTC DateTimes for the show. + list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start, $duration, $timezone); + if ($utcStartDateTime->getTimestamp() < $p_populateUntilDateTime->getTimestamp()) { + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + $show = new Application_Model_Show($show_id); + if ($show->hasInstance()) { + $ccShowInstance = $show->getInstance(); + $newInstance = false; + } else { + $ccShowInstance = new CcShowInstances(); + $newInstance = true; + } + + if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + } + + $show_instance_id = $ccShowInstance->getDbId(); + $showInstance = new Application_Model_ShowInstance($show_instance_id); + + if (!$newInstance) { + $showInstance->correctScheduleStartTimes(); + } + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, + array( ':show_id' => $show_id ), 'all'); + + if ($showInstance->isRecorded()) { + $showInstance->deleteRebroadcasts(); + self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); + } + } + } + + /** + * Creates a 1 or more than 1 show instances (user has stated this show repeats). If the show + * is recorded, it may have multiple rebroadcast dates, and so this function will create + * those as well. + * + * @param array $p_showRow + * A row from cc_show_days table + * @param DateTime $p_populateUntilDateTime + * DateTime object in UTC time. "shows_populated_until" date YY-mm-dd in cc_pref + * @param string $p_interval + * Period of time between repeating shows (in php DateInterval notation 'P7D') + */ + private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval) + { + $show_id = $p_showDaysRow["show_id"]; + $next_pop_date = $p_showDaysRow["next_pop_date"]; + $first_show = $p_showDaysRow["first_show"]; //non-UTC + $last_show = $p_showDaysRow["last_show"]; //non-UTC + $start_time = $p_showDaysRow["start_time"]; //non-UTC + $duration = $p_showDaysRow["duration"]; + $day = $p_showDaysRow["day"]; + $record = $p_showDaysRow["record"]; + $timezone = $p_showDaysRow["timezone"]; + + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + if (isset($next_pop_date)) { + $start = $next_pop_date." ".$start_time; + } else { + $start = $first_show." ".$start_time; + } + + $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); + //convert $last_show into a UTC DateTime object, or null if there is no last show. + $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + + $rebroadcasts = Application_Common_Database::prepareAndExecute( $sql, + array( ':show_id' => $show_id ), 'all'); + + $show = new Application_Model_Show($show_id); + + while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp() + && (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){ + + list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone); + + if ($show->hasInstanceOnDate($utcStartDateTime)) { + $ccShowInstance = $show->getInstanceOnDate($utcStartDateTime); + + if ($ccShowInstance->getDbModifiedInstance()) { + //show instance on this date has been deleted. + list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone); + continue; + } + + $newInstance = false; + } else { + $ccShowInstance = new CcShowInstances(); + $newInstance = true; + } + + /* When editing the start/end time of a repeating show, we don't want to + * change shows that started in the past. So check the start time. + */ + if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + } + + + $show_instance_id = $ccShowInstance->getDbId(); + $showInstance = new Application_Model_ShowInstance($show_instance_id); + + /* If we are updating a show then make sure that the scheduled content within + * the show is updated to the correct time. */ + if (!$newInstance) { + $showInstance->correctScheduleStartTimes(); + } + + $showInstance->deleteRebroadcasts(); + self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); + list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone); + + } + + Application_Model_Show::setNextPop($start, $show_id, $day); + } + + private static function advanceRepeatingDate($p_interval, $start, $timezone) + { + $startDt = new DateTime($start, new DateTimeZone($timezone)); + if ($p_interval == 'P1M') { + /* When adding months, there is a problem if we are on January 31st and add one month with PHP. + * What ends up happening is that since February 31st doesn't exist, the date returned is + * March 3rd. For now let's ignore the day and assume we are always working with the + * first of each month, and use PHP to add 1 month to this (this will take care of rolling + * over the years 2011->2012, etc.). Then let's append the actual day, and use the php + * checkdate() function, to see if it is valid. If not, then we'll just skip this month. */ + + /* pass in only the year and month (not the day) */ + $dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone)); + + + /* Keep adding 1 month, until we find the next month that contains the day + * we are looking for (31st day for example) */ + do { + $dt->add(new DateInterval($p_interval)); + } while (!checkdate($dt->format("m"), $startDt->format("d"), $dt->format("Y"))); + + $dt->setDate($dt->format("Y"), $dt->format("m"), $startDt->format("d")); + + } else { + $dt = new DateTime($start, new DateTimeZone($timezone)); + $dt->add(new DateInterval($p_interval)); + } + + $start = $dt->format("Y-m-d H:i:s"); + + $dt->setTimezone(new DateTimeZone('UTC')); + $utcStartDateTime = $dt; + + return array($start, $utcStartDateTime); + } + + /* + * @param $p_start + * timestring format "Y-m-d H:i:s" (not UTC) + * @param $p_duration + * string time interval (h)h:(m)m(:ss) + * @param $p_timezone + * string "Europe/Prague" + * @param $p_offset + * array (days, hours, mins) used for rebroadcast shows. + * + * @return + * array of 2 DateTime objects, start/end time of the show in UTC. + */ + private static function createUTCStartEndDateTime($p_start, $p_duration, $p_timezone=null, $p_offset=null) + { + $timezone = $p_timezone ? $p_timezone : date_default_timezone_get(); + + $startDateTime = new DateTime($p_start, new DateTimeZone($timezone)); + if (isset($p_offset)) { + $startDateTime->add(new DateInterval("P{$p_offset["days"]}DT{$p_offset["hours"]}H{$p_offset["mins"]}M")); + } + //convert time to UTC + $startDateTime->setTimezone(new DateTimeZone('UTC')); + + $endDateTime = clone $startDateTime; + $duration = explode(":", $p_duration); + list($hours, $mins) = array_slice($duration, 0, 2); + $endDateTime->add(new DateInterval("PT{$hours}H{$mins}M")); + + return array($startDateTime, $endDateTime); + } + + /* Create rebroadcast instances for a created show marked for recording + * + * @param $p_rebroadcasts + * rows gotten from the db table cc_show_rebroadcasts, tells airtime when to schedule the rebroadcasts. + * @param $p_currentUtcTimestamp + * a timestring in format "Y-m-d H:i:s", current UTC time. + * @param $p_showId + * int of the show it belongs to (from cc_show) + * @param $p_showInstanceId + * the instance id of the created recorded show instance + * (from cc_show_instances), used to associate rebroadcasts to this show. + * @param $p_startTime + * a timestring in format "Y-m-d H:i:s" in the timezone, not UTC of the rebroadcasts' parent recorded show. + * @param $p_duration + * string time interval (h)h:(m)m:(ss) length of the show. + * @param $p_timezone + * string of user's timezone "Europe/Prague" + * + */ + private static function createRebroadcastInstances($p_rebroadcasts, $p_currentUtcTimestamp, $p_showId, $p_showInstanceId, $p_startTime, $p_duration, $p_timezone=null) + { + //Y-m-d + //use only the date part of the show start time stamp for the offsets to work properly. + $date = explode(" ", $p_startTime); + $start_date = $date[0]; + + foreach ($p_rebroadcasts as $rebroadcast) { + + $days = explode(" ", $rebroadcast["day_offset"]); + $time = explode(":", $rebroadcast["start_time"]); + $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); + + list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start_date, $p_duration, $p_timezone, $offset); + + if ($utcStartDateTime->format("Y-m-d H:i:s") > $p_currentUtcTimestamp) { + + $newRebroadcastInstance = new CcShowInstances(); + $newRebroadcastInstance->setDbShowId($p_showId); + $newRebroadcastInstance->setDbStarts($utcStartDateTime); + $newRebroadcastInstance->setDbEnds($utcEndDateTime); + $newRebroadcastInstance->setDbRecord(0); + $newRebroadcastInstance->setDbRebroadcast(1); + $newRebroadcastInstance->setDbOriginalShow($p_showInstanceId); + $newRebroadcastInstance->save(); + } + } + } + + /** + * Get all the show instances in the given time range (inclusive). + * + * @param DateTime $start_timestamp + * In UTC time. + * @param DateTime $end_timestamp + * In UTC time. + * @param unknown_type $excludeInstance + * @param boolean $onlyRecord + * @return array + */ + public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE) + { + //UTC DateTime object + $showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil(); + //if application is requesting shows past our previous populated until date, generate shows up until this point. + if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) { + Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp); + Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp); + } + + $sql = <<format("Y-m-d H:i:s"); + $end_string = $end_timestamp->format("Y-m-d H:i:s"); + if ($onlyRecord) { + $sql .= " AND (si1.starts >= :start::TIMESTAMP AND si1.starts < :end::TIMESTAMP)"; + $sql .= " AND (si1.record = 1)"; + + return Application_Common_Database::prepareAndExecute( $sql, + array( ':start' => $start_string, + ':end' => $end_string ), 'all'); + + } else { + $sql .= " ". <<= :start1::TIMESTAMP AND si1.starts < :end1::TIMESTAMP) + OR (si1.ends > :start2::TIMESTAMP AND si1.ends <= :end2::TIMESTAMP) + OR (si1.starts <= :start3::TIMESTAMP AND si1.ends >= :end3::TIMESTAMP)) +SQL; + return Application_Common_Database::prepareAndExecute( $sql, + array( + 'start1' => $start_string, + 'start2' => $start_string, + 'start3' => $start_string, + 'end1' => $end_string, + 'end2' => $end_string, + 'end3' => $end_string + ), 'all'); + } + } + + private static function setNextPop($next_date, $show_id, $day) + { + $nextInfo = explode(" ", $next_date); + + $repeatInfo = CcShowDaysQuery::create() + ->filterByDbShowId($show_id) + ->filterByDbDay($day) + ->findOne(); + + $repeatInfo->setDbNextPopDate($nextInfo[0]) + ->save(); + } + + /** + * Generate all the repeating shows in the given range. + * + * @param DateTime $p_startTimestamp + * In UTC format. + * @param DateTime $p_endTimestamp + * In UTC format. + */ + public static function populateAllShowsInRange($p_startTimestamp, $p_endTimestamp) + { + $con = Propel::getConnection(); + + $endTimeString = $p_endTimestamp->format("Y-m-d H:i:s"); + if (!is_null($p_startTimestamp)) { + $startTimeString = $p_startTimestamp->format("Y-m-d H:i:s"); + } else { + $today_timestamp = new DateTime("now", new DateTimeZone("UTC")); + $startTimeString = $today_timestamp->format("Y-m-d H:i:s"); + } + + $stmt = $con->prepare(" + SELECT * FROM cc_show_days + WHERE last_show IS NULL + OR first_show < :endTimeString AND last_show > :startTimeString"); + + $stmt->bindParam(':endTimeString', $endTimeString); + $stmt->bindParam(':startTimeString', $startTimeString); + $stmt->execute(); + + $res = $stmt->fetchAll(); + foreach ($res as $row) { + Application_Model_Show::populateShow($row, $p_endTimestamp); + } + } + + /** + * + * @param DateTime $start + * -in UTC time + * @param DateTime $end + * -in UTC time + * @param boolean $editable + */ + public static function &getFullCalendarEvents($p_start, $p_end, $p_editable=false) + { + $events = array(); + $interval = $p_start->diff($p_end); + $days = $interval->format('%a'); + $shows = Application_Model_Show::getShows($p_start, $p_end); + $content_count = Application_Model_ShowInstance::getContentCount( + $p_start, $p_end); + $isFull = Application_Model_ShowInstance::getIsFull($p_start, $p_end); + $timezone = date_default_timezone_get(); + $current_timezone = new DateTimeZone($timezone); + $utc = new DateTimeZone("UTC"); + $now = new DateTime("now", $utc); + + foreach ($shows as &$show) { + $options = array(); + + //only bother calculating percent for week or day view. + if (intval($days) <= 7) { + $options["percent"] = Application_Model_Show::getPercentScheduled($show["starts"], $show["ends"], $show["time_filled"]); + } + + if (isset($show["parent_starts"])) { + $parentStartsDT = new DateTime($show["parent_starts"], $utc); + } + + $startsDT = DateTime::createFromFormat("Y-m-d G:i:s", + $show["starts"],$utc); + $endsDT = DateTime::createFromFormat("Y-m-d G:i:s", + $show["ends"], $utc); + + if( $p_editable ) { + if ($show["record"] && $now > $startsDT) { + $options["editable"] = false; + } elseif ($show["rebroadcast"] && + $now > $parentStartsDT) { + $options["editable"] = false; + } elseif ($now < $endsDT) { + $options["editable"] = true; + } + } + + $startsDT->setTimezone($current_timezone); + $endsDT->setTimezone($current_timezone); + + $options["show_empty"] = (array_key_exists($show['instance_id'], + $content_count)) ? 0 : 1; + + $options["show_partial_filled"] = !$isFull[$show['instance_id']]; + + $event = array(); + + $event["id"] = intval($show["instance_id"]); + $event["title"] = $show["name"]; + $event["start"] = $startsDT->format("Y-m-d H:i:s"); + $event["end"] = $endsDT->format("Y-m-d H:i:s"); + $event["allDay"] = false; + $event["showId"] = intval($show["show_id"]); + $event["record"] = intval($show["record"]); + $event["rebroadcast"] = intval($show["rebroadcast"]); + $event["soundcloud_id"] = is_null($show["soundcloud_id"]) + ? -1 : $show["soundcloud_id"]; + + //event colouring + if ($show["color"] != "") { + $event["textColor"] = "#".$show["color"]; + } + + if ($show["background_color"] != "") { + $event["color"] = "#".$show["background_color"]; + } + + foreach ($options as $key => $value) { + $event[$key] = $value; + } + + $events[] = $event; + } + return $events; + } + + /** + * Calculates the percentage of a show scheduled given the start and end times in date/time format + * and the time_filled as the total time the schow is scheduled for in time format. + **/ + private static function getPercentScheduled($p_starts, $p_ends, $p_time_filled) + { + $durationSeconds = (strtotime($p_ends) - strtotime($p_starts)); + $time_filled = Application_Model_Schedule::WallTimeToMillisecs($p_time_filled) / 1000; + $percent = ceil(( $time_filled / $durationSeconds) * 100); + + return $percent; + } + +/* private static function &makeFullCalendarEvent(&$show, $options=array(), $startDateTime, $endDateTime, $startsEpoch, $endsEpoch) + { + $event = array(); + + $event["id"] = intval($show["instance_id"]); + $event["title"] = $show["name"]; + $event["start"] = $startDateTime->format("Y-m-d H:i:s"); + $event["startUnix"] = $startsEpoch; + $event["end"] = $endDateTime->format("Y-m-d H:i:s"); + $event["endUnix"] = $endsEpoch; + $event["allDay"] = false; + $event["showId"] = intval($show["show_id"]); + $event["record"] = intval($show["record"]); + $event["rebroadcast"] = intval($show["rebroadcast"]); + $event["soundcloud_id"] = is_null($show["soundcloud_id"]) + ? -1 : $show["soundcloud_id"]; + + //event colouring + if ($show["color"] != "") { + $event["textColor"] = "#".$show["color"]; + } + + if ($show["background_color"] != "") { + $event["color"] = "#".$show["background_color"]; + } + + foreach ($options as $key => $value) { + $event[$key] = $value; + } + + return $event; + }*/ + + /* Takes in a UTC DateTime object. + * Converts this to local time, since cc_show days + * requires local time. */ + public function setShowFirstShow($p_dt) + { + //clone object since we are modifying it and it was passed by reference. + $dt = clone $p_dt; + + $dt->setTimezone(new DateTimeZone(date_default_timezone_get())); + + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbFirstShow($dt)->setDbStartTime($dt) + ->save(); + + //Logging::info("setting show's first show."); + } + + /* Takes in a UTC DateTime object + * Converts this to local time, since cc_show days + * requires local time. */ + public function setShowLastShow($p_dt) + { + //clone object since we are modifying it and it was passed by reference. + $dt = clone $p_dt; + + $dt->setTimezone(new DateTimeZone(date_default_timezone_get())); + + //add one day since the Last Show date in CcShowDays is non-inclusive. + $dt->add(new DateInterval("P1D")); + + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbLastShow($dt) + ->save(); + } + + /** + * Given time $timeNow, returns the show being played right now. + * Times are all in UTC time. + * + * @param String $timeNow - current time (in UTC) + * @return array - show being played right now + */ + public static function getCurrentShow($timeNow=null) + { + $CC_CONFIG = Config::getConfig(); + $con = Propel::getConnection(); + if ($timeNow == null) { + $date = new Application_Common_DateHelper; + $timeNow = $date->getUtcTimestamp(); + } + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = << :timeNow2::timestamp + AND modified_instance != TRUE +SQL; + + $stmt = $con->prepare($sql); + $stmt->bindParam(':timeNow1', $timeNow); + $stmt->bindParam(':timeNow2', $timeNow); + + if ($stmt->execute()) { + $rows = $stmt->fetchAll(); + } else { + $msg = implode(',', $stmt->errorInfo()); + throw new Exception("Error: $msg"); + } + + return $rows; + } + + /** + * Gets the current show, previous and next with an 2day window from + * the given timeNow, so timeNow-2days and timeNow+2days. + */ + public static function getPrevCurrentNext($p_timeNow) + { + $CC_CONFIG = Config::getConfig(); + $con = Propel::getConnection(); + // + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = << :timeNow1::timestamp - INTERVAL '2 days' + AND si.ends < :timeNow2::timestamp + INTERVAL '2 days' + AND modified_instance != TRUE +ORDER BY si.starts +SQL; + + $stmt = $con->prepare($sql); + + $stmt->bindValue(':timeNow1', $p_timeNow); + $stmt->bindValue(':timeNow2', $p_timeNow); + + if ($stmt->execute()) { + $rows = $stmt->fetchAll(); + } else { + $msg = implode(',', $stmt->errorInfo()); + throw new Exception("Error: $msg"); + } + + $numberOfRows = count($rows); + + $results['previousShow'] = array(); + $results['currentShow'] = array(); + $results['nextShow'] = array(); + + $timeNowAsMillis = strtotime($p_timeNow); + + for ($i = 0; $i < $numberOfRows; ++$i) { + //Find the show that is within the current time. + if ((strtotime($rows[$i]['starts']) <= $timeNowAsMillis) + && (strtotime($rows[$i]['ends']) > $timeNowAsMillis)) { + if ($i-1 >= 0) { + $results['previousShow'][0] = array( + "id" => $rows[$i-1]['id'], + "instance_id" => $rows[$i-1]['instance_id'], + "name" => $rows[$i-1]['name'], + "url" => $rows[$i-1]['url'], + "start_timestamp" => $rows[$i-1]['start_timestamp'], + "end_timestamp" => $rows[$i-1]['end_timestamp'], + "starts" => $rows[$i-1]['starts'], + "ends" => $rows[$i-1]['ends'], + "record" => $rows[$i-1]['record'], + "type" => "show"); + } + + $results['currentShow'][0] = $rows[$i]; + + if (isset($rows[$i+1])) { + $results['nextShow'][0] = array( + "id" => $rows[$i+1]['id'], + "instance_id" => $rows[$i+1]['instance_id'], + "name" => $rows[$i+1]['name'], + "url" => $rows[$i+1]['url'], + "start_timestamp" => $rows[$i+1]['start_timestamp'], + "end_timestamp" => $rows[$i+1]['end_timestamp'], + "starts" => $rows[$i+1]['starts'], + "ends" => $rows[$i+1]['ends'], + "record" => $rows[$i+1]['record'], + "type" => "show"); + } + break; + } + //Previous is any row that ends after time now capture it in case we need it later. + if (strtotime($rows[$i]['ends']) < $timeNowAsMillis ) { + $previousShowIndex = $i; + } + //if we hit this we know we've gone to far and can stop looping. + if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) { + $results['nextShow'][0] = array( + "id" => $rows[$i]['id'], + "instance_id" => $rows[$i]['instance_id'], + "name" => $rows[$i]['name'], + "url" => $rows[$i]['url'], + "start_timestamp" => $rows[$i]['start_timestamp'], + "end_timestamp" => $rows[$i]['end_timestamp'], + "starts" => $rows[$i]['starts'], + "ends" => $rows[$i]['ends'], + "record" => $rows[$i]['record'], + "type" => "show"); + break; + } + } + //If we didn't find a a current show because the time didn't fit we may still have + //found a previous show so use it. + if (count($results['previousShow']) == 0 && isset($previousShowIndex)) { + $results['previousShow'][0] = array( + "id" => $rows[$previousShowIndex]['id'], + "instance_id" => $rows[$previousShowIndex]['instance_id'], + "name" => $rows[$previousShowIndex]['name'], + "start_timestamp" => $rows[$previousShowIndex]['start_timestamp'], + "end_timestamp" => $rows[$previousShowIndex]['end_timestamp'], + "starts" => $rows[$previousShowIndex]['starts'], + "ends" => $rows[$previousShowIndex]['ends'], + "record" => $rows[$previousShowIndex]['record'], + "type" => "show"); + } + + return $results; + } + + /** + * Given a start time $timeStart and end time $timeEnd, returns the next $limit + * number of shows within the time interval + * If $timeEnd not given, shows within next 48 hours from $timeStart are returned + * If $limit not given, all shows within the intervals are returned + * Times are all in UTC time. + * + * @param String $timeStart - interval start time (in UTC) + * @param int $limit - number of shows to return + * @param String $timeEnd - interval end time (in UTC) + * @return array - the next $limit number of shows within the time interval + */ + public static function getNextShows($timeStart, $limit = "ALL", $timeEnd = "") + { + // defaults to retrieving shows from next 2 days if no end time has + // been specified + if ($timeEnd == "") { + $timeEnd = "'$timeStart' + INTERVAL '2 days'"; + } + + //TODO, returning starts + ends twice (once with an alias). Unify this after the 2.0 release. --Martin + $sql = <<= :timeStart::timestamp + AND si.starts < :timeEnd::timestamp + AND modified_instance != TRUE +ORDER BY si.starts +SQL; + + //PDO won't accept "ALL" as a limit value (complains it is not an + //integer, and so we must completely remove the limit clause if we + //want to show all results - MK + if ($limit != "ALL") { + $sql .= PHP_EOL."LIMIT :lim"; + $params = array( + ':timeStart' => $timeStart, + ':timeEnd' => $timeEnd, + ':lim' => $limit); + } else { + $params = array( + ':timeStart' => $timeStart, + ':timeEnd' => $timeEnd); + } + + return Application_Common_Database::prepareAndExecute( $sql, $params, 'all'); + } + + /** + * Convert the columns given in the array $columnsToConvert in the + * database result $rows to local timezone. + * + * @param type $rows arrays of arrays containing database query result + * @param type $columnsToConvert array of column names to convert + */ + public static function convertToLocalTimeZone(&$rows, $columnsToConvert) + { + if (!is_array($rows)) { + return; + } + foreach ($rows as &$row) { + foreach ($columnsToConvert as $column) { + $row[$column] = Application_Common_DateHelper::ConvertToLocalDateTimeString($row[$column]); + } + } + } + + public static function getMaxLengths() + { + $con = Propel::getConnection(); + $sql = << 0 +SQL; + $result = $con->query($sql)->fetchAll(); + $assocArray = array(); + foreach ($result as $row) { + $assocArray[$row['column_name']] = $row['character_maximum_length']; + } + return $assocArray; + } + + public static function getStartEndCurrentMonthView() { + $first_day_of_calendar_month_view = mktime(0, 0, 0, date("n"), 1); + $weekStart = Application_Model_Preference::GetWeekStartDay(); + while (date('w', $first_day_of_calendar_month_view) != $weekStart) { + $first_day_of_calendar_month_view -= 60*60*24; + } + $last_day_of_calendar_view = $first_day_of_calendar_month_view + 3600*24*42; + + $start = new DateTime("@".$first_day_of_calendar_month_view); + $end = new DateTime("@".$last_day_of_calendar_view); + + return array($start, $end); + } + + public static function getStartEndCurrentWeekView() { + $first_day_of_calendar_week_view = mktime(0, 0, 0, date("n"), date("j")); + $weekStart = Application_Model_Preference::GetWeekStartDay(); + while (date('w', $first_day_of_calendar_week_view) != $weekStart) { + $first_day_of_calendar_week_view -= 60*60*24; + } + $last_day_of_calendar_view = $first_day_of_calendar_week_view + 3600*24*7; + + $start = new DateTime("@".$first_day_of_calendar_week_view); + $end = new DateTime("@".$last_day_of_calendar_view); + + return array($start, $end); + } + + public static function getStartEndCurrentDayView() { + $today = mktime(0, 0, 0, date("n"), date("j")); + $tomorrow = $today + 3600*24; + + $start = new DateTime("@".$today); + $end = new DateTime("@".$tomorrow); + + return array($start, $end); + } +} diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 1204f689c..e8322882b 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -175,15 +175,18 @@ class Application_Service_ScheduleService //create ccShow $ccShow = new CcShow(); $ccShow = $service_show->setShow($ccShow, $showData); + $showId = $ccShow->getDbId(); //create ccShowDay $service_show->createShowDays( - $showData, $ccShow->getDbId(), $user->getId(), $repeatType, $isRecorded); + $showData, $showId, $user->getId(), $repeatType, $isRecorded); + + //create ccShowRebroadcast + $service_show->createShowRebroadcast($showData, $showId, $repeatType, $isRecorded); //create ccShowHosts - - //create ccShowRebroadcast - + $service_show->createShowHosts($showData, $showId); + //populate ccShowInstances } } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php new file mode 100644 index 000000000..458cc4bd8 --- /dev/null +++ b/airtime_mvc/application/services/ShowService.php @@ -0,0 +1,145 @@ +setDbName($showData['add_show_name']); + $ccShow->setDbDescription($showData['add_show_description']); + $ccShow->setDbUrl($showData['add_show_url']); + $ccShow->setDbGenre($showData['add_show_genre']); + $ccShow->setDbColor($showData['add_show_color']); + $ccShow->setDbBackgroundColor($showData['add_show_background_color']); + $ccShow->setDbLiveStreamUsingAirtimeAuth($showData['cb_airtime_auth'] == 1); + $ccShow->setDbLiveStreamUsingCustomAuth($showData['cb_custom_auth'] == 1); + $ccShow->setDbLiveStreamUser($showData['custom_username']); + $ccShow->setDbLiveStreamPass($showData['custom_password']); + + $ccShow->save(); + return $ccShow; + } + + /** + * Creates new cc_show_days entries + */ + public function createShowDays($showData, $showId, $userId, $repeatType, $isRecorded) + { + $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); + + if ($showData['add_show_no_end']) { + $endDate = NULL; + } elseif ($showData['add_show_repeats']) { + $endDateTime = new DateTime($showData['add_show_end_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($showData['add_show_start_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + /* What we are doing here is checking if the show repeats or if + * any repeating days have been checked. If not, then by default + * the "selected" DOW is the initial day. + * DOW in local time. + */ + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$showData['add_show_repeats']) { + $showData['add_show_day_check'] = array($startDow); + } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { + $showData['add_show_day_check'] = array($startDow); + } + + // Don't set day for monthly repeat type, it's invalid + if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($showData['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } + } + + /** + * Creates new cc_show_rebroadcast entries + */ + public function createShowRebroadcast($showData, $showId, $repeatType, $isRecorded) + { + define("MAX_REBROADCAST_DATES", 10); + + if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { + for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + if ($showData['add_show_rebroadcast_date_'.$i]) { + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_'.$i]); + $showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } elseif ($isRecorded && $showData['add_show_rebroadcast'] && ($repeatType == -1)) { + for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + if ($showData['add_show_rebroadcast_date_absolute_'.$i]) { + $rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_$i"]); + $startDate = new DateTime($showData['add_show_start_date']); + $offsetDays = $startDate->diff($rebroadcastDate); + + $showRebroad = new CcShowRebroadcast(); + $showRebroad->setDbDayOffset($offsetDays->format("%a days")); + $showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_absolute_'.$i]); + $showRebroad->setDbShowId($showId); + $showRebroad->save(); + } + } + } + } + + /** + * Creates cc_show_hosts entries + */ + public function createShowHosts($showData, $showId) + { + if (is_array($showData['add_show_hosts'])) { + foreach ($showData['add_show_hosts'] as $host) { + $showHost = new CcShowHosts(); + $showHost->setDbShow($showId); + $showHost->setDbHost($host); + $showHost->save(); + } + } + } +} \ No newline at end of file From c29e11fa0f5101d30c38377f76db3580719735a8 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 13:21:39 -0500 Subject: [PATCH 011/128] Created empty showInstance service. Split populateShowUntil into 2 new functions: getPopulateDateUntil, and getShowDays --- .../application/services/ScheduleService.php | 5 ++- .../services/ShowInstanceService.php | 8 +++++ .../application/services/ShowService.php | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 airtime_mvc/application/services/ShowInstanceService.php diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index e8322882b..c0bc1a844 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -171,6 +171,7 @@ class Application_Service_ScheduleService if ($isAdminOrPM) { $service_show = new Application_Service_ShowService(); + $service_showInstances = new Application_Service_ShowInstanceService(); //create ccShow $ccShow = new CcShow(); @@ -187,7 +188,9 @@ class Application_Service_ScheduleService //create ccShowHosts $service_show->createShowHosts($showData, $showId); - //populate ccShowInstances + $populateShowsUntil = $service_show->getPopulateShowUntilDateTIme(); + //create ccShowInstances + $service_showInstances->createShowInstances($showId, $populateShowsUntil); } } diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php new file mode 100644 index 000000000..1f7a2eedc --- /dev/null +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -0,0 +1,8 @@ + $showId), 'all'); + } } \ No newline at end of file From af622eb4b8f83a98a7d3c227fed5caef1c2b4d1f Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Feb 2013 17:41:35 -0500 Subject: [PATCH 012/128] CC-4961: Show linking Refactored some more show instance creation functions --- airtime_mvc/application/models/Show.php | 10 +-- .../application/services/ScheduleService.php | 26 +++--- .../services/ShowInstanceService.php | 81 ++++++++++++++++++- .../application/services/ShowService.php | 70 +++++++++++++--- 4 files changed, 160 insertions(+), 27 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index d6f9db98b..23cc4d02e 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1310,7 +1310,7 @@ SQL; } } - Application_Model_Show::populateShowUntil($showId); + /*Application_Model_Show::populateShowUntil($showId);*/ Application_Model_RabbitMq::PushSchedule(); return $showId; @@ -1323,7 +1323,7 @@ SQL; * * @param int $p_showId */ - public static function populateShowUntil($p_showId) + /*public static function populateShowUntil($p_showId) { $con = Propel::getConnection(); $date = Application_Model_Preference::GetShowsPopulatedUntil(); @@ -1344,7 +1344,7 @@ SQL; foreach ($res as $showDaysRow) { Application_Model_Show::populateShow($showDaysRow, $p_populateUntilDateTime); } - } + }*/ /** * We are going to use cc_show_days as a template, to generate Show Instances. This function @@ -1357,7 +1357,7 @@ SQL; * @param DateTime $p_populateUntilDateTime * DateTime object in UTC time. */ - private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) + /*private static function populateShow($p_showDaysRow, $p_populateUntilDateTime) { // TODO : use constants instead of int values here? or maybe php will // get enum types by the time somebody gets around to fix this. -- RG @@ -1371,7 +1371,7 @@ SQL; Application_Model_Show::populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, 'P1M'); } Application_Model_RabbitMq::PushSchedule(); - } + }*/ /** * Creates a single show instance. If the show is recorded, it may have multiple diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index c0bc1a844..0e6bbf2ff 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -2,6 +2,14 @@ class Application_Service_ScheduleService { + private $service_show; + private $service_showInstances; + + public function __construct() + { + $this->service_show = new Application_Service_ShowService(); + $this->service_showInstances = new Application_Service_ShowInstanceService(); + } /* * Form stuff begins here * Typically I would keep form creation and validation @@ -170,27 +178,23 @@ class Application_Service_ScheduleService $showData["add_show_duration"]); if ($isAdminOrPM) { - $service_show = new Application_Service_ShowService(); - $service_showInstances = new Application_Service_ShowInstanceService(); - //create ccShow $ccShow = new CcShow(); - $ccShow = $service_show->setShow($ccShow, $showData); + $ccShow = $this->service_show->setShow($ccShow, $showData); $showId = $ccShow->getDbId(); - //create ccShowDay - $service_show->createShowDays( + //create ccShowDays + $this->service_show->createShowDays( $showData, $showId, $user->getId(), $repeatType, $isRecorded); - //create ccShowRebroadcast - $service_show->createShowRebroadcast($showData, $showId, $repeatType, $isRecorded); + //create ccShowRebroadcasts + $this->service_show->createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); //create ccShowHosts - $service_show->createShowHosts($showData, $showId); + $this->service_show->createShowHosts($showData, $showId); - $populateShowsUntil = $service_show->getPopulateShowUntilDateTIme(); //create ccShowInstances - $service_showInstances->createShowInstances($showId, $populateShowsUntil); + $this->service_showInstances->createShowInstances($showId); } } diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 1f7a2eedc..2b4d9a5f8 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -1,8 +1,85 @@ service_show = new Application_Service_ShowService(); + } + + /** + * + * Receives a cc_show id and determines whether to create a + * single show_instance or repeating show instances + */ + public function createShowInstances($showId) + { + $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); + + $showDays = $this->service_show->getShowDays($showId); + foreach ($showDays as $day) { + switch ($day["repeat_type"]) { + case self::NO_REPEAT: + $this->createNonRepeatingShowInstance($day, $populateUntil); + break; + case self::REPEAT_WEEKLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P7D"); + break; + case self::REPEAT_BI_WEEKLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P14D"); + break; + case self::REPEAT_MONTHLY_MONTHLY: + $this->createRepeatingShowInstances($day, $populateUntil, "P1M"); + break; + case self::REPEAT_MONTHLY_WEEKLY: + // do something here + break; + } + } + } + + /** + * + * Enter description here ... + * @param $showDay + * @param $populateUntil + */ + private function createNonRepeatingShowInstance($showDay, $populateUntil) + { + $start = $showDay["first_show"]." ".$showDay["start_time"]; + + list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( + $start, $showDay["duration"], $showDay["timezone"]); + + if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + $ccShowInstance = new CcShowInstances(); + if ($ccShowInstance->getTimestamp() > $currentUtcTimestamp) { + $ccShowInstance->setDbShowId($showDay["show_id"]); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($showDay["record"]); + $ccShowInstance->save(); + } + } + } + + /** + * + * Enter description here ... + * @param $showDay + * @param $populateUntil + * @param $repeatInterval + */ + private function createRepeatingShowInstances($showDay, $populateUntil, $repeatInterval) + { + Logging::info("repeating"); } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 82153300a..f69d42e42 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -2,8 +2,13 @@ class Application_Service_ShowService { + const MAX_REBROADCAST_DATES = 10; + /** - * Sets a cc_show entry + * + * Enter description here ... + * @param $ccShow + * @param $showData */ public function setShow($ccShow, $showData) { @@ -23,7 +28,13 @@ class Application_Service_ShowService } /** - * Creates new cc_show_days entries + * + * Enter description here ... + * @param $showData + * @param $showId + * @param $userId + * @param $repeatType + * @param $isRecorded */ public function createShowDays($showData, $showId, $userId, $repeatType, $isRecorded) { @@ -95,14 +106,17 @@ class Application_Service_ShowService } /** - * Creates new cc_show_rebroadcast entries + * + * Enter description here ... + * @param $showData + * @param $showId + * @param $repeatType + * @param $isRecorded */ - public function createShowRebroadcast($showData, $showId, $repeatType, $isRecorded) + public function createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded) { - define("MAX_REBROADCAST_DATES", 10); - if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { - for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_'.$i]) { $showRebroad = new CcShowRebroadcast(); $showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_'.$i]); @@ -112,7 +126,7 @@ class Application_Service_ShowService } } } elseif ($isRecorded && $showData['add_show_rebroadcast'] && ($repeatType == -1)) { - for ($i=1; $i<=MAX_REBROADCAST_DATES; $i++) { + for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_absolute_'.$i]) { $rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_$i"]); $startDate = new DateTime($showData['add_show_start_date']); @@ -129,7 +143,10 @@ class Application_Service_ShowService } /** - * Creates cc_show_hosts entries + * + * Enter description here ... + * @param $showData + * @param $showId */ public function createShowHosts($showData, $showId) { @@ -174,4 +191,39 @@ class Application_Service_ShowService return Application_Common_Database::prepareAndExecute( $sql, array(":show_id" => $showId), 'all'); } + + /** + * + * Enter description here ... + * @param $localStart timestring format "Y-m-d H:i:s" (not UTC) + * @param $duration string time interval (h)h:(m)m(:ss) + * @param $timezone string "Europe/Prague" + * @param $offset array (days, hours, mins) used for rebroadcast shows + * + * @return array of 2 DateTime objects, start/end time of the show in UTC + */ + public function createUTCStartEndDateTime($localStart, $duration, $timezone=null, $offset=null) + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + if (!isset($timezone)) { + $timezone = Application_Model_Preference::GetUserTimezone($user->getId()); + } + + $startDateTime = new DateTime($localStart, new DateTimeZone($timezone)); + if (isset($offset)) { + $startDateTime->add(new DateInterval("P{$offset["days"]}DT{$offset["hours"]}H{$offset["mins"]}M")); + } + //convert time to UTC + $startDateTime->setTimezone(new DateTimeZone('UTC')); + + $endDateTime = clone $startDateTime; + $duration = explode(":", $duration); + list($hours, $mins) = array_slice($duration, 0, 2); + $endDateTime->add(new DateInterval("PT{$hours}H{$mins}M")); + + return array($startDateTime, $endDateTime); + } } \ No newline at end of file From 4a86da5f87386e80c5fad168e1d5a4df6a938149 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 11:19:03 -0500 Subject: [PATCH 013/128] Created function to create repeating show instances Created function to create rebroadcast show instances --- .../application/services/ScheduleService.php | 3 +- .../services/ShowInstanceService.php | 129 +++++++++++++++--- .../application/services/ShowService.php | 8 +- 3 files changed, 118 insertions(+), 22 deletions(-) diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 0e6bbf2ff..77ef24d4e 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -173,6 +173,7 @@ class Application_Service_ScheduleService $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; $showData["add_show_duration"] = $this->formatShowDuration( $showData["add_show_duration"]); @@ -194,7 +195,7 @@ class Application_Service_ScheduleService $this->service_show->createShowHosts($showData, $showId); //create ccShowInstances - $this->service_showInstances->createShowInstances($showId); + $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast); } } diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 2b4d9a5f8..8c927d958 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -16,9 +16,9 @@ class Application_Service_ShowInstanceService /** * * Receives a cc_show id and determines whether to create a - * single show_instance or repeating show instances + * single show instance or repeating show instances */ - public function createShowInstances($showId) + public function delegateShowInstanceCreation($showId, $isRebroadcast) { $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); @@ -26,31 +26,32 @@ class Application_Service_ShowInstanceService foreach ($showDays as $day) { switch ($day["repeat_type"]) { case self::NO_REPEAT: - $this->createNonRepeatingShowInstance($day, $populateUntil); + $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast); break; case self::REPEAT_WEEKLY: - $this->createRepeatingShowInstances($day, $populateUntil, "P7D"); + $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast); break; case self::REPEAT_BI_WEEKLY: - $this->createRepeatingShowInstances($day, $populateUntil, "P14D"); + $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast); break; case self::REPEAT_MONTHLY_MONTHLY: - $this->createRepeatingShowInstances($day, $populateUntil, "P1M"); + $this->createMonthlyRepeatingShowInstances($day, $populateUntil, "P1M", $isRebroadcast); break; case self::REPEAT_MONTHLY_WEEKLY: // do something here break; } } + Application_Model_RabbitMq::PushSchedule(); } /** * - * Enter description here ... + * Sets a single cc_show_instance table row * @param $showDay * @param $populateUntil */ - private function createNonRepeatingShowInstance($showDay, $populateUntil) + private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast) { $start = $showDay["first_show"]." ".$showDay["start_time"]; @@ -58,16 +59,82 @@ class Application_Service_ShowInstanceService $start, $showDay["duration"], $showDay["timezone"]); if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { - $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); - $ccShowInstance = new CcShowInstances(); - if ($ccShowInstance->getTimestamp() > $currentUtcTimestamp) { - $ccShowInstance->setDbShowId($showDay["show_id"]); + $ccShowInstance->setDbShowId($showDay["show_id"]); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($showDay["record"]); + $ccShowInstance->save(); + + if ($isRebroadcast) { + self::createRebroadcastShowInstances($showDay, $start, $ccShowInstance->getDbId()); + } + } + } + + /** + * + * Sets multiple cc_show_instances table rows + * @param unknown_type $showDay + * @param unknown_type $populateUntil + * @param unknown_type $repeatInterval + * @param unknown_type $isRebroadcast + */ + private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, + $repeatInterval, $isRebroadcast) + { + $show_id = $showDay["show_id"]; + $next_pop_date = $showDay["next_pop_date"]; + $first_show = $showDay["first_show"]; //non-UTC + $last_show = $showDay["last_show"]; //non-UTC + $start_time = $showDay["start_time"]; //non-UTC + $duration = $showDay["duration"]; + $day = $showDay["day"]; + $record = $showDay["record"]; + $timezone = $showDay["timezone"]; + + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + + if (isset($next_pop_date)) { + $start = $next_pop_date." ".$start_time; + } else { + $start = $first_show." ".$start_time; + } + + /* + * Create a DatePeriod object in the user's local time + * It will get converted to UTC right before the show instance + * gets created + */ + $period = new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), + new DateInterval($repeatInterval), $populateUntil); + + $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); + //convert $last_show into a UTC DateTime object, or null if there is no last show. + $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + + foreach ($period as $date) { + /* + * Make sure start date is less than populate until date AND + * last show date is null OR start date is less than last show date + */ + if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && + is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) { + + list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( + $date->format("Y-m-d H:i:s"), $duration, $timezone); + + $ccShowInstance = new CcShowInstances(); + $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord($showDay["record"]); + $ccShowInstance->setDbRecord($record); $ccShowInstance->save(); } + + if ($isRebroadcast) { + self::createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); + } } } @@ -75,11 +142,39 @@ class Application_Service_ShowInstanceService * * Enter description here ... * @param $showDay - * @param $populateUntil - * @param $repeatInterval */ - private function createRepeatingShowInstances($showDay, $populateUntil, $repeatInterval) + private function createRebroadcastShowInstances($showDay, $showStartDate, $instanceId) { - Logging::info("repeating"); + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + $showId = $showDay["show_id"]; + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, + array( ':show_id' => $showId ), 'all'); + + foreach ($rebroadcasts as $rebroadcast) { + $days = explode(" ", $rebroadcast["day_offset"]); + $time = explode(":", $rebroadcast["start_time"]); + $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); + + list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( + $showStartDate, $showDay["duration"], $showDay["timezone"], $offset); + + if ($utcStartDateTime->format("Y-m-d H:i:s") > $currentUtcTimestamp) { + $ccShowInstance = new CcShowInstances(); + $ccShowInstance->setDbShowId($showId); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord(0); + $ccShowInstance->setDbRebroadcast(1); + $ccShowInstance->setDbOriginalShow($instanceId); + $ccShowInstance->save(); + } + } + } + + private function deleteRebroadcastShowInstances() + { + } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index f69d42e42..05eb309af 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -6,7 +6,7 @@ class Application_Service_ShowService /** * - * Enter description here ... + * Sets the fields for a cc_show table row * @param $ccShow * @param $showData */ @@ -29,7 +29,7 @@ class Application_Service_ShowService /** * - * Enter description here ... + * Sets the fields for a cc_show_days table row * @param $showData * @param $showId * @param $userId @@ -107,7 +107,7 @@ class Application_Service_ShowService /** * - * Enter description here ... + * Sets the fields for a cc_show_rebroadcast table row * @param $showData * @param $showId * @param $repeatType @@ -144,7 +144,7 @@ class Application_Service_ShowService /** * - * Enter description here ... + * Sets the fields for a cc_show_hosts table row * @param $showData * @param $showId */ From 9be6b82d97385f978b7420ea01e08b4926082e26 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 12:06:45 -0500 Subject: [PATCH 014/128] Fixed rebroadcast date bug --- .../application/services/ShowInstanceService.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index d0b512922..1c0cf13e7 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -103,8 +103,7 @@ class Application_Service_ShowInstanceService /* * Create a DatePeriod object in the user's local time - * It will get converted to UTC right before the show instance - * gets created + * It will get converted to UTC before the show instance gets created */ $period = new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), new DateInterval($repeatInterval), $populateUntil); @@ -114,6 +113,8 @@ class Application_Service_ShowInstanceService $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; foreach ($period as $date) { + list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( + $date->format("Y-m-d H:i:s"), $duration, $timezone); /* * Make sure start date is less than populate until date AND * last show date is null OR start date is less than last show date @@ -121,19 +122,16 @@ class Application_Service_ShowInstanceService if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) { - list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $date->format("Y-m-d H:i:s"), $duration, $timezone); - $ccShowInstance = new CcShowInstances(); $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); $ccShowInstance->setDbRecord($record); $ccShowInstance->save(); - } - if ($isRebroadcast) { - self::createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); + if ($isRebroadcast) { + self::createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); + } } } } From 5111f7449487a14c753c033ec262afcbdf2dffb1 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 12:17:55 -0500 Subject: [PATCH 015/128] Created function to set the next populate until date for repeating shows --- .../application/services/ShowInstanceService.php | 1 + airtime_mvc/application/services/ShowService.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 1c0cf13e7..1e1eeb0f4 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -134,6 +134,7 @@ class Application_Service_ShowInstanceService } } } + $this->service_show->setNextPopulateUntilDate($nextDate, $show_id, $day); } /** diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 05eb309af..13605963d 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -226,4 +226,17 @@ class Application_Service_ShowService return array($startDateTime, $endDateTime); } + + public function setNextPopulateUntilDate($nextDate, $showId, $day) + { + $nextInfo = explode(" ", $nextDate); + + $repeatInfo = CcShowDaysQuery::create() + ->filterByDbShowId($showId) + ->filterByDbDay($day) + ->findOne(); + + $repeatInfo->setDbNextPopDate($nextInfo[0]) + ->save(); + } } \ No newline at end of file From 8415dfdf6f4a399d7ac2fb5057752667290759e0 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 12:18:24 -0500 Subject: [PATCH 016/128] Add comments --- airtime_mvc/application/models/Show.php | 26 ++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 23cc4d02e..cb553c1dd 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1170,6 +1170,7 @@ SQL; if ($data['add_show_id'] != -1) { $show = new Application_Model_Show($showId); + //CC-4150 CULPRIT $show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType); } @@ -1310,8 +1311,8 @@ SQL; } } - /*Application_Model_Show::populateShowUntil($showId);*/ - Application_Model_RabbitMq::PushSchedule(); + /*Application_Model_Show::populateShowUntil($showId); + Application_Model_RabbitMq::PushSchedule();*/ return $showId; } @@ -1384,7 +1385,7 @@ SQL; */ private static function populateNonRepeatingShow($p_showRow, $p_populateUntilDateTime) { - $show_id = $p_showRow["show_id"]; + /*$show_id = $p_showRow["show_id"]; $first_show = $p_showRow["first_show"]; //non-UTC $start_time = $p_showRow["start_time"]; //non-UTC $duration = $p_showRow["duration"]; @@ -1395,16 +1396,16 @@ SQL; //start & end UTC DateTimes for the show. list($utcStartDateTime, $utcEndDateTime) = Application_Model_Show::createUTCStartEndDateTime($start, $duration, $timezone); if ($utcStartDateTime->getTimestamp() < $p_populateUntilDateTime->getTimestamp()) { - $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + $currentUtcTimestamp = gmdate("Y-m-d H:i:s");*/ $show = new Application_Model_Show($show_id); if ($show->hasInstance()) { $ccShowInstance = $show->getInstance(); $newInstance = false; - } else { + } /*else { $ccShowInstance = new CcShowInstances(); $newInstance = true; - } + }*/ if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { $ccShowInstance->setDbShowId($show_id); @@ -1421,15 +1422,16 @@ SQL; $showInstance->correctScheduleStartTimes(); } - $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + /*$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, - array( ':show_id' => $show_id ), 'all'); + array( ':show_id' => $show_id ), 'all');*/ if ($showInstance->isRecorded()) { + //only do this for editing $showInstance->deleteRebroadcasts(); self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); } - } + /*}*/ } /** @@ -1446,7 +1448,7 @@ SQL; */ private static function populateRepeatingShow($p_showDaysRow, $p_populateUntilDateTime, $p_interval) { - $show_id = $p_showDaysRow["show_id"]; + /*$show_id = $p_showDaysRow["show_id"]; $next_pop_date = $p_showDaysRow["next_pop_date"]; $first_show = $p_showDaysRow["first_show"]; //non-UTC $last_show = $p_showDaysRow["last_show"]; //non-UTC @@ -1466,7 +1468,7 @@ SQL; $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); //convert $last_show into a UTC DateTime object, or null if there is no last show. - $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;*/ $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; @@ -1480,6 +1482,8 @@ SQL; list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone); + //determine if we are adding a new show + //or editing a show if ($show->hasInstanceOnDate($utcStartDateTime)) { $ccShowInstance = $show->getInstanceOnDate($utcStartDateTime); From d8ced29dd04e3e348d46fb9b372fd765800c0108 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 16:08:43 -0500 Subject: [PATCH 017/128] Refactored adding show forms to the view --- .../controllers/ScheduleController.php | 57 +++++++++++-------- .../services/ShowInstanceService.php | 40 +++++++++---- .../application/services/ShowService.php | 13 ++++- 3 files changed, 73 insertions(+), 37 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index ea95d4bc7..50408ff85 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -94,20 +94,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']); //End Show builder JS/CSS requirements - $forms = $this->service_schedule->createShowForms(); - // populate forms with default values - $this->service_schedule->populateNewShowForms( - $forms["what"], $forms["when"], $forms["repeats"]); - - $this->view->what = $forms["what"]; - $this->view->when = $forms["when"]; - $this->view->repeats = $forms["repeats"]; - $this->view->live = $forms["live"]; - $this->view->rr = $forms["record"]; - $this->view->absoluteRebroadcast = $forms["abs_rebroadcast"]; - $this->view->rebroadcast = $forms["rebroadcast"]; - $this->view->who = $forms["who"]; - $this->view->style = $forms["style"]; + $this->createShowFormAction(true); $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { @@ -746,7 +733,8 @@ class ScheduleController extends Zend_Controller_Action $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - Application_Model_Schedule::createNewFormSections($this->view); + //Application_Model_Schedule::createNewFormSections($this->view); + $this->createShowFormAction(true); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } } @@ -879,8 +867,32 @@ class ScheduleController extends Zend_Controller_Action $data['add_show_day_check'] = null; } + $forms = $this->createShowFormAction(); + + $this->view->addNewShow = true; + + if ($this->service_schedule->validateShowForms($forms, $data)) { + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); + $this->service_schedule->createShow($data); + + //send new show forms to the user + $this->createShowFormAction(true); + Logging::debug("Show creation succeeded"); + } else { + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + Logging::debug("Show creation failed"); + } + } + + public function createShowFormAction($populate=false) + { $forms = $this->service_schedule->createShowForms(); + // populate forms with default values + if ($populate) { + $this->populateNewShowFormsAction($forms); + } + $this->view->what = $forms["what"]; $this->view->when = $forms["when"]; $this->view->repeats = $forms["repeats"]; @@ -891,16 +903,13 @@ class ScheduleController extends Zend_Controller_Action $this->view->who = $forms["who"]; $this->view->style = $forms["style"]; - $this->view->addNewShow = true; + return $forms; + } - if ($this->service_schedule->validateShowForms($forms, $data)) { - $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); - $this->service_schedule->createShow($data); - Logging::debug("Show creation succeeded"); - } else { - $this->view->form = $this->view->render('schedule/add-show-form.phtml'); - Logging::debug("Show creation failed"); - } + public function populateNewShowFormsAction($forms) + { + $this->service_schedule->populateNewShowForms( + $forms["what"], $forms["when"], $forms["repeats"]); } public function cancelShowAction() diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 1e1eeb0f4..09d70e9c3 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -67,7 +67,7 @@ class Application_Service_ShowInstanceService $ccShowInstance->save(); if ($isRebroadcast) { - self::createRebroadcastShowInstances($showDay, $start, $ccShowInstance->getDbId()); + $this->createRebroadcastShowInstances($showDay, $start, $ccShowInstance->getDbId()); } } } @@ -101,17 +101,14 @@ class Application_Service_ShowInstanceService $start = $first_show." ".$start_time; } - /* - * Create a DatePeriod object in the user's local time - * It will get converted to UTC before the show instance gets created - */ - $period = new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), - new DateInterval($repeatInterval), $populateUntil); + $period = $this->getDatePeriod($start, $timezone, $last_show, + $repeatInterval, $populateUntil); $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); - //convert $last_show into a UTC DateTime object, or null if there is no last show. - $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + $utcLastShowDateTime = $last_show ? + Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + $utcEndDateTime = null; foreach ($period as $date) { list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( $date->format("Y-m-d H:i:s"), $duration, $timezone); @@ -120,7 +117,8 @@ class Application_Service_ShowInstanceService * last show date is null OR start date is less than last show date */ if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && - is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) { + ( is_null($utcLastShowDateTime) || + $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { $ccShowInstance = new CcShowInstances(); $ccShowInstance->setDbShowId($show_id); @@ -130,11 +128,12 @@ class Application_Service_ShowInstanceService $ccShowInstance->save(); if ($isRebroadcast) { - self::createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); + $this->createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); } } } - $this->service_show->setNextPopulateUntilDate($nextDate, $show_id, $day); + $nextDate = $utcEndDateTime->add(new DateInterval($repeatInterval)); + $this->service_show->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $show_id, $day); } /** @@ -176,4 +175,21 @@ class Application_Service_ShowInstanceService { } + + /** + * + * Create a DatePeriod object in the user's local time + * It will get converted to UTC before the show instance gets created + */ + private function getDatePeriod($start, $timezone, $lastShow, $repeatInterval, $populateUntil) + { + if (isset($lastShow)) { + $endDatePeriod = new DateTime($lastShow, new DateTimeZone($timezone)); + } else { + $endDatePeriod = $populateUntil; + } + + return new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), + new DateInterval($repeatInterval), $endDatePeriod); + } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 13605963d..d8a8e3b1f 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -227,7 +227,18 @@ class Application_Service_ShowService return array($startDateTime, $endDateTime); } - public function setNextPopulateUntilDate($nextDate, $showId, $day) + /** + * + * Show instances for repeating shows only get created up + * until what is visible on the calendar. We need to set the + * date for when the next repeating show instance should be created + * as the user browses the calendar further. + * + * @param $nextDate + * @param $showId + * @param $day + */ + public function setNextRepeatingShowDate($nextDate, $showId, $day) { $nextInfo = explode(" ", $nextDate); From 116d98a81b044c8e1e1e90c7e6f973a30cb79334 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 16:10:07 -0500 Subject: [PATCH 018/128] Removed comment --- airtime_mvc/application/controllers/ScheduleController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 50408ff85..abcc38d04 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -733,7 +733,6 @@ class ScheduleController extends Zend_Controller_Action $user = Application_Model_User::getCurrentUser(); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - //Application_Model_Schedule::createNewFormSections($this->view); $this->createShowFormAction(true); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } From 1cc823ef0ea34af5602283e255b26056ff735325 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 8 Mar 2013 17:10:35 -0500 Subject: [PATCH 019/128] Inital edit show reconfiguration changes --- .../controllers/ScheduleController.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index abcc38d04..a4f356cee 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -779,7 +779,6 @@ class ScheduleController extends Zend_Controller_Action public function editShowAction() { - //1) Get add_show_start_date since it might not have been sent $js = $this->_getParam('data'); $data = array(); @@ -788,6 +787,7 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } + //TODO: move this to js $data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_day_check'] = $this->_getParam('days'); @@ -795,9 +795,10 @@ class ScheduleController extends Zend_Controller_Action $data['add_show_day_check'] = null; } - $show = new Application_Model_Show($data['add_show_id']); + /*$show = new Application_Model_Show($data['add_show_id']);*/ - $validateStartDate = true; + //------- PRE EDIT SHOW CHECK ---------------// + /*$validateStartDate = true; $validateStartTime = true; if (!array_key_exists('add_show_start_date', $data)) { //Changing the start date was disabled, since the @@ -812,15 +813,18 @@ class ScheduleController extends Zend_Controller_Action } $validateStartDate = false; } - $data['add_show_record'] = $show->isRecorded(); + $data['add_show_record'] = $show->isRecorded();*/ + // -------------------------------------------// - if ($show->isRepeating()) { + //-------- ADJUST ORIGINAL START DATE -------// + /*if ($show->isRepeating()) { $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; } else { $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( $show->getStartDateAndTime()); - } + }*/ + //-----------------------------------------// $success = Application_Model_Schedule::addUpdateShow($data, $this, $validateStartDate, $originalShowStartDateTime, true, @@ -871,11 +875,12 @@ class ScheduleController extends Zend_Controller_Action $this->view->addNewShow = true; if ($this->service_schedule->validateShowForms($forms, $data)) { - $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); $this->service_schedule->createShow($data); + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); //send new show forms to the user $this->createShowFormAction(true); + Logging::debug("Show creation succeeded"); } else { $this->view->form = $this->view->render('schedule/add-show-form.phtml'); From 7347be35b12e57d9aea4e58e49e2523361c13db8 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 11 Mar 2013 16:18:40 -0400 Subject: [PATCH 020/128] Created a new service for show days Created a new user service Started refactoring edit show action --- .../controllers/ScheduleController.php | 38 +----- airtime_mvc/application/forms/AddShowWhen.php | 6 +- .../application/models/airtime/CcSubjs.php | 4 + .../application/services/ScheduleService.php | 86 ++++++++++-- .../application/services/ShowDaysService.php | 125 ++++++++++++++++++ .../services/ShowInstanceService.php | 39 +++++- .../application/services/ShowService.php | 92 ------------- .../application/services/UserService.php | 33 +++++ 8 files changed, 286 insertions(+), 137 deletions(-) create mode 100644 airtime_mvc/application/services/ShowDaysService.php create mode 100644 airtime_mvc/application/services/UserService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index a4f356cee..f297537e6 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -795,42 +795,14 @@ class ScheduleController extends Zend_Controller_Action $data['add_show_day_check'] = null; } - /*$show = new Application_Model_Show($data['add_show_id']);*/ + $forms = $this->createShowFormAction(); - //------- PRE EDIT SHOW CHECK ---------------// - /*$validateStartDate = true; - $validateStartTime = true; - if (!array_key_exists('add_show_start_date', $data)) { - //Changing the start date was disabled, since the - //array key does not exist. We need to repopulate this entry from the db. - //The start date will be returned in UTC time, so lets convert it to local time. - $dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDateAndTime()); - $data['add_show_start_date'] = $dt->format("Y-m-d"); + list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) = + $this->service_schedule->preEditShowValidationCheck($data); - if (!array_key_exists('add_show_start_time', $data)) { - $data['add_show_start_time'] = $dt->format("H:i"); - $validateStartTime = false; - } - $validateStartDate = false; - } - $data['add_show_record'] = $show->isRecorded();*/ - // -------------------------------------------// + if ($this->service_schedule->validateShowForms($forms, $data, $validateStartDate, + $originalShowStartDateTime, true, $data["add_show_instance_id"])) { - //-------- ADJUST ORIGINAL START DATE -------// - /*if ($show->isRepeating()) { - $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); - $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; - } else { - $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( - $show->getStartDateAndTime()); - }*/ - //-----------------------------------------// - - $success = Application_Model_Schedule::addUpdateShow($data, $this, - $validateStartDate, $originalShowStartDateTime, true, - $data['add_show_instance_id']); - - if ($success) { $scheduler = new Application_Model_Scheduler(); $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); foreach ($showInstances as $si) { diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 9f73affbd..ae9ffe5e3 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -87,9 +87,11 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm } - public function isWhenFormValid($formData, $validateStartDate) { + public function isWhenFormValid($formData, $validateStartDate, $originalStartDate, + $update, $instanceId) { if (parent::isValid($formData)) { - return self::checkReliantFields($formData, $validateStartDate); + return self::checkReliantFields($formData, $validateStartDate, + $originalStartDate, $update, $instanceId); } else { return false; } diff --git a/airtime_mvc/application/models/airtime/CcSubjs.php b/airtime_mvc/application/models/airtime/CcSubjs.php index e5fca5e27..c274e35c4 100644 --- a/airtime_mvc/application/models/airtime/CcSubjs.php +++ b/airtime_mvc/application/models/airtime/CcSubjs.php @@ -15,4 +15,8 @@ */ class CcSubjs extends BaseCcSubjs { + public function isAdminOrPM() + { + return $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER; + } } // CcSubjs diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 77ef24d4e..4450f850b 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -3,12 +3,15 @@ class Application_Service_ScheduleService { private $service_show; + private $service_showDays; private $service_showInstances; + private $service_user; public function __construct() { $this->service_show = new Application_Service_ShowService(); $this->service_showInstances = new Application_Service_ShowInstanceService(); + $this->service_user = new Application_Service_UserService(); } /* * Form stuff begins here @@ -89,14 +92,16 @@ class Application_Service_ScheduleService * * @return boolean */ - public function validateShowForms($forms, $formData, $validateStartDate = true) + public function validateShowForms($forms, $formData, $validateStartDate = true, + $originalStartDate=null, $editShow=false, $instanceId=null) { $what = $forms["what"]->isValid($formData); $live = $forms["live"]->isValid($formData); $record = $forms["record"]->isValid($formData); $who = $forms["who"]->isValid($formData); $style = $forms["style"]->isValid($formData); - $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate); + $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate, + $originalStartDate, $editShow, $instanceId); $repeats = true; if ($formData["add_show_repeats"]) { @@ -163,13 +168,18 @@ class Application_Service_ScheduleService /** * - * Creates a new show if form data is valid + * Creates a new show, which entails creating entries in + * the following tables: + * cc_show + * cc_show_days + * cc_show_hosts + * cc_show_rebroadcast + * cc_show_instances */ public function createShow($showData) { - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + //CcSubj object + $currentUser = $this->service_user->getCurrentUser(); $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; @@ -178,15 +188,16 @@ class Application_Service_ScheduleService $showData["add_show_duration"] = $this->formatShowDuration( $showData["add_show_duration"]); - if ($isAdminOrPM) { + if ($currentUser->isAdminOrPM()) { //create ccShow $ccShow = new CcShow(); $ccShow = $this->service_show->setShow($ccShow, $showData); $showId = $ccShow->getDbId(); //create ccShowDays - $this->service_show->createShowDays( - $showData, $showId, $user->getId(), $repeatType, $isRecorded); + $this->service_showDays = new Application_Service_ShowDaysService($showId); + $this->service_showDays->createShowDays( + $showData, $currentUser->getDbId(), $repeatType, $isRecorded); //create ccShowRebroadcasts $this->service_show->createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); @@ -199,4 +210,61 @@ class Application_Service_ScheduleService } } + public function editShow($formData) + { + //CcSubj object + $currentUser = $this->service_user->getCurrentUser(); + } + + /** + * + * Before we send the form data in for validation, there + * are a few fields we may need to adjust first + * @param $formData + */ + public function preEditShowValidationCheck($formData) { + $validateStartDate = true; + $validateStartTime = true; + $this->service_showDays = new Application_Service_ShowDaysService( + $formData["add_show_id"]); + + //CcShowDays object of the show currently being edited + $currentShowDay = $this->service_showDays->getCurrentShowDay(); + + if (!array_key_exists('add_show_start_date', $formData)) { + //Changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + //The start date will be returned in UTC time, so lets convert it to local time. + $dt = Application_Common_DateHelper::ConvertToLocalDateTime( + $this->service_showDays->getStartDateAndTime()); + $formData['add_show_start_date'] = $dt->format("Y-m-d"); + + if (!array_key_exists('add_show_start_time', $formData)) { + $formData['add_show_start_time'] = $dt->format("H:i"); + $validateStartTime = false; + } + $validateStartDate = false; + } + $formData['add_show_record'] = $currentShowDay->getDbRecord(); + + //if the show is repeating, set the start date to the next + //repeating instance in the future + if ($currentShowDay->getDbRepeatType() != -1) { + $nextFutureRepeatShow = $this->service_showInstances + ->getNextFutureRepeatShowTime($formData["add_show_id"]); + $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; + } else { + $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( + $this->service_showDays->getStartDateAndTime()); + } + + return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); + } + + public function editShow($showData) + { + //CcSubj object + $currentUser = $this->service_user->getCurrentUser(); + } + } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php new file mode 100644 index 000000000..2b16b6287 --- /dev/null +++ b/airtime_mvc/application/services/ShowDaysService.php @@ -0,0 +1,125 @@ +showId = $id; + } + /** + * + * Sets the fields for a cc_show_days table row + * @param $showData + * @param $showId + * @param $userId + * @param $repeatType + * @param $isRecorded + */ + public function createShowDays($showData, $userId, $repeatType, $isRecorded) + { + $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); + + if ($showData['add_show_no_end']) { + $endDate = NULL; + } elseif ($showData['add_show_repeats']) { + $endDateTime = new DateTime($showData['add_show_end_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($showData['add_show_start_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + /* What we are doing here is checking if the show repeats or if + * any repeating days have been checked. If not, then by default + * the "selected" DOW is the initial day. + * DOW in local time. + */ + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$showData['add_show_repeats']) { + $showData['add_show_day_check'] = array($startDow); + } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { + $showData['add_show_day_check'] = array($startDow); + } + + // Don't set day for monthly repeat type, it's invalid + if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($this->showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($showData['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($this->showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } + } + + /** + * + * Gets the cc_show_days entries for a specific show + * + * @return array of ccShowDays objects + */ + public function getShowDays() + { + $sql = "SELECT * FROM cc_show_days WHERE show_id = :show_id"; + + return Application_Common_Database::prepareAndExecute( + $sql, array(":show_id" => $this->showId), 'all'); + } + + public function getStartDateAndTime() + { + //CcShowDays object + $showDay = $this->getCurrentShowDay(); + + $dt = new DateTime($showDay->getDbFirstShow()." ".$showDay->getDbStartTime(), + new DateTimeZone($showDay->getDbTimezone())); + $dt->setTimezone(new DateTimeZone("UTC")); + + return $dt->format("Y-m-d H:i"); + } + + /** + * + * Returns a CcShowDays object of the show that + * is currently being edited. + */ + public function getCurrentShowDay() + { + return CcShowDaysQuery::create()->filterByDbShowId($this->showId) + ->findOne(); + } +} \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 09d70e9c3..b23c3e32a 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -2,6 +2,9 @@ class Application_Service_ShowInstanceService { private $service_show; + private $service_showDays; + private $service_user; + const NO_REPEAT = -1; const REPEAT_WEEKLY = 0; const REPEAT_BI_WEEKLY = 1; @@ -11,6 +14,7 @@ class Application_Service_ShowInstanceService public function __construct() { $this->service_show = new Application_Service_ShowService(); + $this->service_user = new Application_Service_UserService(); } /** @@ -22,7 +26,9 @@ class Application_Service_ShowInstanceService { $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); - $showDays = $this->service_show->getShowDays($showId); + $this->service_showDays = new Application_Service_ShowDaysService($showId); + $showDays = $this->service_showDays->getShowDays(); + foreach ($showDays as $day) { switch ($day["repeat_type"]) { case self::NO_REPEAT: @@ -192,4 +198,35 @@ class Application_Service_ShowInstanceService return new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), new DateInterval($repeatInterval), $endDatePeriod); } + + /** + * + * Returns 2 DateTime objects, in the user's local time, + * of the next future repeat show instance start and end time + */ + public function getNextFutureRepeatShowTime($showId) + { + $sql = << now() at time zone 'UTC' +AND show_id = :showId +ORDER BY starts +LIMIT 1 +SQL; + $result = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $showId ), 'all' ); + + foreach ($result as $r) { + $show["starts"] = new DateTime($r["starts"], new DateTimeZone('UTC')); + $show["ends"] = new DateTime($r["ends"], new DateTimeZone('UTC')); + } + + $userTimezone = Application_Model_Preference::GetUserTimezone( + $this->service_user->getCurrentUser()->getDbId()); + + $show["starts"]->setTimezone(new DateTimeZone($userTimezone)); + $show["ends"]->setTimezone(new DateTimeZone($userTimezone)); + + return $show; + } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index d8a8e3b1f..9669d2086 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -27,84 +27,6 @@ class Application_Service_ShowService return $ccShow; } - /** - * - * Sets the fields for a cc_show_days table row - * @param $showData - * @param $showId - * @param $userId - * @param $repeatType - * @param $isRecorded - */ - public function createShowDays($showData, $showId, $userId, $repeatType, $isRecorded) - { - $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); - - if ($showData['add_show_no_end']) { - $endDate = NULL; - } elseif ($showData['add_show_repeats']) { - $endDateTime = new DateTime($showData['add_show_end_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); - } else { - $endDateTime = new DateTime($showData['add_show_start_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); - } - - /* What we are doing here is checking if the show repeats or if - * any repeating days have been checked. If not, then by default - * the "selected" DOW is the initial day. - * DOW in local time. - */ - $startDow = date("w", $startDateTime->getTimestamp()); - if (!$showData['add_show_repeats']) { - $showData['add_show_day_check'] = array($startDow); - } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { - $showData['add_show_day_check'] = array($startDow); - } - - // Don't set day for monthly repeat type, it's invalid - if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { - $showDay = new CcShowDays(); - $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); - $showDay->setDbLastShow($endDate); - $showDay->setDbStartTime($startDateTime->format("H:i:s")); - $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); - $showDay->setDbDuration($showData['add_show_duration']); - $showDay->setDbRepeatType($repeatType); - $showDay->setDbShowId($showId); - $showDay->setDbRecord($isRecorded); - $showDay->save(); - } else { - foreach ($showData['add_show_day_check'] as $day) { - $daysAdd=0; - $startDateTimeClone = clone $startDateTime; - if ($startDow !== $day) { - if ($startDow > $day) - $daysAdd = 6 - $startDow + 1 + $day; - else - $daysAdd = $day - $startDow; - - $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); - } - if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { - $showDay = new CcShowDays(); - $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); - $showDay->setDbLastShow($endDate); - $showDay->setDbStartTime($startDateTimeClone->format("H:i")); - $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); - $showDay->setDbDuration($showData['add_show_duration']); - $showDay->setDbDay($day); - $showDay->setDbRepeatType($repeatType); - $showDay->setDbShowId($showId); - $showDay->setDbRecord($isRecorded); - $showDay->save(); - } - } - } - } - /** * * Sets the fields for a cc_show_rebroadcast table row @@ -178,20 +100,6 @@ class Application_Service_ShowService return $populateUntil; } - /** - * - * Gets the cc_show_days entries for a specific show - * - * @return array of ccShowDays objects - */ - public function getShowDays($showId) - { - $sql = "SELECT * FROM cc_show_days WHERE show_id = :show_id"; - - return Application_Common_Database::prepareAndExecute( - $sql, array(":show_id" => $showId), 'all'); - } - /** * * Enter description here ... diff --git a/airtime_mvc/application/services/UserService.php b/airtime_mvc/application/services/UserService.php new file mode 100644 index 000000000..879ba4d48 --- /dev/null +++ b/airtime_mvc/application/services/UserService.php @@ -0,0 +1,33 @@ +getStorage()->read(); + if (!is_null($userInfo->id)) { + $this->currentUser = CcSubjsQuery::create()->findPK($userInfo->id); + } + } + + /** + * + * Returns a CcSubjs object + */ + public function getCurrentUser() + { + if (is_null($this->currentUser)) { + throw new Exception(); + } + + return $this->currentUser; + } + +} \ No newline at end of file From c721b81a13d8d5379603f157e9ba5c6699c788b6 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 12 Mar 2013 10:30:31 -0400 Subject: [PATCH 021/128] CC-4961: Show linking Refactoring --- .../controllers/ScheduleController.php | 2 ++ airtime_mvc/application/models/Show.php | 7 +++-- .../application/services/ScheduleService.php | 28 +++++++++++-------- .../application/services/ShowDaysService.php | 2 +- .../application/services/ShowService.php | 12 ++++++-- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index f297537e6..bc56fd993 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -803,6 +803,8 @@ class ScheduleController extends Zend_Controller_Action if ($this->service_schedule->validateShowForms($forms, $data, $validateStartDate, $originalShowStartDateTime, true, $data["add_show_instance_id"])) { + $this->service_schedule->editShow($data); + $scheduler = new Application_Model_Scheduler(); $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); foreach ($showInstances as $si) { diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index cb553c1dd..17ee99bb2 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1147,11 +1147,12 @@ SQL; //find repeat type or set to a non repeating show. /*$repeatType = ($data['add_show_repeats']) ? $data['add_show_repeat_type'] : -1;*/ - if ($data['add_show_id'] == -1) { - /*$ccShow = new CcShow();*/ + /*if ($data['add_show_id'] == -1) { + $ccShow = new CcShow(); } else { $ccShow = CcShowQuery::create()->findPK($data['add_show_id']); - } + }*/ + /*$ccShow->setDbName($data['add_show_name']); $ccShow->setDbDescription($data['add_show_description']); $ccShow->setDbUrl($data['add_show_url']); diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 4450f850b..bf649212d 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -190,30 +190,40 @@ class Application_Service_ScheduleService if ($currentUser->isAdminOrPM()) { //create ccShow - $ccShow = new CcShow(); - $ccShow = $this->service_show->setShow($ccShow, $showData); + $ccShow = $this->service_show->setShow($showData, true); $showId = $ccShow->getDbId(); //create ccShowDays $this->service_showDays = new Application_Service_ShowDaysService($showId); - $this->service_showDays->createShowDays( + $this->service_showDays->setShowDays( $showData, $currentUser->getDbId(), $repeatType, $isRecorded); //create ccShowRebroadcasts - $this->service_show->createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); + $this->service_show->setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); //create ccShowHosts - $this->service_show->createShowHosts($showData, $showId); + $this->service_show->setShowHosts($showData, $showId); //create ccShowInstances $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast); } } - public function editShow($formData) + public function editShow($showData) { //CcSubj object $currentUser = $this->service_user->getCurrentUser(); + + $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + if ($currentUser->isAdminOrPM()) { + $ccShow = $this->service_show->setShow($showData, false); + } } /** @@ -261,10 +271,4 @@ class Application_Service_ScheduleService return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); } - public function editShow($showData) - { - //CcSubj object - $currentUser = $this->service_user->getCurrentUser(); - } - } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php index 2b16b6287..9876fdce5 100644 --- a/airtime_mvc/application/services/ShowDaysService.php +++ b/airtime_mvc/application/services/ShowDaysService.php @@ -17,7 +17,7 @@ class Application_Service_ShowDaysService * @param $repeatType * @param $isRecorded */ - public function createShowDays($showData, $userId, $repeatType, $isRecorded) + public function setShowDays($showData, $userId, $repeatType, $isRecorded) { $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 9669d2086..e858809c8 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -10,8 +10,14 @@ class Application_Service_ShowService * @param $ccShow * @param $showData */ - public function setShow($ccShow, $showData) + public function setShow($showData, $isNewShow) { + if ($isNewShow) { + $ccShow = new CcShow(); + } else { + $ccShow = CcShowQuery::create()->findPk($showData["add_show_id"]); + } + $ccShow->setDbName($showData['add_show_name']); $ccShow->setDbDescription($showData['add_show_description']); $ccShow->setDbUrl($showData['add_show_url']); @@ -35,7 +41,7 @@ class Application_Service_ShowService * @param $repeatType * @param $isRecorded */ - public function createShowRebroadcasts($showData, $showId, $repeatType, $isRecorded) + public function setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded) { if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { @@ -70,7 +76,7 @@ class Application_Service_ShowService * @param $showData * @param $showId */ - public function createShowHosts($showData, $showId) + public function setShowHosts($showData, $showId) { if (is_array($showData['add_show_hosts'])) { foreach ($showData['add_show_hosts'] as $host) { From 438200425a31200b9946c758f414fe7aede863a5 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 12 Mar 2013 11:33:32 -0400 Subject: [PATCH 022/128] CC-4961: Show linking --- .../services/ShowInstanceService.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index b23c3e32a..fcf9a6cfa 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -1,16 +1,16 @@ -service_show = new Application_Service_ShowService(); @@ -31,19 +31,19 @@ class Application_Service_ShowInstanceService foreach ($showDays as $day) { switch ($day["repeat_type"]) { - case self::NO_REPEAT: + case NO_REPEAT: $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast); break; - case self::REPEAT_WEEKLY: + case REPEAT_WEEKLY: $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast); break; - case self::REPEAT_BI_WEEKLY: + case REPEAT_BI_WEEKLY: $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast); break; - case self::REPEAT_MONTHLY_MONTHLY: + case REPEAT_MONTHLY_MONTHLY: $this->createMonthlyRepeatingShowInstances($day, $populateUntil, "P1M", $isRebroadcast); break; - case self::REPEAT_MONTHLY_WEEKLY: + case REPEAT_MONTHLY_WEEKLY: // do something here break; } From f9f4e4f1fb13114f785c6b281df0f61c5eeb4e39 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 12 Mar 2013 18:01:12 -0400 Subject: [PATCH 023/128] CC-4961: Show linking Made some progress on show editing --- .../application/models/airtime/CcShowDays.php | 25 ++ .../application/services/ScheduleService.php | 4 +- .../application/services/ShowDaysService.php | 36 ++- .../services/ShowInstanceService.php | 244 +++++++++++++++++- 4 files changed, 281 insertions(+), 28 deletions(-) diff --git a/airtime_mvc/application/models/airtime/CcShowDays.php b/airtime_mvc/application/models/airtime/CcShowDays.php index 72df6047e..7dc9d98bd 100644 --- a/airtime_mvc/application/models/airtime/CcShowDays.php +++ b/airtime_mvc/application/models/airtime/CcShowDays.php @@ -15,4 +15,29 @@ */ class CcShowDays extends BaseCcShowDays { + public function isRepeating() + { + return $this->getDbRepeatType() != -1; + } + + public function getUTCStartDateAndTime() + { + $dt = new DateTime( + "{$this->getDbFirstShow()} {$this->getDbStartTime()}", + new DateTimeZone($this->getDbTimezone()) + ); + $dt->setTimezone(new DateTimeZone("UTC")); + + return $dt; + } + + public function getLocalStartDateAndTime() + { + $dt = new DateTime( + "{$this->getDbFirstShow()} {$this->getDbStartTime()}", + new DateTimeZone($this->getDbTimezone()) + ); + + return $dt; + } } // CcShowDays diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index bf649212d..72304cdb7 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -223,6 +223,8 @@ class Application_Service_ScheduleService if ($currentUser->isAdminOrPM()) { $ccShow = $this->service_show->setShow($showData, false); + + $this->service_showInstances->updateShowInstances($showData, $isRecorded, $repeatType); } } @@ -259,7 +261,7 @@ class Application_Service_ScheduleService //if the show is repeating, set the start date to the next //repeating instance in the future - if ($currentShowDay->getDbRepeatType() != -1) { + if ($currentShowDay->isRepeating()) { $nextFutureRepeatShow = $this->service_showInstances ->getNextFutureRepeatShowTime($formData["add_show_id"]); $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php index 9876fdce5..f5cd6c906 100644 --- a/airtime_mvc/application/services/ShowDaysService.php +++ b/airtime_mvc/application/services/ShowDaysService.php @@ -8,6 +8,24 @@ class Application_Service_ShowDaysService { $this->showId = $id; } + + public function calculateEndDate($showData) + { + if ($showData['add_show_no_end']) { + $endDate = NULL; + } elseif ($showData['add_show_repeats']) { + $endDateTime = new DateTime($showData['add_show_end_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDateTime = new DateTime($showData['add_show_start_date']); + $endDateTime->add(new DateInterval("P1D")); + $endDate = $endDateTime->format("Y-m-d"); + } + + return $endDate; + } + /** * * Sets the fields for a cc_show_days table row @@ -21,17 +39,7 @@ class Application_Service_ShowDaysService { $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); - if ($showData['add_show_no_end']) { - $endDate = NULL; - } elseif ($showData['add_show_repeats']) { - $endDateTime = new DateTime($showData['add_show_end_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); - } else { - $endDateTime = new DateTime($showData['add_show_start_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); - } + $endDate = $this->calculateEndDate($showData); /* What we are doing here is checking if the show repeats or if * any repeating days have been checked. If not, then by default @@ -94,10 +102,12 @@ class Application_Service_ShowDaysService */ public function getShowDays() { - $sql = "SELECT * FROM cc_show_days WHERE show_id = :show_id"; + /*$sql = "SELECT * FROM cc_show_days WHERE show_id = :show_id"; return Application_Common_Database::prepareAndExecute( - $sql, array(":show_id" => $this->showId), 'all'); + $sql, array(":show_id" => $this->showId), 'all');*/ + return CcShowDaysQuery::create()->filterByDbShowId( + $this->showId)->find(); } public function getStartDateAndTime() diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index fcf9a6cfa..e3de1f766 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -30,7 +30,7 @@ class Application_Service_ShowInstanceService $showDays = $this->service_showDays->getShowDays(); foreach ($showDays as $day) { - switch ($day["repeat_type"]) { + switch ($day->getDbRepeatType()) { case NO_REPEAT: $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast); break; @@ -59,17 +59,17 @@ class Application_Service_ShowInstanceService */ private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast) { - $start = $showDay["first_show"]." ".$showDay["start_time"]; + $start = $showDay->getDbFirstShow()." ".$showDay->getDbStartTime(); list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $start, $showDay["duration"], $showDay["timezone"]); + $start, $showDay->getDbDuration(), $showDay->getDbTimezone()); if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { $ccShowInstance = new CcShowInstances(); - $ccShowInstance->setDbShowId($showDay["show_id"]); + $ccShowInstance->setDbShowId($showDay->getDbShowId()); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord($showDay["record"]); + $ccShowInstance->setDbRecord($showDay->getDbRecord()); $ccShowInstance->save(); if ($isRebroadcast) { @@ -89,15 +89,15 @@ class Application_Service_ShowInstanceService private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, $repeatInterval, $isRebroadcast) { - $show_id = $showDay["show_id"]; - $next_pop_date = $showDay["next_pop_date"]; - $first_show = $showDay["first_show"]; //non-UTC - $last_show = $showDay["last_show"]; //non-UTC - $start_time = $showDay["start_time"]; //non-UTC - $duration = $showDay["duration"]; - $day = $showDay["day"]; - $record = $showDay["record"]; - $timezone = $showDay["timezone"]; + $show_id = $showDay->getDbShowId(); + $next_pop_date = $showDay->getDbNextPopDate(); + $first_show = $showDay->getDbFirstShow(); //non-UTC + $last_show = $showDay->getDbLastShow(); //non-UTC + $start_time = $showDay->getDbStartTime(); //non-UTC + $duration = $showDay->getDbDuration(); + $day = $showDay->getDbDay(); + $record = $showDay->getDbRecord(); + $timezone = $showDay->getDbTimezone(); $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); @@ -229,4 +229,220 @@ SQL; return $show; } + + /** + * This function is messy. But sometimes there is no easy way to do it. + * + * When editing a show we may need to perform some actions to reflect the new specs: + * - Delete some show instances + * - Update duration + * - Update start and end time + * + * @param $showData edit show form values in raw form + * @param $isRecorded value computed from the edit show form + * @param $repeatType value computed from the edit show form + */ + public function updateShowInstances($showData, $isRecorded, $repeatType) + { + $showId = $showData["add_show_id"]; + + $this->service_showDays = new Application_Service_ShowDaysService($showId); + //ccShowDays object of the show being edited + $currentShowDay = $this->service_showDays->getCurrentShowDay(); + + $endDate = $this->service_showDays->calculateEndDate($showData); + + //repeat option was toggled + if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) { + $this->deleteAllRepeatInstances($currentShowDay, $showId); + } + + //duration has changed + if ($showData['add_show_duration'] != $currentShowDay->getDbDuration()) { + $this->updateDuration($showData); + } + + if ($showData['add_show_repeats']) { + + $localShowStart = $currentShowDay->getLocalStartDateAndTime(); + + //if the start date changes, these are the repeat types + //that require show instance deletion + $deleteRepeatTypes = array(REPEAT_BI_WEEKLY, REPEAT_MONTHLY_MONTHLY, + REPEAT_MONTHLY_WEEKLY); + + if (in_array($repeatType, $deleteRepeatTypes) && + $showData["add_show_start_date"] != $localShowStart->format("Y-m-d")) { + + //Start date has changed when repeat type is bi-weekly or monthly. + //This screws up the repeating positions of show instances, so lets + //we need to delete them (CC-2351) + $this->deleteAllInstances($showId); + } + + if ($repeatType != $currentShowDay->getDbRepeatType()) { + //repeat type changed + $this->deleteAllInstances($showId); + } else { + //repeat type is the same, check if the days of the week are the same + $repeatingDaysChanged = false; + $ccShowDays = $this->service_showDays->getShowDays(); + $showDays = array(); + foreach ($ccShowDays as $day) { + $showDays[] = $day->getDbDay(); + } + if (count($showData['add_show_day_check']) == count($showDays)) { + //same number of days checked, lets see if they are the same numbers + $intersect = array_intersect($showData['add_show_day_check'], $showDays); + if (count($intersect) != count($showData['add_show_day_check'])) { + $repeatingDaysChanged = true; + } + } else { + $repeatingDaysChanged = true; + } + + if ($repeatingDaysChanged) { + $daysRemoved = array_diff($showDays, $showData['add_show_day_check']); + + if (count($daysRemoved) > 0) { + //delete repeating show instances for the repeating + //days that were removed + $this->deleteRemovedShowDayInstances($daysRemoved, + $ccShowDays, $showId); + } + } + + if ($showData['add_show_start_date'] != $localShowStart->format("Y-m-d") + || $showData['add_show_start_time'] != $localShowStart->format("H:i:s")){ + + //start date/time has changed + if ($showData['add_show_start_date'] > $localShowStart->format("Y-m-d")) { + $this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId); + } + + /*$this->updateStartDateTime($showData, $p_endDate);*/ + } + } +/* + //Check if end date for the repeat option has changed. If so, need to take care + //of deleting possible invalid Show Instances. + if ((strlen($this->getRepeatingEndDate()) == 0) == $showData['add_show_no_end']) { + //show "Never Ends" option was toggled. + if ($showData['add_show_no_end']) { + } else { + $this->removeAllInstancesFromDate($p_endDate); + } + } + if ($this->getRepeatingEndDate() != $showData['add_show_end_date']) { + //end date was changed. + + $newDate = strtotime($showData['add_show_end_date']); + $oldDate = strtotime($this->getRepeatingEndDate()); + if ($newDate < $oldDate) { + $this->removeAllInstancesFromDate($p_endDate); + } + }*/ + } + } + + public function deleteAllRepeatInstances($currentShowDay, $showId) + { + $firstShow = $currentShowDay->getUTCStartDateAndTime(); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId + AND date(starts) != :firstShow +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId, + ':firstShow' => $firstShow->format("Y-m-d")), 'execute'); + } + + public function deleteAllInstances($showId) + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId), 'execute'); + } + + /** + * + * Enter description here ... + * @param $daysRemoved array of days removed + * ( + * @param $showDays + * @param $showId + */ + public function deleteRemovedShowDayInstances($daysRemoved, $showDays, $showId) + { + $daysRemovedUTC = array(); + + //convert the start day of the week to UTC + foreach ($showDays as $showDay) { + if (in_array($showDay->getDbDay(), $daysRemoved)) { + $showDay->reload(); + $startDay = $showDay->getUTCStartDateAndTime(); + $daysRemovedUTC[] = $startDay->format('w'); + } + } + + $uncheckedDays = pg_escape_string(implode(",", $daysRemovedUTC)); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute( $sql, + array( + ":timestamp" => gmdate("Y-m-d H:i:s"), + ":showId" => $showId, + ), "execute"); + } + + public function deleteInstancesBeforeDate($newStartDate, $showId) + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute($sql, array( + ":newStartDate" => $newStartDate, ":timestamp" => gmdate("Y-m-d H:i:s"), + ":showId" => $showId), "execute"); + } + + public function updateDuration($showData) + { + $date = new Application_Common_DateHelper; + $timestamp = $date->getUtcTimestamp(); + + $sql = << :timestamp::TIMESTAMP +SQL; + + Application_Common_Database::prepareAndExecute( $sql, array( + ':add_show_duration' => $showData['add_show_duration'], + ':show_id' => $showData['add_show_id'], + ':timestamp' => $timestamp), "execute"); + } } \ No newline at end of file From 5735baf2373994010f91f5b4e93f1f3e13add57c Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 13 Mar 2013 11:08:16 -0400 Subject: [PATCH 024/128] CC-4961: Show linking Made progress on ShowInstanceService --- .../application/services/ShowDaysService.php | 8 +++ .../services/ShowInstanceService.php | 57 +++++++++++++++++-- 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php index f5cd6c906..b22fd4292 100644 --- a/airtime_mvc/application/services/ShowDaysService.php +++ b/airtime_mvc/application/services/ShowDaysService.php @@ -9,6 +9,14 @@ class Application_Service_ShowDaysService $this->showId = $id; } + /** + * + * Determines what the show end date should be based on + * the form data + * + * @param $showData add/edit show form data + * @return DateTime object in user's local timezone + */ public function calculateEndDate($showData) { if ($showData['add_show_no_end']) { diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index e3de1f766..ccd6f3c0b 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -275,7 +275,7 @@ SQL; $showData["add_show_start_date"] != $localShowStart->format("Y-m-d")) { //Start date has changed when repeat type is bi-weekly or monthly. - //This screws up the repeating positions of show instances, so lets + //This screws up the repeating positions of show instances, so //we need to delete them (CC-2351) $this->deleteAllInstances($showId); } @@ -286,11 +286,13 @@ SQL; } else { //repeat type is the same, check if the days of the week are the same $repeatingDaysChanged = false; + $ccShowDays = $this->service_showDays->getShowDays(); $showDays = array(); foreach ($ccShowDays as $day) { $showDays[] = $day->getDbDay(); } + if (count($showData['add_show_day_check']) == count($showDays)) { //same number of days checked, lets see if they are the same numbers $intersect = array_intersect($showData['add_show_day_check'], $showDays); @@ -315,12 +317,13 @@ SQL; if ($showData['add_show_start_date'] != $localShowStart->format("Y-m-d") || $showData['add_show_start_time'] != $localShowStart->format("H:i:s")){ - //start date/time has changed + //start date has been pushed forward so we need to delete + //any instances of this show scheduled before the new start date if ($showData['add_show_start_date'] > $localShowStart->format("Y-m-d")) { $this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId); } - /*$this->updateStartDateTime($showData, $p_endDate);*/ + $this->updateStartDateAndTime($showData, $currentShowDay); } } /* @@ -345,6 +348,47 @@ SQL; } } + /** + * + * Updates the start date and time for cc_show_instances + * and entries in cc_schedule + * + * @param $showData edit show form data + */ + public function updateStartDateAndTime($showData, $currentShowDay) + { + $date = new Application_Common_DateHelper(); + //current time in UTC + $timestamp = $date->getTimestamp(); + + $dtOld = $currentShowDay->getUTCStartDateAndTime(); + $dtNew = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time'], + new DateTimeZone(date_default_timezone_get())); + $diff = $dtOld->getTimestamp() - $dtNew->getTimestamp(); + $sql = << :timestamp +SQL; + + Application_Common_Database::prepareAndExecute($sql, + array(':diff1' => $diff, ':diff2' => $diff, + ':showId' => $showData["add_show_id"], ':timestamp' => $timestamp), + 'execute'); + + /*$showInstanceIds = $this->getAllFutureInstanceIds(); + if (count($showInstanceIds) > 0 && $diff != 0) { + $showIdsImploded = implode(",", $showInstanceIds); + $sql = "UPDATE cc_schedule " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE instance_id IN ($showIdsImploded)"; + $con->exec($sql); + }*/ + } + public function deleteAllRepeatInstances($currentShowDay, $showId) { $firstShow = $currentShowDay->getUTCStartDateAndTime(); @@ -378,9 +422,10 @@ SQL; /** * * Enter description here ... - * @param $daysRemoved array of days removed - * ( - * @param $showDays + * @param $daysRemoved array of days (days of the week) removed + * (days of the week are represented numerically + * 0=>sunday, 1=>monday, 2=>tuesday, etc.) + * @param $showDays array of ccShowDays objects * @param $showId */ public function deleteRemovedShowDayInstances($daysRemoved, $showDays, $showId) From 896e03d76b0f2f0738507d2f916abc7ee67b7336 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 15 Mar 2013 16:56:22 -0400 Subject: [PATCH 025/128] CC-4961: Show linking Refactoring all services thus far --- .../controllers/ScheduleController.php | 19 +- airtime_mvc/application/models/Show.php | 81 ++--- .../application/services/CalendarService.php | 271 +++++++++++++++++ .../application/services/ScheduleService.php | 280 +---------------- .../application/services/ShowDaysService.php | 66 +++- .../services/ShowInstanceService.php | 286 ++++++++++++------ .../application/services/ShowService.php | 26 +- 7 files changed, 612 insertions(+), 417 deletions(-) create mode 100644 airtime_mvc/application/services/CalendarService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index bc56fd993..09a2495ca 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -5,7 +5,7 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; - private $service_schedule; + private $service_calendar; public function init() { @@ -41,7 +41,7 @@ class ScheduleController extends Zend_Controller_Action $this->sched_sess = new Zend_Session_Namespace("schedule"); - $this->service_schedule = new Application_Service_ScheduleService(); + $this->service_calendar = new Application_Service_CalendarService(); } public function indexAction() @@ -798,12 +798,13 @@ class ScheduleController extends Zend_Controller_Action $forms = $this->createShowFormAction(); list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) = - $this->service_schedule->preEditShowValidationCheck($data); + $this->service_calendar->preEditShowValidationCheck($data); - if ($this->service_schedule->validateShowForms($forms, $data, $validateStartDate, + if ($this->service_calendar->validateShowForms($forms, $data, $validateStartDate, $originalShowStartDateTime, true, $data["add_show_instance_id"])) { - $this->service_schedule->editShow($data); + //pass in true to indicate we are updating a show + $this->service_calendar->addUpdateShow($data, true); $scheduler = new Application_Model_Scheduler(); $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); @@ -848,8 +849,8 @@ class ScheduleController extends Zend_Controller_Action $this->view->addNewShow = true; - if ($this->service_schedule->validateShowForms($forms, $data)) { - $this->service_schedule->createShow($data); + if ($this->service_calendar->validateShowForms($forms, $data)) { + $this->service_calendar->addUpdateShow($data); $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); //send new show forms to the user @@ -864,7 +865,7 @@ class ScheduleController extends Zend_Controller_Action public function createShowFormAction($populate=false) { - $forms = $this->service_schedule->createShowForms(); + $forms = $this->service_calendar->createShowForms(); // populate forms with default values if ($populate) { @@ -886,7 +887,7 @@ class ScheduleController extends Zend_Controller_Action public function populateNewShowFormsAction($forms) { - $this->service_schedule->populateNewShowForms( + $this->service_calendar->populateNewShowForms( $forms["what"], $forms["when"], $forms["repeats"]); } diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 17ee99bb2..8490f6295 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1169,17 +1169,17 @@ SQL; /*$isRecorded = (isset($data['add_show_record']) && $data['add_show_record']) ? 1 : 0;*/ - if ($data['add_show_id'] != -1) { + /*if ($data['add_show_id'] != -1) { $show = new Application_Model_Show($showId); //CC-4150 CULPRIT $show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType); - } + }*/ //check if we are adding or updating a show, and if updating //erase all the show's show_days information first. - if ($data['add_show_id'] != -1) { + /*if ($data['add_show_id'] != -1) { CcShowDaysQuery::create()->filterByDbShowId($data['add_show_id'])->delete(); - } + }*/ //don't set day for monthly repeat type, it's invalid. /*if ($data['add_show_repeats'] && $data['add_show_repeat_type'] == 2) { @@ -1223,11 +1223,11 @@ SQL; //check if we are adding or updating a show, and if updating //erase all the show's future show_rebroadcast information first. - if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) { + /*if (($data['add_show_id'] != -1) && isset($data['add_show_rebroadcast']) && $data['add_show_rebroadcast']) { CcShowRebroadcastQuery::create() ->filterByDbShowId($data['add_show_id']) ->delete(); - } + }*/ //adding rows to cc_show_rebroadcast /* TODO: Document magic constant 10 and define it properly somewhere --RG */ @@ -1272,9 +1272,9 @@ SQL; //check if we are adding or updating a show, and if updating //erase all the show's show_rebroadcast information first. - if ($data['add_show_id'] != -1) { + /*if ($data['add_show_id'] != -1) { CcShowHostsQuery::create()->filterByDbShow($data['add_show_id'])->delete(); - } + }*/ /*if (is_array($data['add_show_hosts'])) { //add selected hosts to cc_show_hosts table. foreach ($data['add_show_hosts'] as $host) { @@ -1285,7 +1285,7 @@ SQL; } }*/ - if ($data['add_show_id'] != -1) { + /*if ($data['add_show_id'] != -1) { $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); $con->beginTransaction(); @@ -1310,12 +1310,12 @@ SQL; Logging::info("Couldn't update schedule status."); Logging::info($e->getMessage()); } - } + }*/ /*Application_Model_Show::populateShowUntil($showId); Application_Model_RabbitMq::PushSchedule();*/ - return $showId; + /*return $showId;*/ } /** @@ -1399,39 +1399,39 @@ SQL; if ($utcStartDateTime->getTimestamp() < $p_populateUntilDateTime->getTimestamp()) { $currentUtcTimestamp = gmdate("Y-m-d H:i:s");*/ - $show = new Application_Model_Show($show_id); + /*$show = new Application_Model_Show($show_id); if ($show->hasInstance()) { $ccShowInstance = $show->getInstance(); $newInstance = false; - } /*else { + }*/ /*else { $ccShowInstance = new CcShowInstances(); $newInstance = true; }*/ - if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + /*if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); $ccShowInstance->setDbRecord($record); $ccShowInstance->save(); - } + }*/ - $show_instance_id = $ccShowInstance->getDbId(); - $showInstance = new Application_Model_ShowInstance($show_instance_id); + /* $show_instance_id = $ccShowInstance->getDbId(); + $showInstance = new Application_Model_ShowInstance($show_instance_id);*/ - if (!$newInstance) { + /*if (!$newInstance) { $showInstance->correctScheduleStartTimes(); - } + }*/ /*$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, array( ':show_id' => $show_id ), 'all');*/ - if ($showInstance->isRecorded()) { + /*if ($showInstance->isRecorded()) { //only do this for editing $showInstance->deleteRebroadcasts(); self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); - } + }*/ /*}*/ } @@ -1471,21 +1471,21 @@ SQL; //convert $last_show into a UTC DateTime object, or null if there is no last show. $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;*/ - $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + /*$sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; $rebroadcasts = Application_Common_Database::prepareAndExecute( $sql, array( ':show_id' => $show_id ), 'all'); - $show = new Application_Model_Show($show_id); + $show = new Application_Model_Show($show_id);*/ - while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp() - && (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){ + /*while ($utcStartDateTime->getTimestamp() <= $p_populateUntilDateTime->getTimestamp() + && (is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())){*/ - list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone); + /*list($utcStartDateTime, $utcEndDateTime) = self::createUTCStartEndDateTime($start, $duration, $timezone);*/ //determine if we are adding a new show //or editing a show - if ($show->hasInstanceOnDate($utcStartDateTime)) { + /* if ($show->hasInstanceOnDate($utcStartDateTime)) { $ccShowInstance = $show->getInstanceOnDate($utcStartDateTime); if ($ccShowInstance->getDbModifiedInstance()) { @@ -1498,12 +1498,12 @@ SQL; } else { $ccShowInstance = new CcShowInstances(); $newInstance = true; - } + }*/ /* When editing the start/end time of a repeating show, we don't want to * change shows that started in the past. So check the start time. */ - if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { + /*if ($newInstance || $ccShowInstance->getDbStarts() > $currentUtcTimestamp) { $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); @@ -1513,21 +1513,22 @@ SQL; $show_instance_id = $ccShowInstance->getDbId(); - $showInstance = new Application_Model_ShowInstance($show_instance_id); + $showInstance = new Application_Model_ShowInstance($show_instance_id);*/ /* If we are updating a show then make sure that the scheduled content within * the show is updated to the correct time. */ - if (!$newInstance) { + // don't we already do this in deletePossiblyInvalidInstances??? + /*if (!$newInstance) { $showInstance->correctScheduleStartTimes(); - } + }*/ - $showInstance->deleteRebroadcasts(); + /*$showInstance->deleteRebroadcasts(); self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone); - list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone); + list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone);*/ - } + /*}*/ - Application_Model_Show::setNextPop($start, $show_id, $day); + /*Application_Model_Show::setNextPop($start, $show_id, $day);*/ } private static function advanceRepeatingDate($p_interval, $start, $timezone) @@ -1581,7 +1582,7 @@ SQL; */ private static function createUTCStartEndDateTime($p_start, $p_duration, $p_timezone=null, $p_offset=null) { - $timezone = $p_timezone ? $p_timezone : date_default_timezone_get(); + /*$timezone = $p_timezone ? $p_timezone : date_default_timezone_get(); $startDateTime = new DateTime($p_start, new DateTimeZone($timezone)); if (isset($p_offset)) { @@ -1595,7 +1596,7 @@ SQL; list($hours, $mins) = array_slice($duration, 0, 2); $endDateTime->add(new DateInterval("PT{$hours}H{$mins}M")); - return array($startDateTime, $endDateTime); + return array($startDateTime, $endDateTime);*/ } /* Create rebroadcast instances for a created show marked for recording @@ -1621,7 +1622,7 @@ SQL; { //Y-m-d //use only the date part of the show start time stamp for the offsets to work properly. - $date = explode(" ", $p_startTime); + /*$date = explode(" ", $p_startTime); $start_date = $date[0]; foreach ($p_rebroadcasts as $rebroadcast) { @@ -1643,7 +1644,7 @@ SQL; $newRebroadcastInstance->setDbOriginalShow($p_showInstanceId); $newRebroadcastInstance->save(); } - } + }*/ } /** diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php new file mode 100644 index 000000000..a03fd734b --- /dev/null +++ b/airtime_mvc/application/services/CalendarService.php @@ -0,0 +1,271 @@ +service_show = new Application_Service_ShowService(); + $this->service_showInstances = new Application_Service_ShowInstanceService(); + $this->service_user = new Application_Service_UserService(); + } +/* + * Form stuff begins here + * Typically I would keep form creation and validation + * in the controller but since shows require 9 forms, + * the controller will become too fat. + * Maybe we should create a special form show service? + */ + /** + * + * @return array of schedule forms + */ + public function createShowForms() + { + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $forms = array(); + $forms["what"] = $formWhat; + $forms["who"] = $formWho; + $forms["when"] = $formWhen; + $forms["repeats"] = $formRepeats; + $forms["style"] = $formStyle; + $forms["live"] = $formLive; + $forms["record"] = $formRecord; + $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; + $forms["rebroadcast"] = $formRebroadcast; + + return $forms; + } + + /** + * + * Popluates the what, when, and repeat forms + * with default values + */ + public function populateNewShowForms($formWhat, $formWhen, $formRepeats) + { + $formWhat->populate( + array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + + $formWhen->populate( + array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + } + + public function populateForm($form, $values) + { + $form->populate($values); + } + + /** + * + * Validates show forms + * + * @return boolean + */ + public function validateShowForms($forms, $formData, $validateStartDate = true, + $originalStartDate=null, $editShow=false, $instanceId=null) + { + $what = $forms["what"]->isValid($formData); + $live = $forms["live"]->isValid($formData); + $record = $forms["record"]->isValid($formData); + $who = $forms["who"]->isValid($formData); + $style = $forms["style"]->isValid($formData); + $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate, + $originalStartDate, $editShow, $instanceId); + + $repeats = true; + if ($formData["add_show_repeats"]) { + $repeats = $forms["repeats"]->isValid($formData); + + /* + * Make the absolute rebroadcast form valid since + * it does not get used if the show is repeating + */ + $forms["abs_rebroadcast"]->reset(); + $absRebroadcast = true; + + $rebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $rebroadcast = $forms["rebroadcast"]->isValid($formData); + } + } else { + /* + * Make the rebroadcast form valid since it does + * not get used if the show is not repeating. + * Instead, we use the absolute rebroadcast form + */ + $forms["rebroadcast"]->reset(); + $rebroadcast = true; + + $absRebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = $this->formatShowDuration( + $formData["add_show_duration"]); + $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); + } + } + + if ($what && $live && $record && $who && $style && $when && + $repeats && $absRebroadcast && $rebroadcast) { + return true; + } else { + return false; + } + } +/* + * Form stuff ends + */ + + public function formatShowDuration($duration) { + $hPos = strpos($duration, 'h'); + $mPos = strpos($duration, 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($duration, 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($duration, $hPos, -1 )); + } + + return $hValue.":".$mValue; + } + + public function addUpdateShow($showData, $isUpdate=false) + { + //CcSubj object + $currentUser = $this->service_user->getCurrentUser(); + + $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + $con = Propel::getConnection(); + $con->beginTransaction(); + try { + if (!$currentUser->isAdminOrPM()) { + throw new Exception("Permission denied"); + } + //update ccShow + $ccShow = $this->service_show->setShow($showData, $isUpdate); + $showId = $ccShow->getDbId(); + + if ($isUpdate) { + $this->service_showInstances->deleteInvalidInstances($showData, $isRecorded, $repeatType); + $this->service_showInstances->updateScheduleStatus($showId); + $this->service_showInstances->deleteRebroadcastInstances($showId); + $this->service_showDays->deleteShowDays(); + $this->service_show->deleteShowHosts($showId); + if ($isRebroadcast) { + //delete entry in cc_show_rebroadcast + $this->service_show->deleteShowRebroadcasts($showId); + } + } + + //update ccShowDays + $this->service_showDays = new Application_Service_ShowDaysService($showId); + $this->service_showDays->setShowDays($showData, $repeatType, $isRecorded); + + //update ccShowRebroadcasts + $this->service_show->setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); + + //update ccShowHosts + $this->service_show->setShowHosts($showData, $showId); + + //create new ccShowInstances + $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast, $isUpdate); + + $con->commit(); + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + $con->rollback(); + $isUpdate ? $action = "update" : $action = "creation"; + Logging::info("EXCEPTION: Show ".$action." failed."); + Logging::info($e->getMessage()); + } + } + + /** + * + * Before we send the form data in for validation, there + * are a few fields we may need to adjust first + * @param $formData + */ + public function preEditShowValidationCheck($formData) { + $validateStartDate = true; + $validateStartTime = true; + $this->service_showDays = new Application_Service_ShowDaysService( + $formData["add_show_id"]); + + //CcShowDays object of the show currently being edited + $currentShowDay = $this->service_showDays->getCurrentShowDay(); + + if (!array_key_exists('add_show_start_date', $formData)) { + //Changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + //The start date will be returned in UTC time, so lets convert it to local time. + $dt = Application_Common_DateHelper::ConvertToLocalDateTime( + $this->service_showDays->getStartDateAndTime()); + $formData['add_show_start_date'] = $dt->format("Y-m-d"); + + if (!array_key_exists('add_show_start_time', $formData)) { + $formData['add_show_start_time'] = $dt->format("H:i"); + $validateStartTime = false; + } + $validateStartDate = false; + } + $formData['add_show_record'] = $currentShowDay->getDbRecord(); + + //if the show is repeating, set the start date to the next + //repeating instance in the future + if ($currentShowDay->isRepeating()) { + $nextFutureRepeatShow = $this->service_showInstances + ->getNextFutureRepeatShowTime($formData["add_show_id"]); + $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; + } else { + $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( + $this->service_showDays->getStartDateAndTime()); + } + + return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); + } + +} \ No newline at end of file diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php index 72304cdb7..9ff581542 100644 --- a/airtime_mvc/application/services/ScheduleService.php +++ b/airtime_mvc/application/services/ScheduleService.php @@ -1,276 +1,26 @@ service_show = new Application_Service_ShowService(); - $this->service_showInstances = new Application_Service_ShowInstanceService(); - $this->service_user = new Application_Service_UserService(); - } -/* - * Form stuff begins here - * Typically I would keep form creation and validation - * in the controller but since shows require 9 forms, - * the controller will become too fat. - * Maybe we should create a special form show service? - */ /** * - * @return array of schedule forms + * Enter description here ... + * @param array $instanceIds */ - public function createShowForms() + public static function updateScheduleStartTime($instanceIds, $diff) { - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formLive = new Application_Form_AddShowLiveStream(); - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + if (count($instanceIds) > 0 && $diff != 0) { + $showIdList = implode(",", $instanceIds); + $sql = <<removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); - $formLive->removeDecorator('DtDdWrapper'); - $formRecord->removeDecorator('DtDdWrapper'); - $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); - $formRebroadcast->removeDecorator('DtDdWrapper'); - - $forms = array(); - $forms["what"] = $formWhat; - $forms["who"] = $formWho; - $forms["when"] = $formWhen; - $forms["repeats"] = $formRepeats; - $forms["style"] = $formStyle; - $forms["live"] = $formLive; - $forms["record"] = $formRecord; - $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; - $forms["rebroadcast"] = $formRebroadcast; - - return $forms; - } - - /** - * - * Popluates the what, when, and repeat forms - * with default values - */ - public function populateNewShowForms($formWhat, $formWhen, $formRepeats) - { - $formWhat->populate( - array('add_show_id' => '-1', - 'add_show_instance_id' => '-1')); - - $formWhen->populate( - array('add_show_start_date' => date("Y-m-d"), - 'add_show_start_time' => '00:00', - 'add_show_end_date_no_repeate' => date("Y-m-d"), - 'add_show_end_time' => '01:00', - 'add_show_duration' => '01h 00m')); - - $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); - } - - public function populateForm($form, $values) - { - $form->populate($values); - } - - /** - * - * Validates show forms - * - * @return boolean - */ - public function validateShowForms($forms, $formData, $validateStartDate = true, - $originalStartDate=null, $editShow=false, $instanceId=null) - { - $what = $forms["what"]->isValid($formData); - $live = $forms["live"]->isValid($formData); - $record = $forms["record"]->isValid($formData); - $who = $forms["who"]->isValid($formData); - $style = $forms["style"]->isValid($formData); - $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate, - $originalStartDate, $editShow, $instanceId); - - $repeats = true; - if ($formData["add_show_repeats"]) { - $repeats = $forms["repeats"]->isValid($formData); - - /* - * Make the absolute rebroadcast form valid since - * it does not get used if the show is repeating - */ - $forms["abs_rebroadcast"]->reset(); - $absRebroadcast = true; - - $rebroadcast = true; - if ($formData["add_show_rebroadcast"]) { - $formData["add_show_duration"] = $this->formatShowDuration( - $formData["add_show_duration"]); - $rebroadcast = $forms["rebroadcast"]->isValid($formData); - } - } else { - /* - * Make the rebroadcast form valid since it does - * not get used if the show is not repeating. - * Instead, we use the absolute rebroadcast form - */ - $forms["rebroadcast"]->reset(); - $rebroadcast = true; - - $absRebroadcast = true; - if ($formData["add_show_rebroadcast"]) { - $formData["add_show_duration"] = $this->formatShowDuration( - $formData["add_show_duration"]); - $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); - } - } - - if ($what && $live && $record && $who && $style && $when && - $repeats && $absRebroadcast && $rebroadcast) { - return true; - } else { - return false; + Application_Common_Database::prepareAndExecute($sql, + array(':diff1' => $diff, ':diff2' => $diff, + ':showIds' => $showIdList), + 'execute'); } } -/* - * Form stuff ends - */ - - public function formatShowDuration($duration) { - $hPos = strpos($duration, 'h'); - $mPos = strpos($duration, 'm'); - - $hValue = 0; - $mValue = 0; - - if ($hPos !== false) { - $hValue = trim(substr($duration, 0, $hPos)); - } - if ($mPos !== false) { - $hPos = $hPos === false ? 0 : $hPos+1; - $mValue = trim(substr($duration, $hPos, -1 )); - } - - return $hValue.":".$mValue; - } - - /** - * - * Creates a new show, which entails creating entries in - * the following tables: - * cc_show - * cc_show_days - * cc_show_hosts - * cc_show_rebroadcast - * cc_show_instances - */ - public function createShow($showData) - { - //CcSubj object - $currentUser = $this->service_user->getCurrentUser(); - - $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; - $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; - $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; - - $showData["add_show_duration"] = $this->formatShowDuration( - $showData["add_show_duration"]); - - if ($currentUser->isAdminOrPM()) { - //create ccShow - $ccShow = $this->service_show->setShow($showData, true); - $showId = $ccShow->getDbId(); - - //create ccShowDays - $this->service_showDays = new Application_Service_ShowDaysService($showId); - $this->service_showDays->setShowDays( - $showData, $currentUser->getDbId(), $repeatType, $isRecorded); - - //create ccShowRebroadcasts - $this->service_show->setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); - - //create ccShowHosts - $this->service_show->setShowHosts($showData, $showId); - - //create ccShowInstances - $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast); - } - } - - public function editShow($showData) - { - //CcSubj object - $currentUser = $this->service_user->getCurrentUser(); - - $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; - $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; - $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; - - $showData["add_show_duration"] = $this->formatShowDuration( - $showData["add_show_duration"]); - - if ($currentUser->isAdminOrPM()) { - $ccShow = $this->service_show->setShow($showData, false); - - $this->service_showInstances->updateShowInstances($showData, $isRecorded, $repeatType); - } - } - - /** - * - * Before we send the form data in for validation, there - * are a few fields we may need to adjust first - * @param $formData - */ - public function preEditShowValidationCheck($formData) { - $validateStartDate = true; - $validateStartTime = true; - $this->service_showDays = new Application_Service_ShowDaysService( - $formData["add_show_id"]); - - //CcShowDays object of the show currently being edited - $currentShowDay = $this->service_showDays->getCurrentShowDay(); - - if (!array_key_exists('add_show_start_date', $formData)) { - //Changing the start date was disabled, since the - //array key does not exist. We need to repopulate this entry from the db. - //The start date will be returned in UTC time, so lets convert it to local time. - $dt = Application_Common_DateHelper::ConvertToLocalDateTime( - $this->service_showDays->getStartDateAndTime()); - $formData['add_show_start_date'] = $dt->format("Y-m-d"); - - if (!array_key_exists('add_show_start_time', $formData)) { - $formData['add_show_start_time'] = $dt->format("H:i"); - $validateStartTime = false; - } - $validateStartDate = false; - } - $formData['add_show_record'] = $currentShowDay->getDbRecord(); - - //if the show is repeating, set the start date to the next - //repeating instance in the future - if ($currentShowDay->isRepeating()) { - $nextFutureRepeatShow = $this->service_showInstances - ->getNextFutureRepeatShowTime($formData["add_show_id"]); - $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; - } else { - $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( - $this->service_showDays->getStartDateAndTime()); - } - - return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); - } - } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php index b22fd4292..07616b552 100644 --- a/airtime_mvc/application/services/ShowDaysService.php +++ b/airtime_mvc/application/services/ShowDaysService.php @@ -9,6 +9,17 @@ class Application_Service_ShowDaysService $this->showId = $id; } + /** + * + * Deletes all the cc_show_days entries for a specific show + * that is currently being edited. They will get recreated with + * the new show day specs + */ + public function deleteShowDays() + { + CcShowDaysQuery::create()->filterByDbShowId($this->showId)->delete(); + } + /** * * Determines what the show end date should be based on @@ -22,13 +33,11 @@ class Application_Service_ShowDaysService if ($showData['add_show_no_end']) { $endDate = NULL; } elseif ($showData['add_show_repeats']) { - $endDateTime = new DateTime($showData['add_show_end_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); + $endDate = new DateTime($showData['add_show_end_date']); + $endDate->add(new DateInterval("P1D")); } else { - $endDateTime = new DateTime($showData['add_show_start_date']); - $endDateTime->add(new DateInterval("P1D")); - $endDate = $endDateTime->format("Y-m-d"); + $endDate = new DateTime($showData['add_show_start_date']); + $endDate->add(new DateInterval("P1D")); } return $endDate; @@ -42,12 +51,18 @@ class Application_Service_ShowDaysService * @param $userId * @param $repeatType * @param $isRecorded + * @param $showDay ccShowDay object we are setting values on */ - public function setShowDays($showData, $userId, $repeatType, $isRecorded) + public function setShowDays($showData, $repeatType, $isRecorded) { $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); - $endDate = $this->calculateEndDate($showData); + $endDateTime = $this->calculateEndDate($showData); + if (!is_null($endDateTime)) { + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDate = $endDateTime; + } /* What we are doing here is checking if the show repeats or if * any repeating days have been checked. If not, then by default @@ -67,7 +82,7 @@ class Application_Service_ShowDaysService $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTime->format("H:i:s")); - $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); $showDay->setDbDuration($showData['add_show_duration']); $showDay->setDbRepeatType($repeatType); $showDay->setDbShowId($this->showId); @@ -90,7 +105,7 @@ class Application_Service_ShowDaysService $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTimeClone->format("H:i")); - $showDay->setDbTimezone(Application_Model_Preference::GetUserTimezone($userId)); + $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); $showDay->setDbDuration($showData['add_show_duration']); $showDay->setDbDay($day); $showDay->setDbRepeatType($repeatType); @@ -110,10 +125,6 @@ class Application_Service_ShowDaysService */ public function getShowDays() { - /*$sql = "SELECT * FROM cc_show_days WHERE show_id = :show_id"; - - return Application_Common_Database::prepareAndExecute( - $sql, array(":show_id" => $this->showId), 'all');*/ return CcShowDaysQuery::create()->filterByDbShowId( $this->showId)->find(); } @@ -140,4 +151,31 @@ class Application_Service_ShowDaysService return CcShowDaysQuery::create()->filterByDbShowId($this->showId) ->findOne(); } + + public function getRepeatingEndDate() + { + $sql = << $this->showId ), 'column' ); + + return ($query !== false) ? $query : false; + } + + public function getNextStartDateTime($showDay) + { + $nextPopDate = $showDay->getDbNextPopDate(); + $startTime = $showDay->getDbStartTime(); + + if (isset($nextPopDate)) { + return $nextPopDate." ".$startTime; + } else { + return $showDay->getDbFirstShow()." ".$startTime; + } + } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index ccd6f3c0b..b6701e705 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -22,7 +22,7 @@ class Application_Service_ShowInstanceService * Receives a cc_show id and determines whether to create a * single show instance or repeating show instances */ - public function delegateShowInstanceCreation($showId, $isRebroadcast) + public function delegateShowInstanceCreation($showId, $isRebroadcast, $isUpdate) { $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); @@ -32,10 +32,10 @@ class Application_Service_ShowInstanceService foreach ($showDays as $day) { switch ($day->getDbRepeatType()) { case NO_REPEAT: - $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast); + $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast, $isUpdate); break; case REPEAT_WEEKLY: - $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast); + $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); break; case REPEAT_BI_WEEKLY: $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast); @@ -57,7 +57,7 @@ class Application_Service_ShowInstanceService * @param $showDay * @param $populateUntil */ - private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast) + private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast, $isUpdate) { $start = $showDay->getDbFirstShow()." ".$showDay->getDbStartTime(); @@ -66,6 +66,15 @@ class Application_Service_ShowInstanceService if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { $ccShowInstance = new CcShowInstances(); + if ($isUpdate) { + $ccShowInstance = $this->getInstance($utcStartDateTime, $showDay->getDbShowId()); + //update schedule start times + //ccShowDays object of the show being edited + $currentShowDay = $this->service_showDays->getCurrentShowDay(); + $diff = $this->calculateShowStartDiff($utcStartDateTime, + $currentShowDay->getUTCStartDateAndTime()); + Application_Service_ScheduleService::updateScheduleStartTime(array($ccShowInstance->getDbId()), $diff); + } $ccShowInstance->setDbShowId($showDay->getDbShowId()); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); @@ -87,35 +96,26 @@ class Application_Service_ShowInstanceService * @param unknown_type $isRebroadcast */ private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, - $repeatInterval, $isRebroadcast) + $repeatInterval, $isRebroadcast, $isUpdate) { $show_id = $showDay->getDbShowId(); - $next_pop_date = $showDay->getDbNextPopDate(); $first_show = $showDay->getDbFirstShow(); //non-UTC $last_show = $showDay->getDbLastShow(); //non-UTC - $start_time = $showDay->getDbStartTime(); //non-UTC $duration = $showDay->getDbDuration(); $day = $showDay->getDbDay(); $record = $showDay->getDbRecord(); $timezone = $showDay->getDbTimezone(); - $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + $start = $this->service_showDays->getNextStartDateTime($showDay); - if (isset($next_pop_date)) { - $start = $next_pop_date." ".$start_time; - } else { - $start = $first_show." ".$start_time; - } - - $period = $this->getDatePeriod($start, $timezone, $last_show, + $datePeriod = $this->getDatePeriod($start, $timezone, $last_show, $repeatInterval, $populateUntil); - $utcStartDateTime = Application_Common_DateHelper::ConvertToUtcDateTime($start, $timezone); $utcLastShowDateTime = $last_show ? Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; $utcEndDateTime = null; - foreach ($period as $date) { + foreach ($datePeriod as $date) { list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( $date->format("Y-m-d H:i:s"), $duration, $timezone); /* @@ -127,14 +127,23 @@ class Application_Service_ShowInstanceService $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { $ccShowInstance = new CcShowInstances(); - $ccShowInstance->setDbShowId($show_id); - $ccShowInstance->setDbStarts($utcStartDateTime); - $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord($record); - $ccShowInstance->save(); + if ($isUpdate) { + $ccShowInstance = $this->getInstance($utcStartDateTime, $show_id); + } + + /* When editing the start/end time of a repeating show, we don't want to + * change shows that started in the past. So check the start time. + */ + if (!$isUpdate || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + } if ($isRebroadcast) { - $this->createRebroadcastShowInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); + $this->createRebroadcastInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); } } } @@ -147,10 +156,10 @@ class Application_Service_ShowInstanceService * Enter description here ... * @param $showDay */ - private function createRebroadcastShowInstances($showDay, $showStartDate, $instanceId) + private function createRebroadcastInstances($showDay, $showStartDate, $instanceId) { $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); - $showId = $showDay["show_id"]; + $showId = $showDay->getDbShowId(); $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, @@ -162,7 +171,7 @@ class Application_Service_ShowInstanceService $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $showStartDate, $showDay["duration"], $showDay["timezone"], $offset); + $showStartDate, $showDay->getDbDuration(), $showDay->getDbTimezone(), $offset); if ($utcStartDateTime->format("Y-m-d H:i:s") > $currentUtcTimestamp) { $ccShowInstance = new CcShowInstances(); @@ -177,9 +186,30 @@ class Application_Service_ShowInstanceService } } - private function deleteRebroadcastShowInstances() + public function updateScheduleStatus($showId) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $instances = CcShowInstancesQuery::create() + ->filterByDbEnds(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN) + ->filterByDbShowId($showId) + ->find(); + foreach ($instances as $instance) { + $instance->updateScheduleStatus($con); + } + } + + public function deleteRebroadcastInstances($showId) + { + $sql = << :timestamp::TIMESTAMP +AND show_id = :showId +AND rebroadcast = 1; +SQL; + Application_Common_Database::prepareAndExecute( $sql, array( + ':showId' => $showId, + ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); } /** @@ -231,7 +261,80 @@ SQL; } /** - * This function is messy. But sometimes there is no easy way to do it. + * + * Returns all the show instances of the show currently + * being edited. + * @param $showId + */ + public function getCurrentInstances($showId) + { + return CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbModifiedInstance(false) + ->orderBy("starts"); + } + + /** + * + * Attempts to retrieve the cc_show_instance belonging to a cc_show + * that starts at $starts. We have to pass in the start + * time in case the show is repeating + * + * Returns the instance if one was found (one that is not a recording + * and modified instance is false (has not been deleted)) + */ + public function getInstance($starts, $showId) + { + $ccShowInstance = CcShowInstancesQuery::create() + ->filterByDbStarts($starts->format("Y-m-d H:i:s"), Criteria::EQUAL) + ->filterByDbShowId($showId, Criteria::EQUAL) + ->filterByDbModifiedInstance(false, Criteria::EQUAL) + ->filterByDbRebroadcast(0, Criteria::EQUAL) + ->limit(1) + ->find(); + + if ($ccShowInstance->isEmpty()) { + throw new Exception("Show instance not found"); + } + + return $ccShowInstance[0]; + } + + public function getAllFutureInstanceIds($showId) + { + $sql = << :timestamp::TIMESTAMP + AND modified_instance != TRUE +SQL; + $rows = Application_Common_Database::prepareAndExecute($sql, + array( ':showId' => $showId, + ':timestamp' => gmdate("Y-m-d H:i:s")), "all"); + + $ids = array(); + foreach ($ids as $id) { + $ids[] = $id['id']; + } + return $ids; + } + + /** + * + * Returns the difference in seconds between a show's new and + * old start time + * + * @param $newStartDateTime DateTime object + * @param $oldStartDateTime DateTime object + */ + public function calculateShowStartDiff($newStartDateTime, $oldStartDateTime) + { + return $newStartDateTime->getTimestamp() - $oldStartDateTime->getTimestamp(); + } + + /** + * TODO: This function is messy. Needs refactoring * * When editing a show we may need to perform some actions to reflect the new specs: * - Delete some show instances @@ -242,7 +345,7 @@ SQL; * @param $isRecorded value computed from the edit show form * @param $repeatType value computed from the edit show form */ - public function updateShowInstances($showData, $isRecorded, $repeatType) + public function deleteInvalidInstances($showData, $isRecorded, $repeatType) { $showId = $showData["add_show_id"]; @@ -250,7 +353,13 @@ SQL; //ccShowDays object of the show being edited $currentShowDay = $this->service_showDays->getCurrentShowDay(); - $endDate = $this->service_showDays->calculateEndDate($showData); + //new end date in users' local time + $endDateTime = $this->service_showDays->calculateEndDate($showData); + if (!is_null($endDateTime)) { + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDate = $endDateTime; + } //repeat option was toggled if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) { @@ -258,9 +367,9 @@ SQL; } //duration has changed - if ($showData['add_show_duration'] != $currentShowDay->getDbDuration()) { - $this->updateDuration($showData); - } + /*if ($showData['add_show_duration'] != $currentShowDay->getDbDuration()) { + $this->updateInstanceDuration($showData); + }*/ if ($showData['add_show_repeats']) { @@ -315,7 +424,7 @@ SQL; } if ($showData['add_show_start_date'] != $localShowStart->format("Y-m-d") - || $showData['add_show_start_time'] != $localShowStart->format("H:i:s")){ + || $showData['add_show_start_time'] != $localShowStart->format("H:i")) { //start date has been pushed forward so we need to delete //any instances of this show scheduled before the new start date @@ -323,70 +432,65 @@ SQL; $this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId); } - $this->updateStartDateAndTime($showData, $currentShowDay); + } } -/* - //Check if end date for the repeat option has changed. If so, need to take care - //of deleting possible invalid Show Instances. - if ((strlen($this->getRepeatingEndDate()) == 0) == $showData['add_show_no_end']) { - //show "Never Ends" option was toggled. - if ($showData['add_show_no_end']) { - } else { - $this->removeAllInstancesFromDate($p_endDate); - } - } - if ($this->getRepeatingEndDate() != $showData['add_show_end_date']) { - //end date was changed. - $newDate = strtotime($showData['add_show_end_date']); - $oldDate = strtotime($this->getRepeatingEndDate()); - if ($newDate < $oldDate) { - $this->removeAllInstancesFromDate($p_endDate); + $currentShowEndDate = $this->service_showDays->getRepeatingEndDate(); + //check if "no end" option has changed + if ($currentShowEndDate != $showData['add_show_no_end']) { + //show "No End" option was toggled + if (!$showData['add_show_no_end']) { + //"No End" option was unchecked so we need to delete the + //repeat instances that are scheduled after the new end date + $this->deleteInstancesFromDate($endDate, $showId); } - }*/ - } + } + + if ($currentShowEndDate != $showData['add_show_end_date']) { + //end date was changed + $newEndDate = strtotime($showData['add_show_end_date']); + $oldEndDate = strtotime($currentShowEndDate); + if ($newEndDate < $oldEndDate) { + //end date was pushed back so we have to delete any + //instances of this show scheduled after the new end date + $this->deleteInstancesFromDate($endDate, $showId); + } + } + }//if repeats + + /*$newStartDateTime = new DateTime($showData["add_show_start_date"]." ". + $showData["add_show_start_time"], + new DateTimeZone(Application_Model_Preference::GetTimezone())); + + $diff = $this->calculateShowStartDiff($newStartDateTime, + $currentShowDay->getLocalStartDateAndTime()); + + $this->updateInstanceStartEndTime($showId, $diff); + $instanceIds = $this->getAllFutureInstanceIds($showId); + Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff);*/ } /** * - * Updates the start date and time for cc_show_instances - * and entries in cc_schedule + * Updates the start and end time for cc_show_instances * * @param $showData edit show form data */ - public function updateStartDateAndTime($showData, $currentShowDay) + public function updateInstanceStartEndTime($showId, $diff) { - $date = new Application_Common_DateHelper(); - //current time in UTC - $timestamp = $date->getTimestamp(); - - $dtOld = $currentShowDay->getUTCStartDateAndTime(); - $dtNew = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time'], - new DateTimeZone(date_default_timezone_get())); - $diff = $dtOld->getTimestamp() - $dtNew->getTimestamp(); $sql = << :timestamp + AND starts > :timestamp::TIMESTAMP SQL; Application_Common_Database::prepareAndExecute($sql, array(':diff1' => $diff, ':diff2' => $diff, - ':showId' => $showData["add_show_id"], ':timestamp' => $timestamp), + ':showId' => $showId, ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); - - /*$showInstanceIds = $this->getAllFutureInstanceIds(); - if (count($showInstanceIds) > 0 && $diff != 0) { - $showIdsImploded = implode(",", $showInstanceIds); - $sql = "UPDATE cc_schedule " - ."SET starts = starts + INTERVAL '$diff sec', " - ."ends = ends + INTERVAL '$diff sec' " - ."WHERE instance_id IN ($showIdsImploded)"; - $con->exec($sql); - }*/ } public function deleteAllRepeatInstances($currentShowDay, $showId) @@ -451,11 +555,9 @@ WHERE EXTRACT(DOW FROM starts) IN ($uncheckedDays) AND show_id = :showId SQL; - Application_Common_Database::prepareAndExecute( $sql, - array( - ":timestamp" => gmdate("Y-m-d H:i:s"), - ":showId" => $showId, - ), "execute"); + Application_Common_Database::prepareAndExecute( $sql, array( + ":timestamp" => gmdate("Y-m-d H:i:s"), ":showId" => $showId), + "execute"); } public function deleteInstancesBeforeDate($newStartDate, $showId) @@ -473,21 +575,31 @@ SQL; ":showId" => $showId), "execute"); } - public function updateDuration($showData) + public function deleteInstancesFromDate($endDate, $showId) { - $date = new Application_Common_DateHelper; - $timestamp = $date->getUtcTimestamp(); + $sql = <<= :endDate::DATE + AND starts > :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute($sql, array( + ':endDate' => $endDate, ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId), 'execute'); + } +/* public function updateInstanceDuration($showData) + { $sql = << :timestamp::TIMESTAMP SQL; - + Application_Common_Database::prepareAndExecute( $sql, array( ':add_show_duration' => $showData['add_show_duration'], ':show_id' => $showData['add_show_id'], - ':timestamp' => $timestamp), "execute"); - } + ':timestamp' => gmdate("Y-m-d H:i:s")), "execute"); + }*/ } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index e858809c8..7747a32af 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -10,9 +10,9 @@ class Application_Service_ShowService * @param $ccShow * @param $showData */ - public function setShow($showData, $isNewShow) + public function setShow($showData, $isUpdate) { - if ($isNewShow) { + if (!$isUpdate) { $ccShow = new CcShow(); } else { $ccShow = CcShowQuery::create()->findPk($showData["add_show_id"]); @@ -33,6 +33,17 @@ class Application_Service_ShowService return $ccShow; } + /** + * + * Deletes all the cc_show_rebroadcast entries for a specific show + * that is currently being edited. They will get recreated with + * the new show specs + */ + public function deleteShowRebroadcasts($showId) + { + CcShowRebroadcastQuery::create()->filterByDbShowId($showId)>delete(); + } + /** * * Sets the fields for a cc_show_rebroadcast table row @@ -70,6 +81,17 @@ class Application_Service_ShowService } } + /** + * + * Deletes all the cc_show_hosts entries for a specific show + * that is currently being edited. They will get recreated with + * the new show specs + */ + public function deleteShowHosts($showId) + { + CcShowHostsQuery::create()->filterByDbShow($showId)->delete(); + } + /** * * Sets the fields for a cc_show_hosts table row From 4bdd89f747af4d75d098b6e27861b423f67f4c82 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 18 Mar 2013 12:34:27 -0400 Subject: [PATCH 026/128] CC-4961: Show linking Fixed edit show start/end time bug --- .../application/services/CalendarService.php | 10 ++++- .../services/ShowInstanceService.php | 39 ++++++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index a03fd734b..9988c149b 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -190,7 +190,9 @@ class Application_Service_CalendarService if ($isUpdate) { $this->service_showInstances->deleteInvalidInstances($showData, $isRecorded, $repeatType); - $this->service_showInstances->updateScheduleStatus($showId); + // updates cc_show_instances start/end times, and updates + // schedule start/end times + $this->service_showInstances->applyShowStartEndDifference($showData, $showId); $this->service_showInstances->deleteRebroadcastInstances($showId); $this->service_showDays->deleteShowDays(); $this->service_show->deleteShowHosts($showId); @@ -213,6 +215,12 @@ class Application_Service_CalendarService //create new ccShowInstances $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast, $isUpdate); + //after all instances have been deleted/updated, we need to update + //the schedule playout status + if ($isUpdate) { + $this->service_showInstances->updateScheduleStatus($showId); + } + $con->commit(); Application_Model_RabbitMq::PushSchedule(); } catch (Exception $e) { diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index b6701e705..93072f2d1 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -68,12 +68,6 @@ class Application_Service_ShowInstanceService $ccShowInstance = new CcShowInstances(); if ($isUpdate) { $ccShowInstance = $this->getInstance($utcStartDateTime, $showDay->getDbShowId()); - //update schedule start times - //ccShowDays object of the show being edited - $currentShowDay = $this->service_showDays->getCurrentShowDay(); - $diff = $this->calculateShowStartDiff($utcStartDateTime, - $currentShowDay->getUTCStartDateAndTime()); - Application_Service_ScheduleService::updateScheduleStartTime(array($ccShowInstance->getDbId()), $diff); } $ccShowInstance->setDbShowId($showDay->getDbShowId()); $ccShowInstance->setDbStarts($utcStartDateTime); @@ -126,15 +120,22 @@ class Application_Service_ShowInstanceService ( is_null($utcLastShowDateTime) || $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { - $ccShowInstance = new CcShowInstances(); - if ($isUpdate) { + /* There may not always be an instance when editing a show + * This will be the case when we are adding a new show day to + * a repeating show + */ + if ($isUpdate && $this->hasInstance($utcStartDateTime, $show_id)) { $ccShowInstance = $this->getInstance($utcStartDateTime, $show_id); + $newInstance = false; + } else { + $newInstance = true; + $ccShowInstance = new CcShowInstances(); } /* When editing the start/end time of a repeating show, we don't want to * change shows that started in the past. So check the start time. */ - if (!$isUpdate || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { + if ($newInstance || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($utcStartDateTime); $ccShowInstance->setDbEnds($utcEndDateTime); @@ -294,10 +295,15 @@ SQL; ->find(); if ($ccShowInstance->isEmpty()) { - throw new Exception("Show instance not found"); + return false; + } else { + return $ccShowInstance[0]; } + } - return $ccShowInstance[0]; + public function hasInstance($starts, $showId) + { + return $this->getInstance($starts, $showId) ? true : false; } public function getAllFutureInstanceIds($showId) @@ -458,9 +464,14 @@ SQL; } } }//if repeats + } - /*$newStartDateTime = new DateTime($showData["add_show_start_date"]." ". - $showData["add_show_start_time"], + public function applyShowStartEndDifference($showData, $showId) + { + $currentShowDay = $this->service_showDays->getCurrentShowDay(); + + $newStartDateTime = new DateTime($showData["add_show_start_date"]." ". + $showData["add_show_start_time"], new DateTimeZone(Application_Model_Preference::GetTimezone())); $diff = $this->calculateShowStartDiff($newStartDateTime, @@ -468,7 +479,7 @@ SQL; $this->updateInstanceStartEndTime($showId, $diff); $instanceIds = $this->getAllFutureInstanceIds($showId); - Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff);*/ + Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff); } /** From bae9f1202aeb8e113ed2091f34954f39270facf3 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 19 Mar 2013 10:09:28 -0400 Subject: [PATCH 027/128] CC-4961: Show linking Removed unused schedule controller actions Fix bug where changing a show to repeat deletes the original show's content --- .../controllers/ScheduleController.php | 63 +++---------------- .../services/ShowInstanceService.php | 14 ++--- 2 files changed, 13 insertions(+), 64 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 09a2495ca..87e3c4c4e 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -6,6 +6,7 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; private $service_calendar; + private $currentUser; public function init() { @@ -42,6 +43,9 @@ class ScheduleController extends Zend_Controller_Action $this->sched_sess = new Zend_Session_Namespace("schedule"); $this->service_calendar = new Application_Service_CalendarService(); + + $service_user = new Application_Service_UserService(); + $this->currentUser = $service_user->getCurrentUser(); } public function indexAction() @@ -121,11 +125,9 @@ class ScheduleController extends Zend_Controller_Action $end = new DateTime($this->_getParam('end', null)); $end->setTimezone(new DateTimeZone("UTC")); - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - $editable = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $events = &Application_Model_Show::getFullCalendarEvents($start, $end, + $this->currentUser->isAdminOrPM()); - $events = &Application_Model_Show::getFullCalendarEvents($start, $end, $editable); $this->view->events = $events; } @@ -421,32 +423,6 @@ class ScheduleController extends Zend_Controller_Action $this->view->show_name = isset($show[0])?$show[0]["name"]:""; } - public function removeGroupAction() - { - $showInstanceId = $this->sched_sess->showInstanceId; - $group_id = $this->_getParam('groupId'); - - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - try { - $show = new Application_Model_ShowInstance($showInstanceId); - } catch (Exception $e) { - $this->view->show_error = true; - - return false; - } - - if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)) || $user->isHostOfShow($show->getShowId())) { - $show->removeGroupFromShow($group_id); - } - - $this->view->showContent = $show->getShowContent(); - $this->view->timeFilled = $show->getTimeScheduled(); - $this->view->percentFilled = $show->getPercentScheduled(); - $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml'); - unset($this->view->showContent); - } - public function showContentDialogAction() { $showInstanceId = $this->_getParam('id'); @@ -730,9 +706,7 @@ class ScheduleController extends Zend_Controller_Action public function getFormAction() { - $user = Application_Model_User::getCurrentUser(); - - if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + if ($this->currentUser->isAdminOrPM()) { $this->createShowFormAction(true); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } @@ -933,29 +907,6 @@ class ScheduleController extends Zend_Controller_Action } } - public function contentContextMenuAction() - { - $id = $this->_getParam('id'); - - $params = '/format/json/id/#id#/'; - - $paramsPop = str_replace('#id#', $id, $params); - - // added for downlaod - $id = $this->_getParam('id'); - - $file_id = $this->_getParam('id', null); - $file = Application_Model_StoredFile::Recall($file_id); - - $baseUrl = $this->getRequest()->getBaseUrl(); - $url = $file->getRelativeFileUrl($baseUrl).'download/true'; - $menu[] = array('action' => array('type' => 'gourl', 'url' => $url), - 'title' => _('Download')); - - //returns format jjmenu is looking for. - $this->_helper->json->sendJson($menu); - } - /** * Sets the user specific preference for which time scale to use in Calendar. * This is only being used by schedule.js at the moment. diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php index 93072f2d1..bf9d2b392 100644 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ b/airtime_mvc/application/services/ShowInstanceService.php @@ -372,11 +372,6 @@ SQL; $this->deleteAllRepeatInstances($currentShowDay, $showId); } - //duration has changed - /*if ($showData['add_show_duration'] != $currentShowDay->getDbDuration()) { - $this->updateInstanceDuration($showData); - }*/ - if ($showData['add_show_repeats']) { $localShowStart = $currentShowDay->getLocalStartDateAndTime(); @@ -395,7 +390,10 @@ SQL; $this->deleteAllInstances($showId); } - if ($repeatType != $currentShowDay->getDbRepeatType()) { + $currentRepeatType = $currentShowDay->getDbRepeatType(); + //only delete instances if the show being edited was already repeating + //and the repeat type changed + if ($currentRepeatType != -1 && $repeatType != $currentRepeatType) { //repeat type changed $this->deleteAllInstances($showId); } else { @@ -513,12 +511,12 @@ DELETE FROM cc_show_instances WHERE starts > :timestamp::TIMESTAMP AND show_id = :showId - AND date(starts) != :firstShow + AND starts != :firstShow SQL; Application_Common_Database::prepareAndExecute( $sql, array( ':timestamp' => gmdate("Y-m-d H:i:s"), ':showId' => $showId, - ':firstShow' => $firstShow->format("Y-m-d")), 'execute'); + ':firstShow' => $firstShow->format("Y-m-d H:i:s")), 'execute'); } public function deleteAllInstances($showId) From a7601d290ff07ea344b9c15bf47bab910017968b Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 21 Mar 2013 10:05:11 -0400 Subject: [PATCH 028/128] CC-4961: Show linking Refactored services Removed ShowDaysService and ShowInstanceService Combined all show actions into one ShowService --- .../controllers/ScheduleController.php | 174 ++-- .../application/models/airtime/CcShow.php | 104 +++ .../application/models/airtime/CcShowDays.php | 24 + .../application/models/airtime/CcSubjs.php | 8 + .../application/services/CalendarService.php | 271 +----- .../application/services/ShowDaysService.php | 181 ---- .../application/services/ShowFormService.php | 334 ++++++++ .../services/ShowInstanceService.php | 614 -------------- .../application/services/ShowService.php | 800 +++++++++++++++++- .../public/js/airtime/schedule/schedule.js | 4 +- 10 files changed, 1308 insertions(+), 1206 deletions(-) delete mode 100644 airtime_mvc/application/services/ShowDaysService.php create mode 100644 airtime_mvc/application/services/ShowFormService.php delete mode 100644 airtime_mvc/application/services/ShowInstanceService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 87e3c4c4e..7f53fe798 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -5,7 +5,6 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; - private $service_calendar; private $currentUser; public function init() @@ -42,8 +41,6 @@ class ScheduleController extends Zend_Controller_Action $this->sched_sess = new Zend_Session_Namespace("schedule"); - $this->service_calendar = new Application_Service_CalendarService(); - $service_user = new Application_Service_UserService(); $this->currentUser = $service_user->getCurrentUser(); } @@ -534,65 +531,35 @@ class ScheduleController extends Zend_Controller_Action public function populateShowFormAction() { - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - - $showInstanceId = $this->_getParam('id'); + $showId = $this->_getParam('showId'); + $instanceId = $this->_getParam('instanceId'); + $service_showForm = new Application_Service_ShowFormService($showId, $instanceId); $this->view->action = "edit-show"; - try { - $showInstance = new Application_Model_ShowInstance($showInstanceId); - } catch (Exception $e) { - $this->view->show_error = true; - - return false; - } - - $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); - $isDJ = $user->isHostOfShow($showInstance->getShowId()); - - if (!($isAdminOrPM || $isDJ)) { - return; - } + $isAdminOrPM = $this->currentUser->isAdminOrPM(); + $isHostOfShow = $this->currentUser->isHostOfShow($showId); // in case a user was once a dj and had been assigned to a show // but was then changed to an admin user we need to allow // the user to edit the show as an admin (CC-4925) - if ($isDJ && !$isAdminOrPM) { + if ($isHostOfShow && !$isAdminOrPM) { $this->view->action = "dj-edit-show"; } - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formLive = new Application_Form_AddShowLiveStream(); + $forms = $this->createShowFormAction(); - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); + $service_showForm->delegateFormPopulation($forms); - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; - $this->view->live = $formLive; - $this->view->addNewShow = false; - - $show = new Application_Model_Show($showInstance->getShowId()); + /*$show = new Application_Model_Show($showInstance->getShowId()); $formWhat->populate(array('add_show_id' => $show->getId(), 'add_show_instance_id' => $showInstanceId, 'add_show_name' => $show->getName(), 'add_show_url' => $show->getUrl(), 'add_show_genre' => $show->getGenre(), - 'add_show_description' => $show->getDescription())); + 'add_show_description' => $show->getDescription()));*/ - $startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone("UTC")); + /*$startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone("UTC")); $endsDateTime = new DateTime($show->getEndDate()." ".$show->getEndTime(), new DateTimeZone("UTC")); $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); @@ -617,10 +584,10 @@ class ScheduleController extends Zend_Controller_Action $formWhen->getElement('add_show_end_date_no_repeat')->setValue($nextFutureRepeatShow["ends"]->format("Y-m-d")); $formWhen->getElement('add_show_end_time')->setValue($nextFutureRepeatShow["ends"]->format("H:i")); } - } + }*/ //need to get the days of the week in the php timezone (for the front end). - $days = array(); + /*$days = array(); $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find(); foreach ($showDays as $showDay) { $showStartDay = new DateTime($showDay->getDbFirstShow(), new DateTimeZone($showDay->getDbTimezone())); @@ -635,70 +602,53 @@ class ScheduleController extends Zend_Controller_Action $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(), 'add_show_day_check' => $days, 'add_show_end_date' => $displayedEndDate->format("Y-m-d"), - 'add_show_no_end' => ($show->getRepeatingEndDate() == ''))); + 'add_show_no_end' => ($show->getRepeatingEndDate() == '')));*/ - $hosts = array(); + /*$hosts = array(); $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find(); foreach ($showHosts as $showHost) { array_push($hosts, $showHost->getDbHost()); } - $formWho->populate(array('add_show_hosts' => $hosts)); - $formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), + $formWho->populate(array('add_show_hosts' => $hosts));*/ + + + /*$formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), 'add_show_color' => $show->getColor())); $formLive->populate($show->getLiveStreamInfo()); - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + $formRecord->populate(array('add_show_record' => $show->isRecorded(), + 'add_show_rebroadcast' => $show->isRebroadcast())); - $formRecord->removeDecorator('DtDdWrapper'); - $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); - $formRebroadcast->removeDecorator('DtDdWrapper'); - - $this->view->rr = $formRecord; - $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast; - $this->view->rebroadcast = $formRebroadcast; - - $formRecord->populate(array('add_show_record' => $show->isRecorded(), - 'add_show_rebroadcast' => $show->isRebroadcast())); - - $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true)); + $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));*/ - $rebroadcastsRelative = $show->getRebroadcastsRelative(); - $rebroadcastFormValues = array(); - $i = 1; - foreach ($rebroadcastsRelative as $rebroadcast) { - $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; - $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']); - $i++; - } - $formRebroadcast->populate($rebroadcastFormValues); - - $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute(); - $rebroadcastAbsoluteFormValues = array(); - $i = 1; - foreach ($rebroadcastsAbsolute as $rebroadcast) { - $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; - $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time']; - $i++; - } - $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); - if (!$isAdminOrPM) { - $formRecord->disable(); - $formAbsoluteRebroadcast->disable(); - $formRebroadcast->disable(); - } + /*$rebroadcastsRelative = $show->getRebroadcastsRelative(); + $rebroadcastFormValues = array(); + $i = 1; + foreach ($rebroadcastsRelative as $rebroadcast) { + $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; + $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']); + $i++; + } + $formRebroadcast->populate($rebroadcastFormValues);*/ +/* + $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute(); + $rebroadcastAbsoluteFormValues = array(); + $i = 1; + foreach ($rebroadcastsAbsolute as $rebroadcast) { + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; + $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time']; + $i++; + } + $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); if (!$isAdminOrPM) { - $formWhat->disable(); - $formWho->disable(); - $formWhen->disable(); - $formRepeats->disable(); - $formStyle->disable(); - } + foreach ($forms as $form) { + $form->disable(); + } + }*/ $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); $this->view->entries = 5; @@ -761,6 +711,10 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } + $service_showForm = new Application_Service_ShowFormService( + $data["add_show_id"]); + $service_show = new Application_Service_ShowService(); + //TODO: move this to js $data['add_show_hosts'] = $this->_getParam('hosts'); $data['add_show_day_check'] = $this->_getParam('days'); @@ -772,13 +726,13 @@ class ScheduleController extends Zend_Controller_Action $forms = $this->createShowFormAction(); list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) = - $this->service_calendar->preEditShowValidationCheck($data); + $service_showForm->preEditShowValidationCheck($data); - if ($this->service_calendar->validateShowForms($forms, $data, $validateStartDate, + if ($service_showForm->validateShowForms($forms, $data, $validateStartDate, $originalShowStartDateTime, true, $data["add_show_instance_id"])) { //pass in true to indicate we are updating a show - $this->service_calendar->addUpdateShow($data, true); + $service_show->addUpdateShow($data, true); $scheduler = new Application_Model_Scheduler(); $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); @@ -803,6 +757,9 @@ class ScheduleController extends Zend_Controller_Action public function addShowAction() { + $service_showForm = new Application_Service_ShowFormService(null); + $service_show = new Application_Service_ShowService(); + $js = $this->_getParam('data'); $data = array(); @@ -823,8 +780,8 @@ class ScheduleController extends Zend_Controller_Action $this->view->addNewShow = true; - if ($this->service_calendar->validateShowForms($forms, $data)) { - $this->service_calendar->addUpdateShow($data); + if ($service_showForm->validateShowForms($forms, $data)) { + $service_show->addUpdateShow($data); $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); //send new show forms to the user @@ -837,13 +794,16 @@ class ScheduleController extends Zend_Controller_Action } } - public function createShowFormAction($populate=false) + public function createShowFormAction($populateDefaults=false) { - $forms = $this->service_calendar->createShowForms(); + $service_showForm = new Application_Service_ShowFormService(); + + $forms = $service_showForm->createShowForms(); // populate forms with default values - if ($populate) { - $this->populateNewShowFormsAction($forms); + if ($populateDefaults) { + $service_showForm->populateNewShowForms( + $forms["what"], $forms["when"], $forms["repeats"]); } $this->view->what = $forms["what"]; @@ -859,12 +819,6 @@ class ScheduleController extends Zend_Controller_Action return $forms; } - public function populateNewShowFormsAction($forms) - { - $this->service_calendar->populateNewShowForms( - $forms["what"], $forms["when"], $forms["repeats"]); - } - public function cancelShowAction() { $user = Application_Model_User::getCurrentUser(); diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index ae37d289e..8100f455c 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -15,4 +15,108 @@ */ class CcShow extends BaseCcShow { + public function getCcShowDays(){ + return CcShowDaysQuery::create()->filterByDbShowId($this->getDbId())->find(); + } + + /** + * Gets an array of CcShowDays objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this CcShow is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @return PropelCollection|array CcShowDays[] List of CcShowDays objects + * @throws PropelException + */ + public function getFirstCcShowDay($criteria = null, PropelPDO $con = null) + { + if(null === $this->collCcShowDayss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcShowDayss) { + // return empty collection + $this->initCcShowDayss(); + } else { + $collCcShowDayss = CcShowDaysQuery::create(null, $criteria) + ->filterByCcShow($this) + ->orderByDbFirstShow() + ->limit(1) + ->find($con); + if (null !== $criteria) { + return $collCcShowDayss; + } + $this->collCcShowDayss = $collCcShowDayss; + } + } + return $this->collCcShowDayss[0]; + } + +/** + * Gets an array of CcShowInstances objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this CcShow is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects + * @throws PropelException + */ + public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null) + { + if(null === $this->collCcShowInstancess || null !== $criteria) { + if ($this->isNew() && null === $this->collCcShowInstancess) { + // return empty collection + $this->initCcShowInstancess(); + } else { + + $collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria) + ->filterByCcShow($this) + ->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN) + ->filterByDbModifiedInstance(false) + ->find($con); + if (null !== $criteria) { + return $collCcShowInstancess; + } + $this->collCcShowInstancess = $collCcShowInstancess; + } + } + return $this->collCcShowInstancess; + } + + public function isRecorded() + { + $ccShowInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getDbId()) + ->filterByDbRecord(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return (!is_null($ccShowInstances)); + } + + public function isRebroadcast() + { + $ccShowInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($this->getDbId()) + ->filterByDbRebroadcast(1) + ->filterByDbModifiedInstance(false) + ->findOne(); + + return (!is_null($ccShowInstances)); + } + + public function getRebroadcastsRelative() + { + return CcShowRebroadcastQuery::create() + ->filterByDbShowId($this->getDbId()) + ->orderByDbDayOffset() + ->find(); + } } // CcShow diff --git a/airtime_mvc/application/models/airtime/CcShowDays.php b/airtime_mvc/application/models/airtime/CcShowDays.php index 7dc9d98bd..4ed9bd6bc 100644 --- a/airtime_mvc/application/models/airtime/CcShowDays.php +++ b/airtime_mvc/application/models/airtime/CcShowDays.php @@ -40,4 +40,28 @@ class CcShowDays extends BaseCcShowDays { return $dt; } + + /** + * + * Enter description here ... + * @param DateTime $startDateTime first show in user's local time + */ + public function getLocalEndDateAndTime($startDateTime) + { + $duration = explode(":", $this->getDbDuration()); + + return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); + } + + public function isShowStartInPast() + { + return $this->getUTCStartDateAndTime() > gmdate("Y-m-d H:i:s"); + } + + public function formatDuration() + { + $info = explode(':',$this->getDbDuration()); + + return str_pad(intval($info[0]),2,'0',STR_PAD_LEFT).'h '.str_pad(intval($info[1]),2,'0',STR_PAD_LEFT).'m'; + } } // CcShowDays diff --git a/airtime_mvc/application/models/airtime/CcSubjs.php b/airtime_mvc/application/models/airtime/CcSubjs.php index c274e35c4..908adf554 100644 --- a/airtime_mvc/application/models/airtime/CcSubjs.php +++ b/airtime_mvc/application/models/airtime/CcSubjs.php @@ -19,4 +19,12 @@ class CcSubjs extends BaseCcSubjs { { return $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER; } + + public function isHostOfShow($showId) + { + return CcShowHostsQuery::create() + ->filterByDbShow($showId) + ->filterByDbHost($this->getDbId()) + ->count() > 0; + } } // CcSubjs diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 9988c149b..0541ed57b 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -2,278 +2,9 @@ class Application_Service_CalendarService { - private $service_show; - private $service_showDays; - private $service_showInstances; - private $service_user; - public function __construct() { - $this->service_show = new Application_Service_ShowService(); - $this->service_showInstances = new Application_Service_ShowInstanceService(); - $this->service_user = new Application_Service_UserService(); - } -/* - * Form stuff begins here - * Typically I would keep form creation and validation - * in the controller but since shows require 9 forms, - * the controller will become too fat. - * Maybe we should create a special form show service? - */ - /** - * - * @return array of schedule forms - */ - public function createShowForms() - { - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formLive = new Application_Form_AddShowLiveStream(); - $formRecord = new Application_Form_AddShowRR(); - $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); - $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); - - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); - $formLive->removeDecorator('DtDdWrapper'); - $formRecord->removeDecorator('DtDdWrapper'); - $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); - $formRebroadcast->removeDecorator('DtDdWrapper'); - - $forms = array(); - $forms["what"] = $formWhat; - $forms["who"] = $formWho; - $forms["when"] = $formWhen; - $forms["repeats"] = $formRepeats; - $forms["style"] = $formStyle; - $forms["live"] = $formLive; - $forms["record"] = $formRecord; - $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; - $forms["rebroadcast"] = $formRebroadcast; - - return $forms; - } - - /** - * - * Popluates the what, when, and repeat forms - * with default values - */ - public function populateNewShowForms($formWhat, $formWhen, $formRepeats) - { - $formWhat->populate( - array('add_show_id' => '-1', - 'add_show_instance_id' => '-1')); - - $formWhen->populate( - array('add_show_start_date' => date("Y-m-d"), - 'add_show_start_time' => '00:00', - 'add_show_end_date_no_repeate' => date("Y-m-d"), - 'add_show_end_time' => '01:00', - 'add_show_duration' => '01h 00m')); - - $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); - } - - public function populateForm($form, $values) - { - $form->populate($values); - } - - /** - * - * Validates show forms - * - * @return boolean - */ - public function validateShowForms($forms, $formData, $validateStartDate = true, - $originalStartDate=null, $editShow=false, $instanceId=null) - { - $what = $forms["what"]->isValid($formData); - $live = $forms["live"]->isValid($formData); - $record = $forms["record"]->isValid($formData); - $who = $forms["who"]->isValid($formData); - $style = $forms["style"]->isValid($formData); - $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate, - $originalStartDate, $editShow, $instanceId); - - $repeats = true; - if ($formData["add_show_repeats"]) { - $repeats = $forms["repeats"]->isValid($formData); - - /* - * Make the absolute rebroadcast form valid since - * it does not get used if the show is repeating - */ - $forms["abs_rebroadcast"]->reset(); - $absRebroadcast = true; - - $rebroadcast = true; - if ($formData["add_show_rebroadcast"]) { - $formData["add_show_duration"] = $this->formatShowDuration( - $formData["add_show_duration"]); - $rebroadcast = $forms["rebroadcast"]->isValid($formData); - } - } else { - /* - * Make the rebroadcast form valid since it does - * not get used if the show is not repeating. - * Instead, we use the absolute rebroadcast form - */ - $forms["rebroadcast"]->reset(); - $rebroadcast = true; - - $absRebroadcast = true; - if ($formData["add_show_rebroadcast"]) { - $formData["add_show_duration"] = $this->formatShowDuration( - $formData["add_show_duration"]); - $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); - } - } - - if ($what && $live && $record && $who && $style && $when && - $repeats && $absRebroadcast && $rebroadcast) { - return true; - } else { - return false; - } - } -/* - * Form stuff ends - */ - - public function formatShowDuration($duration) { - $hPos = strpos($duration, 'h'); - $mPos = strpos($duration, 'm'); - - $hValue = 0; - $mValue = 0; - - if ($hPos !== false) { - $hValue = trim(substr($duration, 0, $hPos)); - } - if ($mPos !== false) { - $hPos = $hPos === false ? 0 : $hPos+1; - $mValue = trim(substr($duration, $hPos, -1 )); - } - - return $hValue.":".$mValue; - } - - public function addUpdateShow($showData, $isUpdate=false) - { - //CcSubj object - $currentUser = $this->service_user->getCurrentUser(); - - $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; - $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; - $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; - - $showData["add_show_duration"] = $this->formatShowDuration( - $showData["add_show_duration"]); - - $con = Propel::getConnection(); - $con->beginTransaction(); - try { - if (!$currentUser->isAdminOrPM()) { - throw new Exception("Permission denied"); - } - //update ccShow - $ccShow = $this->service_show->setShow($showData, $isUpdate); - $showId = $ccShow->getDbId(); - - if ($isUpdate) { - $this->service_showInstances->deleteInvalidInstances($showData, $isRecorded, $repeatType); - // updates cc_show_instances start/end times, and updates - // schedule start/end times - $this->service_showInstances->applyShowStartEndDifference($showData, $showId); - $this->service_showInstances->deleteRebroadcastInstances($showId); - $this->service_showDays->deleteShowDays(); - $this->service_show->deleteShowHosts($showId); - if ($isRebroadcast) { - //delete entry in cc_show_rebroadcast - $this->service_show->deleteShowRebroadcasts($showId); - } - } - - //update ccShowDays - $this->service_showDays = new Application_Service_ShowDaysService($showId); - $this->service_showDays->setShowDays($showData, $repeatType, $isRecorded); - - //update ccShowRebroadcasts - $this->service_show->setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded); - - //update ccShowHosts - $this->service_show->setShowHosts($showData, $showId); - - //create new ccShowInstances - $this->service_showInstances->delegateShowInstanceCreation($showId, $isRebroadcast, $isUpdate); - - //after all instances have been deleted/updated, we need to update - //the schedule playout status - if ($isUpdate) { - $this->service_showInstances->updateScheduleStatus($showId); - } - - $con->commit(); - Application_Model_RabbitMq::PushSchedule(); - } catch (Exception $e) { - $con->rollback(); - $isUpdate ? $action = "update" : $action = "creation"; - Logging::info("EXCEPTION: Show ".$action." failed."); - Logging::info($e->getMessage()); - } - } - - /** - * - * Before we send the form data in for validation, there - * are a few fields we may need to adjust first - * @param $formData - */ - public function preEditShowValidationCheck($formData) { - $validateStartDate = true; - $validateStartTime = true; - $this->service_showDays = new Application_Service_ShowDaysService( - $formData["add_show_id"]); - - //CcShowDays object of the show currently being edited - $currentShowDay = $this->service_showDays->getCurrentShowDay(); - - if (!array_key_exists('add_show_start_date', $formData)) { - //Changing the start date was disabled, since the - //array key does not exist. We need to repopulate this entry from the db. - //The start date will be returned in UTC time, so lets convert it to local time. - $dt = Application_Common_DateHelper::ConvertToLocalDateTime( - $this->service_showDays->getStartDateAndTime()); - $formData['add_show_start_date'] = $dt->format("Y-m-d"); - - if (!array_key_exists('add_show_start_time', $formData)) { - $formData['add_show_start_time'] = $dt->format("H:i"); - $validateStartTime = false; - } - $validateStartDate = false; - } - $formData['add_show_record'] = $currentShowDay->getDbRecord(); - - //if the show is repeating, set the start date to the next - //repeating instance in the future - if ($currentShowDay->isRepeating()) { - $nextFutureRepeatShow = $this->service_showInstances - ->getNextFutureRepeatShowTime($formData["add_show_id"]); - $originalShowStartDateTime = $nextFutureRepeatShow["starts"]; - } else { - $originalShowStartDateTime = Application_Common_DateHelper::ConvertToLocalDateTime( - $this->service_showDays->getStartDateAndTime()); - } - - return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); + } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowDaysService.php b/airtime_mvc/application/services/ShowDaysService.php deleted file mode 100644 index 07616b552..000000000 --- a/airtime_mvc/application/services/ShowDaysService.php +++ /dev/null @@ -1,181 +0,0 @@ -showId = $id; - } - - /** - * - * Deletes all the cc_show_days entries for a specific show - * that is currently being edited. They will get recreated with - * the new show day specs - */ - public function deleteShowDays() - { - CcShowDaysQuery::create()->filterByDbShowId($this->showId)->delete(); - } - - /** - * - * Determines what the show end date should be based on - * the form data - * - * @param $showData add/edit show form data - * @return DateTime object in user's local timezone - */ - public function calculateEndDate($showData) - { - if ($showData['add_show_no_end']) { - $endDate = NULL; - } elseif ($showData['add_show_repeats']) { - $endDate = new DateTime($showData['add_show_end_date']); - $endDate->add(new DateInterval("P1D")); - } else { - $endDate = new DateTime($showData['add_show_start_date']); - $endDate->add(new DateInterval("P1D")); - } - - return $endDate; - } - - /** - * - * Sets the fields for a cc_show_days table row - * @param $showData - * @param $showId - * @param $userId - * @param $repeatType - * @param $isRecorded - * @param $showDay ccShowDay object we are setting values on - */ - public function setShowDays($showData, $repeatType, $isRecorded) - { - $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); - - $endDateTime = $this->calculateEndDate($showData); - if (!is_null($endDateTime)) { - $endDate = $endDateTime->format("Y-m-d"); - } else { - $endDate = $endDateTime; - } - - /* What we are doing here is checking if the show repeats or if - * any repeating days have been checked. If not, then by default - * the "selected" DOW is the initial day. - * DOW in local time. - */ - $startDow = date("w", $startDateTime->getTimestamp()); - if (!$showData['add_show_repeats']) { - $showData['add_show_day_check'] = array($startDow); - } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { - $showData['add_show_day_check'] = array($startDow); - } - - // Don't set day for monthly repeat type, it's invalid - if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { - $showDay = new CcShowDays(); - $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); - $showDay->setDbLastShow($endDate); - $showDay->setDbStartTime($startDateTime->format("H:i:s")); - $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); - $showDay->setDbDuration($showData['add_show_duration']); - $showDay->setDbRepeatType($repeatType); - $showDay->setDbShowId($this->showId); - $showDay->setDbRecord($isRecorded); - $showDay->save(); - } else { - foreach ($showData['add_show_day_check'] as $day) { - $daysAdd=0; - $startDateTimeClone = clone $startDateTime; - if ($startDow !== $day) { - if ($startDow > $day) - $daysAdd = 6 - $startDow + 1 + $day; - else - $daysAdd = $day - $startDow; - - $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); - } - if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { - $showDay = new CcShowDays(); - $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); - $showDay->setDbLastShow($endDate); - $showDay->setDbStartTime($startDateTimeClone->format("H:i")); - $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); - $showDay->setDbDuration($showData['add_show_duration']); - $showDay->setDbDay($day); - $showDay->setDbRepeatType($repeatType); - $showDay->setDbShowId($this->showId); - $showDay->setDbRecord($isRecorded); - $showDay->save(); - } - } - } - } - - /** - * - * Gets the cc_show_days entries for a specific show - * - * @return array of ccShowDays objects - */ - public function getShowDays() - { - return CcShowDaysQuery::create()->filterByDbShowId( - $this->showId)->find(); - } - - public function getStartDateAndTime() - { - //CcShowDays object - $showDay = $this->getCurrentShowDay(); - - $dt = new DateTime($showDay->getDbFirstShow()." ".$showDay->getDbStartTime(), - new DateTimeZone($showDay->getDbTimezone())); - $dt->setTimezone(new DateTimeZone("UTC")); - - return $dt->format("Y-m-d H:i"); - } - - /** - * - * Returns a CcShowDays object of the show that - * is currently being edited. - */ - public function getCurrentShowDay() - { - return CcShowDaysQuery::create()->filterByDbShowId($this->showId) - ->findOne(); - } - - public function getRepeatingEndDate() - { - $sql = << $this->showId ), 'column' ); - - return ($query !== false) ? $query : false; - } - - public function getNextStartDateTime($showDay) - { - $nextPopDate = $showDay->getDbNextPopDate(); - $startTime = $showDay->getDbStartTime(); - - if (isset($nextPopDate)) { - return $nextPopDate." ".$startTime; - } else { - return $showDay->getDbFirstShow()." ".$startTime; - } - } -} \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php new file mode 100644 index 000000000..38f4129ff --- /dev/null +++ b/airtime_mvc/application/services/ShowFormService.php @@ -0,0 +1,334 @@ +ccShow = CcShowQuery::create()->findPk($showId); + } + $this->instanceId = $instanceId; + } + + /** + * + * @return array of show forms + */ + public function createShowForms() + { + $formWhat = new Application_Form_AddShowWhat(); + $formWho = new Application_Form_AddShowWho(); + $formWhen = new Application_Form_AddShowWhen(); + $formRepeats = new Application_Form_AddShowRepeats(); + $formStyle = new Application_Form_AddShowStyle(); + $formLive = new Application_Form_AddShowLiveStream(); + $formRecord = new Application_Form_AddShowRR(); + $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); + $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); + + $formWhat->removeDecorator('DtDdWrapper'); + $formWho->removeDecorator('DtDdWrapper'); + $formWhen->removeDecorator('DtDdWrapper'); + $formRepeats->removeDecorator('DtDdWrapper'); + $formStyle->removeDecorator('DtDdWrapper'); + $formLive->removeDecorator('DtDdWrapper'); + $formRecord->removeDecorator('DtDdWrapper'); + $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); + $formRebroadcast->removeDecorator('DtDdWrapper'); + + $forms = array(); + $forms["what"] = $formWhat; + $forms["who"] = $formWho; + $forms["when"] = $formWhen; + $forms["repeats"] = $formRepeats; + $forms["style"] = $formStyle; + $forms["live"] = $formLive; + $forms["record"] = $formRecord; + $forms["abs_rebroadcast"] = $formAbsoluteRebroadcast; + $forms["rebroadcast"] = $formRebroadcast; + + return $forms; + } + + /** + * + * Popluates the what, when, and repeat forms + * with default values + */ + public function populateNewShowForms($formWhat, $formWhen, $formRepeats) + { + $formWhat->populate( + array('add_show_id' => '-1', + 'add_show_instance_id' => '-1')); + + $formWhen->populate( + array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '00:00', + 'add_show_end_date_no_repeate' => date("Y-m-d"), + 'add_show_end_time' => '01:00', + 'add_show_duration' => '01h 00m')); + + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + } + + /** + * + * Delegates populating each show form with the appropriate + * data of the current show being edited + * + * @param $forms + */ + public function delegateFormPopulation($forms) + { + $this->populateFormWhat($forms["what"]); + $this->populateFormWhen($forms["when"]); + $this->populateFormRepeats($forms["repeats"]); + $this->populateFormWho($forms["who"]); + $this->populateFormStyle($forms["style"]); + $this->populateFormRecord($forms["record"]); + $this->populateFormRebroadcastRelative($forms["rebroadcast"]); + } + + private function populateFormWhat($form) + { + $form->populate( + array( + 'add_show_instance_id' => $this->instanceId, + 'add_show_id' => $this->ccShow->getDbId(), + 'add_show_name' => $this->ccShow->getDbName(), + 'add_show_url' => $this->ccShow->getDbUrl(), + 'add_show_genre' => $this->ccShow->getDbGenre(), + 'add_show_description' => $this->ccShow->getDbDescription())); + } + + private function populateFormWhen($form) + { + $ccShowDay = $this->ccShow->getFirstCcShowDay(); + + $showStart = $ccShowDay->getLocalStartDateAndTime(); + $showEnd = $ccShowDay->getLocalEndDateAndTime($showStart); + + //check if the first show is in the past + if ($ccShowDay->isShowStartInPast()) { + //for a non-repeating show, we should never allow user to change the start time. + //for a repeating show, we should allow because the form works as repeating template form + if (!$ccShowDay->isRepeating()) { + $form->disableStartDateAndTime(); + } else { + list($showStart, $showEnd) = $this->getNextFutureRepeatShowTime(); + } + } + + $form->populate( + array( + 'add_show_start_date' => $showStart->format("Y-m-d"), + 'add_show_start_time' => $showStart->format("H:i"), + 'add_show_end_date_no_repeat' => $showEnd->format("Y-m-d"), + 'add_show_end_time' => $showEnd->format("H:i"), + 'add_show_duration' => $ccShowDay->formatDuration(true), + 'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0)); + } + + private function populateFormRepeats($form) + { + $ccShowDays = $this->ccShow->getCcShowDays(); + + $days = array(); + foreach ($ccShowDays as $ccShowDay) { + $showStart = $ccShowDay->getLocalStartDateAndTime(); + array_push($days, $showStart->format("w")); + } + + $service_show = new Application_Service_ShowService($this->ccShow->getDbId()); + $repeatEndDate = new DateTime($service_show->getRepeatingEndDate(), new DateTimeZone( + $ccShowDays[0]->getDbTimezone())); + //end dates are stored non-inclusively so we need to + //subtract one day + $repeatEndDate->sub(new DateInterval("P1D")); + + $form->populate( + array( + 'add_show_repeat_type' => $ccShowDays[0]->getDbRepeatType(), + 'add_show_day_check' => $days, + 'add_show_end_date' => $repeatEndDate->format("Y-m-d"), + 'add_show_no_end' => (!$service_show->getRepeatingEndDate()))); + } + + private function populateFormWho($form) + { + $ccShowHosts = $this->ccShow->getCcShowHostss(); + + $hosts = array(); + foreach ($ccShowHosts as $ccShowHost) { + array_push($hosts, $ccShowHost->getDbHost()); + } + + $form->populate(array('add_show_hosts' => $hosts)); + } + + private function populateFormStyle($form) + { + $form->populate( + array( + 'add_show_background_color' => $this->ccShow->getDbBackgroundColor(), + 'add_show_color' => $this->ccShow->getDbColor())); + } + + private function populateFormRecord($form) + { + $form->populate( + array( + 'add_show_record' => $this->ccShow->isRecorded(), + 'add_show_rebroadcast' => $this->ccShow->isRebroadcast())); + + $form->getElement('add_show_record')->setOptions(array('disabled' => true)); + } + + public function populateFormRebroadcastRelative($form) + { + $relativeRebroadcasts = $this->ccShow->getRebroadcastsRelative(); + + $formValues = array(); + $i = 1; + foreach ($relativeRebroadcasts as $rr) { + $formValues["add_show_rebroadcast_date_$i"] = $rr->getDbDayOffset(); + $formValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime( + $rr->getDbStartTime()); + $i++; + } + + $form->populate($formValues); + } + + /** + * + * Before we send the form data in for validation, there + * are a few fields we may need to adjust first + * @param $formData + */ + public function preEditShowValidationCheck($formData) + { + $validateStartDate = true; + $validateStartTime = true; + + //CcShowDays object of the show currently being edited + $currentShowDay = $this->ccShow->getFirstCcShowDay(); + + //DateTime object + $dt = $currentShowDay->getLocalStartDateAndTime(); + + if (!array_key_exists('add_show_start_date', $formData)) { + //Changing the start date was disabled, since the + //array key does not exist. We need to repopulate this entry from the db. + $formData['add_show_start_date'] = $dt->format("Y-m-d"); + + if (!array_key_exists('add_show_start_time', $formData)) { + $formData['add_show_start_time'] = $dt->format("H:i"); + $validateStartTime = false; + } + $validateStartDate = false; + } + $formData['add_show_record'] = $currentShowDay->getDbRecord(); + + //if the show is repeating, set the start date to the next + //repeating instance in the future + if ($currentShowDay->isRepeating()) { + list($originalShowStartDateTime,) = $this->getNextFutureRepeatShowTime(); + } else { + $originalShowStartDateTime = $dt; + } + + return array($formData, $validateStartDate, $validateStartTime, $originalShowStartDateTime); + } + + /** + * + * Returns 2 DateTime objects, in the user's local time, + * of the next future repeat show instance start and end time + */ + private function getNextFutureRepeatShowTime() + { + $sql = << now() at time zone 'UTC' +AND show_id = :showId +ORDER BY starts +LIMIT 1 +SQL; + $result = Application_Common_Database::prepareAndExecute( $sql, + array( 'showId' => $this->ccShow->getDbId() ), 'all' ); + + foreach ($result as $r) { + $starts = new DateTime($r["starts"], new DateTimeZone('UTC')); + $ends = new DateTime($r["ends"], new DateTimeZone('UTC')); + } + + $userTimezone = Application_Model_Preference::GetTimezone(); + + $starts->setTimezone(new DateTimeZone($userTimezone)); + $ends->setTimezone(new DateTimeZone($userTimezone)); + + return array($starts, $ends); + } + + /** + * + * Validates show forms + * + * @return boolean + */ + public function validateShowForms($forms, $formData, $validateStartDate = true, + $originalStartDate=null, $editShow=false, $instanceId=null) + { + $what = $forms["what"]->isValid($formData); + $live = $forms["live"]->isValid($formData); + $record = $forms["record"]->isValid($formData); + $who = $forms["who"]->isValid($formData); + $style = $forms["style"]->isValid($formData); + $when = $forms["when"]->isWhenFormValid($formData, $validateStartDate, + $originalStartDate, $editShow, $instanceId); + + $repeats = true; + if ($formData["add_show_repeats"]) { + $repeats = $forms["repeats"]->isValid($formData); + + /* + * Make the absolute rebroadcast form valid since + * it does not get used if the show is repeating + */ + $forms["abs_rebroadcast"]->reset(); + $absRebroadcast = true; + + $rebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = Application_Service_ShowService::formatShowDuration( + $formData["add_show_duration"]); + $rebroadcast = $forms["rebroadcast"]->isValid($formData); + } + } else { + /* + * Make the rebroadcast form valid since it does + * not get used if the show is not repeating. + * Instead, we use the absolute rebroadcast form + */ + $forms["rebroadcast"]->reset(); + $rebroadcast = true; + + $absRebroadcast = true; + if ($formData["add_show_rebroadcast"]) { + $formData["add_show_duration"] = Application_Service_ShowService::formatShowDuration( + $formData["add_show_duration"]); + $absRebroadcast = $forms["abs_rebroadcast"]->isValid($formData); + } + } + + if ($what && $live && $record && $who && $style && $when && + $repeats && $absRebroadcast && $rebroadcast) { + return true; + } else { + return false; + } + } +} \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowInstanceService.php b/airtime_mvc/application/services/ShowInstanceService.php deleted file mode 100644 index bf9d2b392..000000000 --- a/airtime_mvc/application/services/ShowInstanceService.php +++ /dev/null @@ -1,614 +0,0 @@ -service_show = new Application_Service_ShowService(); - $this->service_user = new Application_Service_UserService(); - } - - /** - * - * Receives a cc_show id and determines whether to create a - * single show instance or repeating show instances - */ - public function delegateShowInstanceCreation($showId, $isRebroadcast, $isUpdate) - { - $populateUntil = $this->service_show->getPopulateShowUntilDateTIme(); - - $this->service_showDays = new Application_Service_ShowDaysService($showId); - $showDays = $this->service_showDays->getShowDays(); - - foreach ($showDays as $day) { - switch ($day->getDbRepeatType()) { - case NO_REPEAT: - $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast, $isUpdate); - break; - case REPEAT_WEEKLY: - $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); - break; - case REPEAT_BI_WEEKLY: - $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast); - break; - case REPEAT_MONTHLY_MONTHLY: - $this->createMonthlyRepeatingShowInstances($day, $populateUntil, "P1M", $isRebroadcast); - break; - case REPEAT_MONTHLY_WEEKLY: - // do something here - break; - } - } - Application_Model_RabbitMq::PushSchedule(); - } - - /** - * - * Sets a single cc_show_instance table row - * @param $showDay - * @param $populateUntil - */ - private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast, $isUpdate) - { - $start = $showDay->getDbFirstShow()." ".$showDay->getDbStartTime(); - - list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $start, $showDay->getDbDuration(), $showDay->getDbTimezone()); - - if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { - $ccShowInstance = new CcShowInstances(); - if ($isUpdate) { - $ccShowInstance = $this->getInstance($utcStartDateTime, $showDay->getDbShowId()); - } - $ccShowInstance->setDbShowId($showDay->getDbShowId()); - $ccShowInstance->setDbStarts($utcStartDateTime); - $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord($showDay->getDbRecord()); - $ccShowInstance->save(); - - if ($isRebroadcast) { - $this->createRebroadcastShowInstances($showDay, $start, $ccShowInstance->getDbId()); - } - } - } - - /** - * - * Sets multiple cc_show_instances table rows - * @param unknown_type $showDay - * @param unknown_type $populateUntil - * @param unknown_type $repeatInterval - * @param unknown_type $isRebroadcast - */ - private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, - $repeatInterval, $isRebroadcast, $isUpdate) - { - $show_id = $showDay->getDbShowId(); - $first_show = $showDay->getDbFirstShow(); //non-UTC - $last_show = $showDay->getDbLastShow(); //non-UTC - $duration = $showDay->getDbDuration(); - $day = $showDay->getDbDay(); - $record = $showDay->getDbRecord(); - $timezone = $showDay->getDbTimezone(); - - $start = $this->service_showDays->getNextStartDateTime($showDay); - - $datePeriod = $this->getDatePeriod($start, $timezone, $last_show, - $repeatInterval, $populateUntil); - - $utcLastShowDateTime = $last_show ? - Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; - - $utcEndDateTime = null; - foreach ($datePeriod as $date) { - list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $date->format("Y-m-d H:i:s"), $duration, $timezone); - /* - * Make sure start date is less than populate until date AND - * last show date is null OR start date is less than last show date - */ - if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && - ( is_null($utcLastShowDateTime) || - $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { - - /* There may not always be an instance when editing a show - * This will be the case when we are adding a new show day to - * a repeating show - */ - if ($isUpdate && $this->hasInstance($utcStartDateTime, $show_id)) { - $ccShowInstance = $this->getInstance($utcStartDateTime, $show_id); - $newInstance = false; - } else { - $newInstance = true; - $ccShowInstance = new CcShowInstances(); - } - - /* When editing the start/end time of a repeating show, we don't want to - * change shows that started in the past. So check the start time. - */ - if ($newInstance || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { - $ccShowInstance->setDbShowId($show_id); - $ccShowInstance->setDbStarts($utcStartDateTime); - $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord($record); - $ccShowInstance->save(); - } - - if ($isRebroadcast) { - $this->createRebroadcastInstances($showDay, $date->format("Y-m-d"), $ccShowInstance->getDbId()); - } - } - } - $nextDate = $utcEndDateTime->add(new DateInterval($repeatInterval)); - $this->service_show->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $show_id, $day); - } - - /** - * - * Enter description here ... - * @param $showDay - */ - private function createRebroadcastInstances($showDay, $showStartDate, $instanceId) - { - $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); - $showId = $showDay->getDbShowId(); - - $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; - $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, - array( ':show_id' => $showId ), 'all'); - - foreach ($rebroadcasts as $rebroadcast) { - $days = explode(" ", $rebroadcast["day_offset"]); - $time = explode(":", $rebroadcast["start_time"]); - $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); - - list($utcStartDateTime, $utcEndDateTime) = $this->service_show->createUTCStartEndDateTime( - $showStartDate, $showDay->getDbDuration(), $showDay->getDbTimezone(), $offset); - - if ($utcStartDateTime->format("Y-m-d H:i:s") > $currentUtcTimestamp) { - $ccShowInstance = new CcShowInstances(); - $ccShowInstance->setDbShowId($showId); - $ccShowInstance->setDbStarts($utcStartDateTime); - $ccShowInstance->setDbEnds($utcEndDateTime); - $ccShowInstance->setDbRecord(0); - $ccShowInstance->setDbRebroadcast(1); - $ccShowInstance->setDbOriginalShow($instanceId); - $ccShowInstance->save(); - } - } - } - - public function updateScheduleStatus($showId) - { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); - $instances = CcShowInstancesQuery::create() - ->filterByDbEnds(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN) - ->filterByDbShowId($showId) - ->find(); - - foreach ($instances as $instance) { - $instance->updateScheduleStatus($con); - } - } - - public function deleteRebroadcastInstances($showId) - { - $sql = << :timestamp::TIMESTAMP -AND show_id = :showId -AND rebroadcast = 1; -SQL; - Application_Common_Database::prepareAndExecute( $sql, array( - ':showId' => $showId, - ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); - } - - /** - * - * Create a DatePeriod object in the user's local time - * It will get converted to UTC before the show instance gets created - */ - private function getDatePeriod($start, $timezone, $lastShow, $repeatInterval, $populateUntil) - { - if (isset($lastShow)) { - $endDatePeriod = new DateTime($lastShow, new DateTimeZone($timezone)); - } else { - $endDatePeriod = $populateUntil; - } - - return new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), - new DateInterval($repeatInterval), $endDatePeriod); - } - - /** - * - * Returns 2 DateTime objects, in the user's local time, - * of the next future repeat show instance start and end time - */ - public function getNextFutureRepeatShowTime($showId) - { - $sql = << now() at time zone 'UTC' -AND show_id = :showId -ORDER BY starts -LIMIT 1 -SQL; - $result = Application_Common_Database::prepareAndExecute( $sql, - array( 'showId' => $showId ), 'all' ); - - foreach ($result as $r) { - $show["starts"] = new DateTime($r["starts"], new DateTimeZone('UTC')); - $show["ends"] = new DateTime($r["ends"], new DateTimeZone('UTC')); - } - - $userTimezone = Application_Model_Preference::GetUserTimezone( - $this->service_user->getCurrentUser()->getDbId()); - - $show["starts"]->setTimezone(new DateTimeZone($userTimezone)); - $show["ends"]->setTimezone(new DateTimeZone($userTimezone)); - - return $show; - } - - /** - * - * Returns all the show instances of the show currently - * being edited. - * @param $showId - */ - public function getCurrentInstances($showId) - { - return CcShowInstancesQuery::create() - ->filterByDbShowId($showId) - ->filterByDbModifiedInstance(false) - ->orderBy("starts"); - } - - /** - * - * Attempts to retrieve the cc_show_instance belonging to a cc_show - * that starts at $starts. We have to pass in the start - * time in case the show is repeating - * - * Returns the instance if one was found (one that is not a recording - * and modified instance is false (has not been deleted)) - */ - public function getInstance($starts, $showId) - { - $ccShowInstance = CcShowInstancesQuery::create() - ->filterByDbStarts($starts->format("Y-m-d H:i:s"), Criteria::EQUAL) - ->filterByDbShowId($showId, Criteria::EQUAL) - ->filterByDbModifiedInstance(false, Criteria::EQUAL) - ->filterByDbRebroadcast(0, Criteria::EQUAL) - ->limit(1) - ->find(); - - if ($ccShowInstance->isEmpty()) { - return false; - } else { - return $ccShowInstance[0]; - } - } - - public function hasInstance($starts, $showId) - { - return $this->getInstance($starts, $showId) ? true : false; - } - - public function getAllFutureInstanceIds($showId) - { - $sql = << :timestamp::TIMESTAMP - AND modified_instance != TRUE -SQL; - $rows = Application_Common_Database::prepareAndExecute($sql, - array( ':showId' => $showId, - ':timestamp' => gmdate("Y-m-d H:i:s")), "all"); - - $ids = array(); - foreach ($ids as $id) { - $ids[] = $id['id']; - } - return $ids; - } - - /** - * - * Returns the difference in seconds between a show's new and - * old start time - * - * @param $newStartDateTime DateTime object - * @param $oldStartDateTime DateTime object - */ - public function calculateShowStartDiff($newStartDateTime, $oldStartDateTime) - { - return $newStartDateTime->getTimestamp() - $oldStartDateTime->getTimestamp(); - } - - /** - * TODO: This function is messy. Needs refactoring - * - * When editing a show we may need to perform some actions to reflect the new specs: - * - Delete some show instances - * - Update duration - * - Update start and end time - * - * @param $showData edit show form values in raw form - * @param $isRecorded value computed from the edit show form - * @param $repeatType value computed from the edit show form - */ - public function deleteInvalidInstances($showData, $isRecorded, $repeatType) - { - $showId = $showData["add_show_id"]; - - $this->service_showDays = new Application_Service_ShowDaysService($showId); - //ccShowDays object of the show being edited - $currentShowDay = $this->service_showDays->getCurrentShowDay(); - - //new end date in users' local time - $endDateTime = $this->service_showDays->calculateEndDate($showData); - if (!is_null($endDateTime)) { - $endDate = $endDateTime->format("Y-m-d"); - } else { - $endDate = $endDateTime; - } - - //repeat option was toggled - if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) { - $this->deleteAllRepeatInstances($currentShowDay, $showId); - } - - if ($showData['add_show_repeats']) { - - $localShowStart = $currentShowDay->getLocalStartDateAndTime(); - - //if the start date changes, these are the repeat types - //that require show instance deletion - $deleteRepeatTypes = array(REPEAT_BI_WEEKLY, REPEAT_MONTHLY_MONTHLY, - REPEAT_MONTHLY_WEEKLY); - - if (in_array($repeatType, $deleteRepeatTypes) && - $showData["add_show_start_date"] != $localShowStart->format("Y-m-d")) { - - //Start date has changed when repeat type is bi-weekly or monthly. - //This screws up the repeating positions of show instances, so - //we need to delete them (CC-2351) - $this->deleteAllInstances($showId); - } - - $currentRepeatType = $currentShowDay->getDbRepeatType(); - //only delete instances if the show being edited was already repeating - //and the repeat type changed - if ($currentRepeatType != -1 && $repeatType != $currentRepeatType) { - //repeat type changed - $this->deleteAllInstances($showId); - } else { - //repeat type is the same, check if the days of the week are the same - $repeatingDaysChanged = false; - - $ccShowDays = $this->service_showDays->getShowDays(); - $showDays = array(); - foreach ($ccShowDays as $day) { - $showDays[] = $day->getDbDay(); - } - - if (count($showData['add_show_day_check']) == count($showDays)) { - //same number of days checked, lets see if they are the same numbers - $intersect = array_intersect($showData['add_show_day_check'], $showDays); - if (count($intersect) != count($showData['add_show_day_check'])) { - $repeatingDaysChanged = true; - } - } else { - $repeatingDaysChanged = true; - } - - if ($repeatingDaysChanged) { - $daysRemoved = array_diff($showDays, $showData['add_show_day_check']); - - if (count($daysRemoved) > 0) { - //delete repeating show instances for the repeating - //days that were removed - $this->deleteRemovedShowDayInstances($daysRemoved, - $ccShowDays, $showId); - } - } - - if ($showData['add_show_start_date'] != $localShowStart->format("Y-m-d") - || $showData['add_show_start_time'] != $localShowStart->format("H:i")) { - - //start date has been pushed forward so we need to delete - //any instances of this show scheduled before the new start date - if ($showData['add_show_start_date'] > $localShowStart->format("Y-m-d")) { - $this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId); - } - - - } - } - - $currentShowEndDate = $this->service_showDays->getRepeatingEndDate(); - //check if "no end" option has changed - if ($currentShowEndDate != $showData['add_show_no_end']) { - //show "No End" option was toggled - if (!$showData['add_show_no_end']) { - //"No End" option was unchecked so we need to delete the - //repeat instances that are scheduled after the new end date - $this->deleteInstancesFromDate($endDate, $showId); - } - } - - if ($currentShowEndDate != $showData['add_show_end_date']) { - //end date was changed - $newEndDate = strtotime($showData['add_show_end_date']); - $oldEndDate = strtotime($currentShowEndDate); - if ($newEndDate < $oldEndDate) { - //end date was pushed back so we have to delete any - //instances of this show scheduled after the new end date - $this->deleteInstancesFromDate($endDate, $showId); - } - } - }//if repeats - } - - public function applyShowStartEndDifference($showData, $showId) - { - $currentShowDay = $this->service_showDays->getCurrentShowDay(); - - $newStartDateTime = new DateTime($showData["add_show_start_date"]." ". - $showData["add_show_start_time"], - new DateTimeZone(Application_Model_Preference::GetTimezone())); - - $diff = $this->calculateShowStartDiff($newStartDateTime, - $currentShowDay->getLocalStartDateAndTime()); - - $this->updateInstanceStartEndTime($showId, $diff); - $instanceIds = $this->getAllFutureInstanceIds($showId); - Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff); - } - - /** - * - * Updates the start and end time for cc_show_instances - * - * @param $showData edit show form data - */ - public function updateInstanceStartEndTime($showId, $diff) - { - $sql = << :timestamp::TIMESTAMP -SQL; - - Application_Common_Database::prepareAndExecute($sql, - array(':diff1' => $diff, ':diff2' => $diff, - ':showId' => $showId, ':timestamp' => gmdate("Y-m-d H:i:s")), - 'execute'); - } - - public function deleteAllRepeatInstances($currentShowDay, $showId) - { - $firstShow = $currentShowDay->getUTCStartDateAndTime(); - - $sql = << :timestamp::TIMESTAMP - AND show_id = :showId - AND starts != :firstShow -SQL; - Application_Common_Database::prepareAndExecute( $sql, - array( ':timestamp' => gmdate("Y-m-d H:i:s"), - ':showId' => $showId, - ':firstShow' => $firstShow->format("Y-m-d H:i:s")), 'execute'); - } - - public function deleteAllInstances($showId) - { - $sql = << :timestamp::TIMESTAMP - AND show_id = :showId -SQL; - Application_Common_Database::prepareAndExecute( $sql, - array( ':timestamp' => gmdate("Y-m-d H:i:s"), - ':showId' => $showId), 'execute'); - } - - /** - * - * Enter description here ... - * @param $daysRemoved array of days (days of the week) removed - * (days of the week are represented numerically - * 0=>sunday, 1=>monday, 2=>tuesday, etc.) - * @param $showDays array of ccShowDays objects - * @param $showId - */ - public function deleteRemovedShowDayInstances($daysRemoved, $showDays, $showId) - { - $daysRemovedUTC = array(); - - //convert the start day of the week to UTC - foreach ($showDays as $showDay) { - if (in_array($showDay->getDbDay(), $daysRemoved)) { - $showDay->reload(); - $startDay = $showDay->getUTCStartDateAndTime(); - $daysRemovedUTC[] = $startDay->format('w'); - } - } - - $uncheckedDays = pg_escape_string(implode(",", $daysRemovedUTC)); - - $sql = << :timestamp::TIMESTAMP - AND show_id = :showId -SQL; - - Application_Common_Database::prepareAndExecute( $sql, array( - ":timestamp" => gmdate("Y-m-d H:i:s"), ":showId" => $showId), - "execute"); - } - - public function deleteInstancesBeforeDate($newStartDate, $showId) - { - $sql = << :timestamp::TIMESTAMP - AND show_id = :showId -SQL; - - Application_Common_Database::prepareAndExecute($sql, array( - ":newStartDate" => $newStartDate, ":timestamp" => gmdate("Y-m-d H:i:s"), - ":showId" => $showId), "execute"); - } - - public function deleteInstancesFromDate($endDate, $showId) - { - $sql = <<= :endDate::DATE - AND starts > :timestamp::TIMESTAMP - AND show_id = :showId -SQL; - Application_Common_Database::prepareAndExecute($sql, array( - ':endDate' => $endDate, ':timestamp' => gmdate("Y-m-d H:i:s"), - ':showId' => $showId), 'execute'); - } - -/* public function updateInstanceDuration($showData) - { - $sql = << :timestamp::TIMESTAMP -SQL; - - Application_Common_Database::prepareAndExecute( $sql, array( - ':add_show_duration' => $showData['add_show_duration'], - ':show_id' => $showData['add_show_id'], - ':timestamp' => gmdate("Y-m-d H:i:s")), "execute"); - }*/ -} \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 7747a32af..746264bdf 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -1,8 +1,681 @@ ccShow = CcShowQuery::create()->findPk($showId); + } + + $service_user = new Application_Service_UserService(); + $this->currentUser = $service_user->getCurrentUser(); + } + + public function addUpdateShow($showData, $isUpdate=false) + { + $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; + $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + $con = Propel::getConnection(); + $con->beginTransaction(); + try { + if (!$this->currentUser->isAdminOrPM()) { + throw new Exception("Permission denied"); + } + //update ccShow + $this->setCcShow($showData, $isUpdate); + + if ($isUpdate) { + $this->delegateInstanceCleanup($showData, $isRecorded, $repeatType); + // updates cc_show_instances start/end times, and updates + // schedule start/end times + $this->applyShowStartEndDifference($showData); + $this->deleteRebroadcastInstances(); + $this->deleteCcShowDays(); + $this->deleteCcShowHosts(); + if ($isRebroadcast) { + //delete entry in cc_show_rebroadcast + $this->deleteCcShowRebroadcasts(); + } + } + + //update ccShowDays + $this->setCcShowDays($showData, $repeatType, $isRecorded); + + //update ccShowRebroadcasts + $this->setCcShowRebroadcasts($showData, $repeatType, $isRecorded); + + //update ccShowHosts + $this->setCcShowHosts($showData); + + //create new ccShowInstances + $this->delegateInstanceCreation($isRebroadcast, $isUpdate); + + $con->commit(); + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + $con->rollback(); + $isUpdate ? $action = "update" : $action = "creation"; + Logging::info("EXCEPTION: Show ".$action." failed."); + Logging::info($e->getMessage()); + } + } + + /** + * + * Receives a cc_show id and determines whether to create a + * single show instance or repeating show instances + */ + private function delegateInstanceCreation($isRebroadcast, $isUpdate) + { + $populateUntil = $this->getPopulateShowUntilDateTIme(); + + $ccShowDays = $this->ccShow->getCcShowDays(); + + foreach ($ccShowDays as $day) { + switch ($day->getDbRepeatType()) { + case NO_REPEAT: + $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast, $isUpdate); + break; + case REPEAT_WEEKLY: + $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); + break; + case REPEAT_BI_WEEKLY: + $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast, $isUpdate); + break; + case REPEAT_MONTHLY_MONTHLY: + $this->createMonthlyRepeatingShowInstances($day, $populateUntil, "P1M", $isRebroadcast); + break; + case REPEAT_MONTHLY_WEEKLY: + // do something here + break; + } + } + } + + public static function formatShowDuration($duration) + { + $hPos = strpos($duration, 'h'); + $mPos = strpos($duration, 'm'); + + $hValue = 0; + $mValue = 0; + + if ($hPos !== false) { + $hValue = trim(substr($duration, 0, $hPos)); + } + if ($mPos !== false) { + $hPos = $hPos === false ? 0 : $hPos+1; + $mValue = trim(substr($duration, $hPos, -1 )); + } + + return $hValue.":".$mValue; + } + + /** + * + * Deletes all the cc_show_days entries for a specific show + * that is currently being edited. They will get recreated with + * the new show day specs + */ + private function deleteCcShowDays() + { + CcShowDaysQuery::create()->filterByDbShowId($this->ccShow->getDbId())->delete(); + } + + private function deleteRebroadcastInstances() + { + $sql = << :timestamp::TIMESTAMP +AND show_id = :showId +AND rebroadcast = 1; +SQL; + Application_Common_Database::prepareAndExecute( $sql, array( + ':showId' => $this->ccShow->getDbId(), + ':timestamp' => gmdate("Y-m-d H:i:s")), 'execute'); + } + + /** + * TODO: This function is messy. Needs refactoring + * + * When editing a show we may need to perform some actions to reflect the new specs: + * - Delete some show instances + * - Update duration + * - Update start and end time + * + * @param $showData edit show form values in raw form + * @param $isRecorded value computed from the edit show form + * @param $repeatType value computed from the edit show form + */ + private function delegateInstanceCleanup($showData, $isRecorded, $repeatType) + { + $showId = $this->ccShow->getDbId(); + + //CcShowDay object + $currentShowDay = $this->ccShow->getFirstCcShowDay(); + + //new end date in users' local time + $endDateTime = $this->calculateEndDate($showData); + if (!is_null($endDateTime)) { + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDate = $endDateTime; + } + + //repeat option was toggled + if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) { + $this->deleteAllRepeatInstances($currentShowDay, $showId); + } + + if ($showData['add_show_repeats']) { + + $localShowStart = $currentShowDay->getLocalStartDateAndTime(); + + //if the start date changes, these are the repeat types + //that require show instance deletion + $deleteRepeatTypes = array(REPEAT_BI_WEEKLY, REPEAT_MONTHLY_MONTHLY, + REPEAT_MONTHLY_WEEKLY); + + if (in_array($repeatType, $deleteRepeatTypes) && + $showData["add_show_start_date"] != $localShowStart->format("Y-m-d")) { + + //Start date has changed when repeat type is bi-weekly or monthly. + //This screws up the repeating positions of show instances, so + //we need to delete them (CC-2351) + $this->deleteAllInstances($showId); + } + + $currentRepeatType = $currentShowDay->getDbRepeatType(); + //only delete instances if the show being edited was already repeating + //and the repeat type changed + if ($currentRepeatType != -1 && $repeatType != $currentRepeatType) { + $this->deleteAllInstances($showId); + } else { + //repeat type is the same, check if the days of the week are the same + $repeatingDaysChanged = false; + + $ccShowDays = $this->ccShow->getCcShowDays(); + $showDays = array(); + foreach ($ccShowDays as $day) { + $showDays[] = $day->getDbDay(); + } + + if (count($showData['add_show_day_check']) == count($showDays)) { + //same number of days checked, lets see if they are the same numbers + $intersect = array_intersect($showData['add_show_day_check'], $showDays); + if (count($intersect) != count($showData['add_show_day_check'])) { + $repeatingDaysChanged = true; + } + } else { + $repeatingDaysChanged = true; + } + + if ($repeatingDaysChanged) { + $daysRemoved = array_diff($showDays, $showData['add_show_day_check']); + + if (count($daysRemoved) > 0) { + //delete repeating show instances for the repeating + //days that were removed + $this->deleteRemovedShowDayInstances($daysRemoved, + $ccShowDays, $showId); + } + } + + if ($showData['add_show_start_date'] != $localShowStart->format("Y-m-d") + || $showData['add_show_start_time'] != $localShowStart->format("H:i")) { + + //start date has been pushed forward so we need to delete + //any instances of this show scheduled before the new start date + if ($showData['add_show_start_date'] > $localShowStart->format("Y-m-d")) { + $this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId); + } + + + } + } + + $currentShowEndDate = $this->getRepeatingEndDate(); + //check if "no end" option has changed + if ($currentShowEndDate != $showData['add_show_no_end']) { + //show "No End" option was toggled + if (!$showData['add_show_no_end']) { + //"No End" option was unchecked so we need to delete the + //repeat instances that are scheduled after the new end date + $this->deleteInstancesFromDate($endDate, $showId); + } + } + + if ($currentShowEndDate != $showData['add_show_end_date']) { + //end date was changed + $newEndDate = strtotime($showData['add_show_end_date']); + $oldEndDate = strtotime($currentShowEndDate); + if ($newEndDate < $oldEndDate) { + //end date was pushed back so we have to delete any + //instances of this show scheduled after the new end date + $this->deleteInstancesFromDate($endDate, $showId); + } + } + }//if repeats + } + + public function getRepeatingEndDate() + { + $sql = << $this->ccShow->getDbId() ), 'column' ); + + return ($query !== false) ? $query : false; + } + + private function deleteInstancesFromDate($endDate, $showId) + { + $sql = <<= :endDate::DATE + AND starts > :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute($sql, array( + ':endDate' => $endDate, ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId), 'execute'); + } + + private function deleteInstancesBeforeDate($newStartDate, $showId) + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute($sql, array( + ":newStartDate" => $newStartDate, ":timestamp" => gmdate("Y-m-d H:i:s"), + ":showId" => $showId), "execute"); + } + + /** + * + * Enter description here ... + * @param $daysRemoved array of days (days of the week) removed + * (days of the week are represented numerically + * 0=>sunday, 1=>monday, 2=>tuesday, etc.) + * @param $showDays array of ccShowDays objects + * @param $showId + */ + private function deleteRemovedShowDayInstances($daysRemoved, $showDays, $showId) + { + $daysRemovedUTC = array(); + + //convert the start day of the week to UTC + foreach ($showDays as $showDay) { + if (in_array($showDay->getDbDay(), $daysRemoved)) { + $showDay->reload(); + $startDay = $showDay->getUTCStartDateAndTime(); + $daysRemovedUTC[] = $startDay->format('w'); + } + } + + $uncheckedDays = pg_escape_string(implode(",", $daysRemovedUTC)); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + + Application_Common_Database::prepareAndExecute( $sql, array( + ":timestamp" => gmdate("Y-m-d H:i:s"), ":showId" => $showId), + "execute"); + } + + private function deleteAllInstances($showId) + { + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId), 'execute'); + } + + private function deleteAllRepeatInstances($currentShowDay, $showId) + { + $firstShow = $currentShowDay->getUTCStartDateAndTime(); + + $sql = << :timestamp::TIMESTAMP + AND show_id = :showId + AND starts != :firstShow +SQL; + Application_Common_Database::prepareAndExecute( $sql, + array( ':timestamp' => gmdate("Y-m-d H:i:s"), + ':showId' => $showId, + ':firstShow' => $firstShow->format("Y-m-d H:i:s")), 'execute'); + } + + /** + * + * Determines what the show end date should be based on + * the form data + * + * @param $showData add/edit show form data + * @return DateTime object in user's local timezone + */ + private function calculateEndDate($showData) + { + if ($showData['add_show_no_end']) { + $endDate = NULL; + } elseif ($showData['add_show_repeats']) { + $endDate = new DateTime($showData['add_show_end_date']); + $endDate->add(new DateInterval("P1D")); + } else { + $endDate = new DateTime($showData['add_show_start_date']); + $endDate->add(new DateInterval("P1D")); + } + + return $endDate; + } + + private function applyShowStartEndDifference($showData) + { + $showId = $this->ccShow->getDbId(); + //CcShowDay object + $currentShowDay = $this->ccShow->getFirstCcShowDay(); + + //DateTime in user's local time + $newStartDateTime = new DateTime($showData["add_show_start_date"]." ". + $showData["add_show_start_time"], + new DateTimeZone(Application_Model_Preference::GetTimezone())); + + $diff = $this->calculateShowStartDiff($newStartDateTime, + $currentShowDay->getLocalStartDateAndTime()); + + $this->updateInstanceStartEndTime($diff); + $ccShowInstances = $this->ccShow->getFutureCcShowInstancess(); + $instanceIds = array(); + foreach ($ccShowInstances as $ccShowInstance) { + array_push($instanceIds, $ccShowInstance->getDbId()); + } + Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff); + } + + /** + * + * Returns the difference in seconds between a show's new and + * old start time + * + * @param $newStartDateTime DateTime object + * @param $oldStartDateTime DateTime object + */ + private function calculateShowStartDiff($newStartDateTime, $oldStartDateTime) + { + return $newStartDateTime->getTimestamp() - $oldStartDateTime->getTimestamp(); + } + + /** + * + * Updates the start and end time for cc_show_instances + * + * @param $showData edit show form data + */ + private function updateInstanceStartEndTime($diff) + { + $sql = << :timestamp::TIMESTAMP +SQL; + + Application_Common_Database::prepareAndExecute($sql, + array(':diff1' => $diff, ':diff2' => $diff, + ':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate("Y-m-d H:i:s")), + 'execute'); + } + + /** + * + * Enter description here ... + * @param ccShowDays $showDay + * @param DateTime $showStartDate user's local time + * @param $instanceId + */ + private function createRebroadcastInstances($showDay, $showStartDate, $instanceId) + { + $currentUtcTimestamp = gmdate("Y-m-d H:i:s"); + $showId = $this->ccShow->getDbId(); + + $sql = "SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id"; + $rebroadcasts = Application_Common_Database::prepareAndExecute($sql, + array( ':show_id' => $showId ), 'all'); + + foreach ($rebroadcasts as $rebroadcast) { + $days = explode(" ", $rebroadcast["day_offset"]); + $time = explode(":", $rebroadcast["start_time"]); + $offset = array("days"=>$days[0], "hours"=>$time[0], "mins"=>$time[1]); + + list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime( + $showStartDate, $showDay->getDbDuration(), $offset); + + if ($utcStartDateTime->format("Y-m-d H:i:s") > $currentUtcTimestamp) { + $ccShowInstance = new CcShowInstances(); + $ccShowInstance->setDbShowId($showId); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord(0); + $ccShowInstance->setDbRebroadcast(1); + $ccShowInstance->setDbOriginalShow($instanceId); + $ccShowInstance->save(); + } + } + } + + /** + * + * Sets a single cc_show_instance table row + * @param $showDay + * @param $populateUntil + */ + private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast, $isUpdate) + { + //DateTime object + $start = $showDay->getLocalStartDateAndTime(); + + list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime( + $start, $showDay->getDbDuration()); + + if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) { + $ccShowInstance = new CcShowInstances(); + if ($isUpdate) { + $ccShowInstance = $this->getInstance($utcStartDateTime); + } + $ccShowInstance->setDbShowId($this->ccShow->getDbId()); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($showDay->getDbRecord()); + $ccShowInstance->save(); + + if ($isUpdate) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $ccShowInstance->updateScheduleStatus($con); + } + + if ($isRebroadcast) { + $this->createRebroadcastInstances($showDay, $start, $ccShowInstance->getDbId()); + } + } + } + + /** + * + * Sets multiple cc_show_instances table rows + * @param unknown_type $showDay + * @param unknown_type $populateUntil + * @param unknown_type $repeatInterval + * @param unknown_type $isRebroadcast + */ + private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, + $repeatInterval, $isRebroadcast, $isUpdate) + { + $show_id = $showDay->getDbShowId(); + $first_show = $showDay->getDbFirstShow(); //non-UTC + $last_show = $showDay->getDbLastShow(); //non-UTC + $duration = $showDay->getDbDuration(); + $day = $showDay->getDbDay(); + $record = $showDay->getDbRecord(); + $timezone = $showDay->getDbTimezone(); + + //string + $start = $this->getNextRepeatingPopulateStartDateTime($showDay); + + //DatePeriod in user's local time + $datePeriod = $this->getDatePeriod($start, $timezone, $last_show, + $repeatInterval, $populateUntil); + + $utcLastShowDateTime = $last_show ? + Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + + $utcEndDateTime = null; + foreach ($datePeriod as $date) { + list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime( + $date, $duration); + /* + * Make sure start date is less than populate until date AND + * last show date is null OR start date is less than last show date + */ + if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && + ( is_null($utcLastShowDateTime) || + $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { + + /* There may not always be an instance when editing a show + * This will be the case when we are adding a new show day to + * a repeating show + */ + if ($isUpdate && $this->hasInstance($utcStartDateTime)) { + $ccShowInstance = $this->getInstance($utcStartDateTime); + $newInstance = false; + $updateScheduleStatus = true; + } else { + $newInstance = true; + $ccShowInstance = new CcShowInstances(); + $updateScheduleStatus = false; + } + + /* When editing the start/end time of a repeating show, we don't want to + * change shows that started in the past. So check the start time. + */ + if ($newInstance || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + + if ($updateScheduleStatus) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $ccShowInstance->updateScheduleStatus($con); + } + } + + if ($isRebroadcast) { + $this->createRebroadcastInstances($showDay, $date, $ccShowInstance->getDbId()); + } + } + } + $nextDate = $utcEndDateTime->add(new DateInterval($repeatInterval)); + $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day); + } + + private function getNextRepeatingPopulateStartDateTime($showDay) + { + $nextPopDate = $showDay->getDbNextPopDate(); + $startTime = $showDay->getDbStartTime(); + + if (isset($nextPopDate)) { + return $nextPopDate." ".$startTime; + } else { + return $showDay->getDbFirstShow()." ".$startTime; + } + } + + /** + * + * Create a DatePeriod object in the user's local time + * It will get converted to UTC before the show instance gets created + */ + private function getDatePeriod($start, $timezone, $lastShow, $repeatInterval, $populateUntil) + { + if (isset($lastShow)) { + $endDatePeriod = new DateTime($lastShow, new DateTimeZone($timezone)); + } else { + $endDatePeriod = $populateUntil; + } + + return new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), + new DateInterval($repeatInterval), $endDatePeriod); + } + + private function hasInstance($starts) + { + return $this->getInstance($starts) ? true : false; + } + + /** + * + * Attempts to retrieve the cc_show_instance belonging to a cc_show + * that starts at $starts. We have to pass in the start + * time in case the show is repeating + * + * Returns the instance if one was found (one that is not a recording + * and modified instance is false (has not been deleted)) + */ + private function getInstance($starts) + { + $ccShowInstance = CcShowInstancesQuery::create() + ->filterByDbStarts($starts->format("Y-m-d H:i:s"), Criteria::EQUAL) + ->filterByDbShowId($this->ccShow->getDbId(), Criteria::EQUAL) + ->filterByDbModifiedInstance(false, Criteria::EQUAL) + ->filterByDbRebroadcast(0, Criteria::EQUAL) + ->limit(1) + ->find(); + + if ($ccShowInstance->isEmpty()) { + return false; + } else { + return $ccShowInstance[0]; + } + } /** * @@ -10,7 +683,7 @@ class Application_Service_ShowService * @param $ccShow * @param $showData */ - public function setShow($showData, $isUpdate) + private function setCcShow($showData, $isUpdate) { if (!$isUpdate) { $ccShow = new CcShow(); @@ -30,7 +703,83 @@ class Application_Service_ShowService $ccShow->setDbLiveStreamPass($showData['custom_password']); $ccShow->save(); - return $ccShow; + $this->ccShow = $ccShow; + } + + /** + * + * Sets the fields for a cc_show_days table row + * @param $showData + * @param $showId + * @param $userId + * @param $repeatType + * @param $isRecorded + * @param $showDay ccShowDay object we are setting values on + */ + private function setCcShowDays($showData, $repeatType, $isRecorded) + { + $showId = $this->ccShow->getDbId(); + + $startDateTime = new DateTime($showData['add_show_start_date']." ".$showData['add_show_start_time']); + + $endDateTime = $this->calculateEndDate($showData); + if (!is_null($endDateTime)) { + $endDate = $endDateTime->format("Y-m-d"); + } else { + $endDate = $endDateTime; + } + + /* What we are doing here is checking if the show repeats or if + * any repeating days have been checked. If not, then by default + * the "selected" DOW is the initial day. + * DOW in local time. + */ + $startDow = date("w", $startDateTime->getTimestamp()); + if (!$showData['add_show_repeats']) { + $showData['add_show_day_check'] = array($startDow); + } elseif ($showData['add_show_repeats'] && $showData['add_show_day_check'] == "") { + $showData['add_show_day_check'] = array($startDow); + } + + // Don't set day for monthly repeat type, it's invalid + if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTime->format("H:i:s")); + $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } else { + foreach ($showData['add_show_day_check'] as $day) { + $daysAdd=0; + $startDateTimeClone = clone $startDateTime; + if ($startDow !== $day) { + if ($startDow > $day) + $daysAdd = 6 - $startDow + 1 + $day; + else + $daysAdd = $day - $startDow; + + $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); + } + if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { + $showDay = new CcShowDays(); + $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); + $showDay->setDbLastShow($endDate); + $showDay->setDbStartTime($startDateTimeClone->format("H:i")); + $showDay->setDbTimezone(Application_Model_Preference::GetTimezone()); + $showDay->setDbDuration($showData['add_show_duration']); + $showDay->setDbDay($day); + $showDay->setDbRepeatType($repeatType); + $showDay->setDbShowId($showId); + $showDay->setDbRecord($isRecorded); + $showDay->save(); + } + } + } } /** @@ -39,9 +788,9 @@ class Application_Service_ShowService * that is currently being edited. They will get recreated with * the new show specs */ - public function deleteShowRebroadcasts($showId) + private function deleteCcShowRebroadcasts() { - CcShowRebroadcastQuery::create()->filterByDbShowId($showId)>delete(); + CcShowRebroadcastQuery::create()->filterByDbShowId($this->ccShow->getDbId())->delete(); } /** @@ -52,10 +801,12 @@ class Application_Service_ShowService * @param $repeatType * @param $isRecorded */ - public function setShowRebroadcasts($showData, $showId, $repeatType, $isRecorded) + private function setCcShowRebroadcasts($showData, $repeatType, $isRecorded) { + $showId = $this->ccShow->getDbId(); + if (($isRecorded && $showData['add_show_rebroadcast']) && ($repeatType != -1)) { - for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { + for ($i = 1; $i <= MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_'.$i]) { $showRebroad = new CcShowRebroadcast(); $showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_'.$i]); @@ -65,7 +816,7 @@ class Application_Service_ShowService } } } elseif ($isRecorded && $showData['add_show_rebroadcast'] && ($repeatType == -1)) { - for ($i=1; $i<=self::MAX_REBROADCAST_DATES; $i++) { + for ($i = 1; $i <= MAX_REBROADCAST_DATES; $i++) { if ($showData['add_show_rebroadcast_date_absolute_'.$i]) { $rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_$i"]); $startDate = new DateTime($showData['add_show_start_date']); @@ -87,9 +838,9 @@ class Application_Service_ShowService * that is currently being edited. They will get recreated with * the new show specs */ - public function deleteShowHosts($showId) + private function deleteCcShowHosts() { - CcShowHostsQuery::create()->filterByDbShow($showId)->delete(); + CcShowHostsQuery::create()->filterByDbShow($this->ccShow->getDbId())->delete(); } /** @@ -98,12 +849,12 @@ class Application_Service_ShowService * @param $showData * @param $showId */ - public function setShowHosts($showData, $showId) + private function setCcShowHosts($showData) { if (is_array($showData['add_show_hosts'])) { foreach ($showData['add_show_hosts'] as $host) { $showHost = new CcShowHosts(); - $showHost->setDbShow($showId); + $showHost->setDbShow($this->ccShow->getDbId()); $showHost->setDbHost($host); $showHost->save(); } @@ -117,7 +868,7 @@ class Application_Service_ShowService * * @return DateTime object */ - public function getPopulateShowUntilDateTIme() + private function getPopulateShowUntilDateTIme() { $populateUntil = Application_Model_Preference::GetShowsPopulatedUntil(); @@ -131,24 +882,15 @@ class Application_Service_ShowService /** * * Enter description here ... - * @param $localStart timestring format "Y-m-d H:i:s" (not UTC) - * @param $duration string time interval (h)h:(m)m(:ss) - * @param $timezone string "Europe/Prague" - * @param $offset array (days, hours, mins) used for rebroadcast shows + * @param DateTime $startDateTime user's local time + * @param string $duration time interval (h)h:(m)m(:ss) + * @param string $timezone "Europe/Prague" + * @param array $offset (days, hours, mins) used for rebroadcast shows * * @return array of 2 DateTime objects, start/end time of the show in UTC */ - public function createUTCStartEndDateTime($localStart, $duration, $timezone=null, $offset=null) + private function createUTCStartEndDateTime($startDateTime, $duration, $offset=null) { - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); - - if (!isset($timezone)) { - $timezone = Application_Model_Preference::GetUserTimezone($user->getId()); - } - - $startDateTime = new DateTime($localStart, new DateTimeZone($timezone)); if (isset($offset)) { $startDateTime->add(new DateInterval("P{$offset["days"]}DT{$offset["hours"]}H{$offset["mins"]}M")); } @@ -174,12 +916,12 @@ class Application_Service_ShowService * @param $showId * @param $day */ - public function setNextRepeatingShowDate($nextDate, $showId, $day) + private function setNextRepeatingShowDate($nextDate, $day) { $nextInfo = explode(" ", $nextDate); $repeatInfo = CcShowDaysQuery::create() - ->filterByDbShowId($showId) + ->filterByDbShowId($this->ccShow->getDbId()) ->filterByDbDay($day) ->findOne(); diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index 57dc8def5..a4fd1851e 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -387,14 +387,14 @@ $(document).ready(function() { //edit this instance and all callback = function() { - $.get(edit.all.url, {format: "json", id: data.id, type: "all"}, function(json){ + $.get(edit.all.url, {format: "json", showId: data.showId, instanceId: data.id, type: "all"}, function(json){ beginEditShow(json); }); }; edit.all.callback = callback; }else{ callback = function() { - $.get(oItems.edit.url, {format: "json", id: data.id, type: oItems.edit._type}, function(json){ + $.get(oItems.edit.url, {format: "json", showId: data.showId, instanceId: data.id, type: oItems.edit._type}, function(json){ beginEditShow(json); }); }; From 6766d208aa094f365b97ddbdff0bc057554c31cf Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 21 Mar 2013 16:31:05 -0400 Subject: [PATCH 029/128] CC-4961: Show linking Removed logic out of edit-show action Created new SchedulerService Fixed overlapping show bug --- .../controllers/ScheduleController.php | 101 +----------------- airtime_mvc/application/forms/AddShowWhen.php | 3 +- airtime_mvc/application/models/Schedule.php | 14 +-- .../application/models/airtime/CcShow.php | 79 ++++++++------ .../application/models/airtime/CcShowDays.php | 5 +- .../application/services/ScheduleService.php | 26 ----- .../application/services/SchedulerService.php | 85 +++++++++++++++ .../application/services/ShowFormService.php | 21 +++- .../application/services/ShowService.php | 37 +++++-- 9 files changed, 189 insertions(+), 182 deletions(-) delete mode 100644 airtime_mvc/application/services/ScheduleService.php create mode 100644 airtime_mvc/application/services/SchedulerService.php diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 7f53fe798..1d55f282e 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -550,105 +550,11 @@ class ScheduleController extends Zend_Controller_Action $service_showForm->delegateFormPopulation($forms); - /*$show = new Application_Model_Show($showInstance->getShowId()); - - $formWhat->populate(array('add_show_id' => $show->getId(), - 'add_show_instance_id' => $showInstanceId, - 'add_show_name' => $show->getName(), - 'add_show_url' => $show->getUrl(), - 'add_show_genre' => $show->getGenre(), - 'add_show_description' => $show->getDescription()));*/ - - /*$startsDateTime = new DateTime($show->getStartDate()." ".$show->getStartTime(), new DateTimeZone("UTC")); - $endsDateTime = new DateTime($show->getEndDate()." ".$show->getEndTime(), new DateTimeZone("UTC")); - - $startsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); - $endsDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); - - $formWhen->populate(array('add_show_start_date' => $startsDateTime->format("Y-m-d"), - 'add_show_start_time' => $startsDateTime->format("H:i"), - 'add_show_end_date_no_repeat' => $endsDateTime->format("Y-m-d"), - 'add_show_end_time' => $endsDateTime->format("H:i"), - 'add_show_duration' => $show->getDuration(true), - 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); - - if ($show->isStartDateTimeInPast()) { - // for a non-repeating show, we should never allow user to change the start time. - // for the repeating show, we should allow because the form works as repeating template form - if (!$showInstance->getShow()->isRepeating()) { - $formWhen->disableStartDateAndTime(); - } else { - $nextFutureRepeatShow = $show->getNextFutureRepeatShowTime(); - $formWhen->getElement('add_show_start_date')->setValue($nextFutureRepeatShow["starts"]->format("Y-m-d")); - $formWhen->getElement('add_show_start_time')->setValue($nextFutureRepeatShow["starts"]->format("H:i")); - $formWhen->getElement('add_show_end_date_no_repeat')->setValue($nextFutureRepeatShow["ends"]->format("Y-m-d")); - $formWhen->getElement('add_show_end_time')->setValue($nextFutureRepeatShow["ends"]->format("H:i")); - } - }*/ - - //need to get the days of the week in the php timezone (for the front end). - /*$days = array(); - $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find(); - foreach ($showDays as $showDay) { - $showStartDay = new DateTime($showDay->getDbFirstShow(), new DateTimeZone($showDay->getDbTimezone())); - $showStartDay->setTimezone(new DateTimeZone(date_default_timezone_get())); - array_push($days, $showStartDay->format('w')); - } - - $displayedEndDate = new DateTime($show->getRepeatingEndDate(), new DateTimeZone($showDays[0]->getDbTimezone())); - $displayedEndDate->sub(new DateInterval("P1D"));//end dates are stored non-inclusively. - $displayedEndDate->setTimezone(new DateTimeZone(date_default_timezone_get())); - - $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(), - 'add_show_day_check' => $days, - 'add_show_end_date' => $displayedEndDate->format("Y-m-d"), - 'add_show_no_end' => ($show->getRepeatingEndDate() == '')));*/ - - /*$hosts = array(); - $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find(); - foreach ($showHosts as $showHost) { - array_push($hosts, $showHost->getDbHost()); - } - $formWho->populate(array('add_show_hosts' => $hosts));*/ - - - /*$formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), - 'add_show_color' => $show->getColor())); - - $formLive->populate($show->getLiveStreamInfo()); - - $formRecord->populate(array('add_show_record' => $show->isRecorded(), - 'add_show_rebroadcast' => $show->isRebroadcast())); - - $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));*/ - - - - /*$rebroadcastsRelative = $show->getRebroadcastsRelative(); - $rebroadcastFormValues = array(); - $i = 1; - foreach ($rebroadcastsRelative as $rebroadcast) { - $rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset']; - $rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']); - $i++; - } - $formRebroadcast->populate($rebroadcastFormValues);*/ -/* - $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute(); - $rebroadcastAbsoluteFormValues = array(); - $i = 1; - foreach ($rebroadcastsAbsolute as $rebroadcast) { - $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date']; - $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time']; - $i++; - } - $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues); - if (!$isAdminOrPM) { foreach ($forms as $form) { $form->disable(); } - }*/ + } $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); $this->view->entries = 5; @@ -734,11 +640,6 @@ class ScheduleController extends Zend_Controller_Action //pass in true to indicate we are updating a show $service_show->addUpdateShow($data, true); - $scheduler = new Application_Model_Scheduler(); - $showInstances = CcShowInstancesQuery::create()->filterByDbShowId($data['add_show_id'])->find(); - foreach ($showInstances as $si) { - $scheduler->removeGaps($si->getDbId()); - } $this->view->addNewShow = true; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } else { diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index ae9ffe5e3..007852ba4 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -295,7 +295,8 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $rebroadcastShowStart->setTimezone(new DateTimeZone('UTC')); $rebroadcastShowEnd = clone $rebroadcastShowStart; $rebroadcastShowEnd->add(new DateInterval($durationToAdd)); - $overlapping = Application_Model_Schedule::checkOverlappingShows($rebroadcastShowStart, $rebroadcastShowEnd, $update, $instanceId); + $overlapping = Application_Model_Schedule::checkOverlappingShows($rebroadcastShowStart, + $rebroadcastShowEnd, $update, null, $formData["add_show_id"]); if ($overlapping) { $valid = false; $this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows'))); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 6b19c5e3d..0796740f3 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1256,19 +1256,19 @@ WHERE (ends <= :show_end1 AND date(starts) >= (date(:show_end3) - INTERVAL '2 days') AND modified_instance = FALSE SQL; - if (is_null($showId)) { - $sql .= <<collCcShowDayss[0]; } -/** - * Gets an array of CcShowInstances objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this CcShow is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - * @throws PropelException - */ - public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowInstancess || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowInstancess) { - // return empty collection - $this->initCcShowInstancess(); - } else { - - $collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria) - ->filterByCcShow($this) - ->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN) - ->filterByDbModifiedInstance(false) - ->find($con); - if (null !== $criteria) { - return $collCcShowInstancess; - } - $this->collCcShowInstancess = $collCcShowInstancess; - } - } - return $this->collCcShowInstancess; - } + /** + * Gets an array of CcShowInstances objects which contain a foreign key that references this object. + * + * If the $criteria is not null, it is used to always fetch the results from the database. + * Otherwise the results are fetched from the database the first time, then cached. + * Next time the same method is called without $criteria, the cached collection is returned. + * If this CcShow is new, it will return + * an empty collection or the current collection; the criteria is ignored on a new object. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects + * @throws PropelException + */ + public function getFutureCcShowInstancess($criteria = null, PropelPDO $con = null) + { + if(null === $this->collCcShowInstancess || null !== $criteria) { + if ($this->isNew() && null === $this->collCcShowInstancess) { + // return empty collection + $this->initCcShowInstancess(); + } else { + $collCcShowInstancess = CcShowInstancesQuery::create(null, $criteria) + ->filterByCcShow($this) + ->filterByDbStarts(gmdate("Y-m-d H:i:s"), Criteria::GREATER_THAN) + ->filterByDbModifiedInstance(false) + ->find($con); + if (null !== $criteria) { + return $collCcShowInstancess; + } + $this->collCcShowInstancess = $collCcShowInstancess; + } + } + return $this->collCcShowInstancess; + } public function isRecorded() { @@ -119,4 +118,14 @@ class CcShow extends BaseCcShow { ->orderByDbDayOffset() ->find(); } + + public function getRebroadcastsAbsolute() + { + return CcShowInstancesQuery::create() + ->filterByDbShowId($this->getDbId()) + ->filterByDbRebroadcast(1) + ->filterByDbModifiedInstance(false) + ->orderByDbStarts() + ->find(); + } } // CcShow diff --git a/airtime_mvc/application/models/airtime/CcShowDays.php b/airtime_mvc/application/models/airtime/CcShowDays.php index 4ed9bd6bc..cef0b333f 100644 --- a/airtime_mvc/application/models/airtime/CcShowDays.php +++ b/airtime_mvc/application/models/airtime/CcShowDays.php @@ -46,8 +46,9 @@ class CcShowDays extends BaseCcShowDays { * Enter description here ... * @param DateTime $startDateTime first show in user's local time */ - public function getLocalEndDateAndTime($startDateTime) + public function getLocalEndDateAndTime($showStart) { + $startDateTime = clone $showStart; $duration = explode(":", $this->getDbDuration()); return $startDateTime->add(new DateInterval('PT'.$duration[0].'H'.$duration[1].'M')); @@ -55,7 +56,7 @@ class CcShowDays extends BaseCcShowDays { public function isShowStartInPast() { - return $this->getUTCStartDateAndTime() > gmdate("Y-m-d H:i:s"); + return $this->getUTCStartDateAndTime()->format("Y-m-d H:i:s") < gmdate("Y-m-d H:i:s"); } public function formatDuration() diff --git a/airtime_mvc/application/services/ScheduleService.php b/airtime_mvc/application/services/ScheduleService.php deleted file mode 100644 index 9ff581542..000000000 --- a/airtime_mvc/application/services/ScheduleService.php +++ /dev/null @@ -1,26 +0,0 @@ - 0 && $diff != 0) { - $showIdList = implode(",", $instanceIds); - $sql = << $diff, ':diff2' => $diff, - ':showIds' => $showIdList), - 'execute'); - } - } -} \ No newline at end of file diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php new file mode 100644 index 000000000..4a4f9172b --- /dev/null +++ b/airtime_mvc/application/services/SchedulerService.php @@ -0,0 +1,85 @@ + 0 && $diff != 0) { + $showIdList = implode(",", $instanceIds); + $sql = << $diff, ':diff2' => $diff, + ':showIds' => $showIdList), + 'execute'); + } + } + + /** + * + * Removes any time gaps in shows + * + * @param array $schedIds schedule ids to exclude + */ + public function removeGaps($showId, $schedIds=null) + { + $ccShowInstances = CcShowInstancesQuery::create()->filterByDbShowId($showId)->find(); + + foreach ($ccShowInstances as $instance) { + Logging::info("Removing gaps from show instance #".$instance->getDbId()); + //DateTime object + $itemStart = $instance->getDbStarts(null); + + $ccScheduleItems = CcScheduleQuery::create() + ->filterByDbInstanceId($instance->getDbId()) + ->filterByDbId($schedIds, Criteria::NOT_IN) + ->orderByDbStarts() + ->find(); + + foreach ($ccScheduleItems as $ccSchedule) { + //DateTime object + $itemEnd = $this->findEndTime($itemStart, $ccSchedule->getDbClipLength()); + + $ccSchedule->setDbStarts($itemStart) + ->setDbEnds($itemEnd); + + $itemStart = $itemEnd; + } + $ccScheduleItems->save(); + } + } + + /** + * + * Enter description here ... + * @param DateTime $instanceStart + * @param string $clipLength + */ + private function findEndTime($instanceStart, $clipLength) + { + $startEpoch = $instanceStart->format("U.u"); + $durationSeconds = Application_Common_DateHelper::playlistTimeToSeconds($clipLength); + + //add two float numbers to 6 subsecond precision + //DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number. + $endEpoch = bcadd($startEpoch , (string) $durationSeconds, 6); + + $dt = DateTime::createFromFormat("U.u", $endEpoch, new DateTimeZone("UTC")); + + if ($dt === false) { + //PHP 5.3.2 problem + $dt = DateTime::createFromFormat("U", intval($endEpoch), new DateTimeZone("UTC")); + } + + return $dt; + } +} \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 38f4129ff..6202f4862 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -89,6 +89,7 @@ class Application_Service_ShowFormService $this->populateFormStyle($forms["style"]); $this->populateFormRecord($forms["record"]); $this->populateFormRebroadcastRelative($forms["rebroadcast"]); + $this->populateFormRebroadcastAbsolute($forms["abs_rebroadcast"]); } private function populateFormWhat($form) @@ -186,7 +187,7 @@ class Application_Service_ShowFormService $form->getElement('add_show_record')->setOptions(array('disabled' => true)); } - public function populateFormRebroadcastRelative($form) + private function populateFormRebroadcastRelative($form) { $relativeRebroadcasts = $this->ccShow->getRebroadcastsRelative(); @@ -202,6 +203,24 @@ class Application_Service_ShowFormService $form->populate($formValues); } + private function populateFormRebroadcastAbsolute($form) + { + $absolutRebroadcasts = $this->ccShow->getRebroadcastsAbsolute(); + + $formValues = array(); + $i = 1; + foreach ($absolutRebroadcasts as $ar) { + //convert dates to user's local time + $start = new DateTime($ar->getDbStarts(), new DateTimeZone("UTC")); + $start->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone())); + $formValues["add_show_rebroadcast_date_absolute_$i"] = $start->format("Y-m-d"); + $formValues["add_show_rebroadcast_time_absolute_$i"] = $start->format("H:i"); + $i++; + } + + $form->populate($formValues); + } + /** * * Before we send the form data in for validation, there diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 746264bdf..982f17b35 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -65,6 +65,11 @@ class Application_Service_ShowService //create new ccShowInstances $this->delegateInstanceCreation($isRebroadcast, $isUpdate); + if ($isUpdate) { + $service_scheduler = new Application_Service_SchedulerService(); + $service_scheduler->removeGaps($this->ccShow->getDbId()); + } + $con->commit(); Application_Model_RabbitMq::PushSchedule(); } catch (Exception $e) { @@ -89,16 +94,16 @@ class Application_Service_ShowService foreach ($ccShowDays as $day) { switch ($day->getDbRepeatType()) { case NO_REPEAT: - $this->createNonRepeatingShowInstance($day, $populateUntil, $isRebroadcast, $isUpdate); + $this->createNonRepeatingInstance($day, $populateUntil, $isRebroadcast, $isUpdate); break; case REPEAT_WEEKLY: - $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); + $this->createRepeatingInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); break; case REPEAT_BI_WEEKLY: - $this->createWeeklyRepeatingShowInstances($day, $populateUntil, "P14D", $isRebroadcast, $isUpdate); + $this->createRepeatingInstances($day, $populateUntil, "P14D", $isRebroadcast, $isUpdate); break; case REPEAT_MONTHLY_MONTHLY: - $this->createMonthlyRepeatingShowInstances($day, $populateUntil, "P1M", $isRebroadcast); + $this->createRepeatingInstances($day, $populateUntil, "P1M", $isRebroadcast, $isUpdate); break; case REPEAT_MONTHLY_WEEKLY: // do something here @@ -426,7 +431,7 @@ SQL; foreach ($ccShowInstances as $ccShowInstance) { array_push($instanceIds, $ccShowInstance->getDbId()); } - Application_Service_ScheduleService::updateScheduleStartTime($instanceIds, $diff); + Application_Service_SchedulerService::updateScheduleStartTime($instanceIds, $diff); } /** @@ -507,7 +512,7 @@ SQL; * @param $showDay * @param $populateUntil */ - private function createNonRepeatingShowInstance($showDay, $populateUntil, $isRebroadcast, $isUpdate) + private function createNonRepeatingInstance($showDay, $populateUntil, $isRebroadcast, $isUpdate) { //DateTime object $start = $showDay->getLocalStartDateAndTime(); @@ -545,7 +550,7 @@ SQL; * @param unknown_type $repeatInterval * @param unknown_type $isRebroadcast */ - private function createWeeklyRepeatingShowInstances($showDay, $populateUntil, + private function createRepeatingInstances($showDay, $populateUntil, $repeatInterval, $isRebroadcast, $isUpdate) { $show_id = $showDay->getDbShowId(); @@ -617,6 +622,12 @@ SQL; $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day); } + private function createMonthlyRepeatingInstances($showDay, $populateUntil, + $repeatInterval, $isRebroadcast, $isUpdate) + { + + } + private function getNextRepeatingPopulateStartDateTime($showDay) { $nextPopDate = $showDay->getDbNextPopDate(); @@ -882,17 +893,23 @@ SQL; /** * * Enter description here ... - * @param DateTime $startDateTime user's local time + * @param DateTime $showStart user's local time * @param string $duration time interval (h)h:(m)m(:ss) * @param string $timezone "Europe/Prague" * @param array $offset (days, hours, mins) used for rebroadcast shows * * @return array of 2 DateTime objects, start/end time of the show in UTC */ - private function createUTCStartEndDateTime($startDateTime, $duration, $offset=null) + private function createUTCStartEndDateTime($showStart, $duration, $offset=null) { + $startDateTime = clone $showStart; + if (isset($offset)) { - $startDateTime->add(new DateInterval("P{$offset["days"]}DT{$offset["hours"]}H{$offset["mins"]}M")); + //$offset["hours"] and $offset["mins"] represents the start time + //of a rebroadcast show + $startDateTime = new DateTime($startDateTime->format("Y-m-d")." ". + $offset["hours"].":".$offset["mins"]); + $startDateTime->add(new DateInterval("P{$offset["days"]}D")); } //convert time to UTC $startDateTime->setTimezone(new DateTimeZone('UTC')); From 187e49e4b2e41a750914afdf9018b47705cd0843 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 22 Mar 2013 14:57:02 -0400 Subject: [PATCH 030/128] CC-4961: Show linking Added back-end functionality for creating monthly repeating shows on the same day of the week --- .../application/services/ShowService.php | 164 ++++++++++++++++-- 1 file changed, 150 insertions(+), 14 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 982f17b35..4ac671541 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -97,16 +97,19 @@ class Application_Service_ShowService $this->createNonRepeatingInstance($day, $populateUntil, $isRebroadcast, $isUpdate); break; case REPEAT_WEEKLY: - $this->createRepeatingInstances($day, $populateUntil, "P7D", $isRebroadcast, $isUpdate); + $this->createRepeatingInstances($day, $populateUntil, REPEAT_WEEKLY, + new DateInterval("P7D"), $isRebroadcast, $isUpdate); break; case REPEAT_BI_WEEKLY: - $this->createRepeatingInstances($day, $populateUntil, "P14D", $isRebroadcast, $isUpdate); + $this->createRepeatingInstances($day, $populateUntil, REPEAT_BI_WEEKLY, + new DateInterval("P14D"), $isRebroadcast, $isUpdate); break; case REPEAT_MONTHLY_MONTHLY: - $this->createRepeatingInstances($day, $populateUntil, "P1M", $isRebroadcast, $isUpdate); + $this->createMonthlyMonthlyRepeatInstances($day, $populateUntil, $isRebroadcast, $isUpdate); break; case REPEAT_MONTHLY_WEEKLY: - // do something here + $this->createRepeatingInstances($day, $populateUntil, REPEAT_MONTHLY_WEEKLY, + null, $isRebroadcast, $isUpdate); break; } } @@ -551,7 +554,7 @@ SQL; * @param unknown_type $isRebroadcast */ private function createRepeatingInstances($showDay, $populateUntil, - $repeatInterval, $isRebroadcast, $isUpdate) + $repeatType, $repeatInterval, $isRebroadcast, $isUpdate) { $show_id = $showDay->getDbShowId(); $first_show = $showDay->getDbFirstShow(); //non-UTC @@ -561,9 +564,13 @@ SQL; $record = $showDay->getDbRecord(); $timezone = $showDay->getDbTimezone(); - //string + //DateTime local $start = $this->getNextRepeatingPopulateStartDateTime($showDay); + if (is_null($repeatInterval)&& $repeatType == REPEAT_MONTHLY_WEEKLY) { + $repeatInterval = $this->getMonthlyWeeklyRepeatInterval($start, $timezone); + } + //DatePeriod in user's local time $datePeriod = $this->getDatePeriod($start, $timezone, $last_show, $repeatInterval, $populateUntil); @@ -618,14 +625,144 @@ SQL; } } } - $nextDate = $utcEndDateTime->add(new DateInterval($repeatInterval)); + $nextDate = $utcEndDateTime->add($repeatInterval); $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day); } - private function createMonthlyRepeatingInstances($showDay, $populateUntil, - $repeatInterval, $isRebroadcast, $isUpdate) + private function createMonthlyMonthlyRepeatInstances($showDay, $populateUntil, + $isRebroadcast, $isUpdate) { - + $show_id = $showDay->getDbShowId(); + $first_show = $showDay->getDbFirstShow(); //non-UTC + $last_show = $showDay->getDbLastShow(); //non-UTC + $duration = $showDay->getDbDuration(); + $day = $showDay->getDbDay(); + $record = $showDay->getDbRecord(); + $timezone = $showDay->getDbTimezone(); + + //DateTime local + $start = $this->getNextRepeatingPopulateStartDateTime($showDay); + if (isset($last_how)) { + $end = new DateTime($last_show, new DateTimeZone($timezone)); + } else { + $end = $populateUntil; + } + + $utcLastShowDateTime = $last_show ? + Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null; + + while ($start->getTimestamp() < $end->getTimestamp()) { + list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime( + $start, $duration); + /* + * Make sure start date is less than populate until date AND + * last show date is null OR start date is less than last show date + */ + if ($utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp() && + ( is_null($utcLastShowDateTime) || + $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) { + + /* There may not always be an instance when editing a show + * This will be the case when we are adding a new show day to + * a repeating show + */ + if ($isUpdate && $this->hasInstance($utcStartDateTime)) { + $ccShowInstance = $this->getInstance($utcStartDateTime); + $newInstance = false; + $updateScheduleStatus = true; + } else { + $newInstance = true; + $ccShowInstance = new CcShowInstances(); + $updateScheduleStatus = false; + } + + /* When editing the start/end time of a repeating show, we don't want to + * change shows that started in the past. So check the start time. + */ + if ($newInstance || $ccShowInstance->getDbStarts() > gmdate("Y-m-d H:i:s")) { + $ccShowInstance->setDbShowId($show_id); + $ccShowInstance->setDbStarts($utcStartDateTime); + $ccShowInstance->setDbEnds($utcEndDateTime); + $ccShowInstance->setDbRecord($record); + $ccShowInstance->save(); + + if ($updateScheduleStatus) { + $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME); + $ccShowInstance->updateScheduleStatus($con); + } + } + + if ($isRebroadcast) { + $this->createRebroadcastInstances($showDay, $date, $ccShowInstance->getDbId()); + } + } + $start = $this->getNextMonthlyMonthlyRepeatDate($start, $timezone); + } + $this->setNextRepeatingShowDate($start->format("Y-m-d"), $day); + } + + /** + * + * i.e. last thursday of each month + * i.e. second monday of each month + * + * @param string $showStart + * @param string $timezone user's local timezone + */ + private function getMonthlyWeeklyRepeatInterval($showStart, $timezone) + { + $start = new DateTime($showStart, new DateTimeZone($timezone)); + + $dayOfMonth = $start->format("j"); + $dayOfWeek = $start->format("l"); + $yearAndMonth = $start->format("Y-m"); + $firstDayOfWeek = strtotime($dayOfWeek." ".$yearAndMonth); + // if $dayOfWeek is Friday, what number of the month does + // the first Friday fall on + $numberOfFirstDayOfWeek = date("j", $firstDayOfWeek); + + $weekCount = 0; + while ($dayOfMonth >= $numberOfFirstDayOfWeek) { + $weekCount++; + $dayOfMonth -= 7; + } + + switch ($weekCount) { + case 1: + $weekNumberOfMonth = "first"; + break; + case 2: + $weekNumberOfMonth = "second"; + break; + case 3: + $weekNumberOfMonth = "third"; + break; + case 4: + $weekNumberOfMonth = "fourth"; + break; + case 5: + $weekNumberOfMonth = "last"; + break; + } + + return DateInterval::createFromDateString( + $weekNumberOfMonth." ".$dayOfWeek." of next month"); + } + + /** + * + * Enter description here ... + * @param $start + */ + private function getNextMonthlyMonthlyRepeatDate($start, $timezone) + { + $dt = new DateTime($start->format("Y-m"), new DateTimeZone($timezone)); + do { + $dt->add(new DateInterval("P1M")); + } while (!checkdate($dt->format("m"), $start->format("d"), $dt->format("Y"))); + + $dt->setDate($dt->format("Y"), $dt->format("m"), $start->format("d")); + return $dt; } private function getNextRepeatingPopulateStartDateTime($showDay) @@ -634,9 +771,9 @@ SQL; $startTime = $showDay->getDbStartTime(); if (isset($nextPopDate)) { - return $nextPopDate." ".$startTime; + return new DateTime($nextPopDate." ".$startTime, new DateTimeZone($showDay->getDbTimezone())); } else { - return $showDay->getDbFirstShow()." ".$startTime; + return new DateTime($showDay->getDbFirstShow()." ".$startTime, new DateTimeZone($showDay->getDbTimezone())); } } @@ -653,8 +790,7 @@ SQL; $endDatePeriod = $populateUntil; } - return new DatePeriod(new DateTime($start, new DateTimeZone($timezone)), - new DateInterval($repeatInterval), $endDatePeriod); + return new DatePeriod($start, $repeatInterval, $endDatePeriod); } private function hasInstance($starts) From 327d0dd6c9fe45d05cab0578e41f97ad909b99d5 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 22 Mar 2013 15:57:15 -0400 Subject: [PATCH 031/128] CC-4961: Show linking Add front-end for creating a show with monthly repeats on same day of week --- airtime_mvc/application/forms/AddShowRepeats.php | 9 +++++++++ airtime_mvc/application/services/ShowService.php | 14 +++++++++++--- airtime_mvc/public/js/airtime/schedule/add-show.js | 11 +++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index 375942894..3319a7a4d 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -35,6 +35,15 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm ), )); + $repeatMonthlyType = new Zend_Form_Element_Radio("add_show_monthly_repeat_type"); + $repeatMonthlyType + ->setLabel(_("Repeat By:")) + ->setRequired(true) + ->setMultiOptions( + array(2 => _("day of the month"), 3 => _("day of the week"))) + ->setValue(2); + $this->addElement($repeatMonthlyType); + // Add end date element $this->addElement('text', 'add_show_end_date', array( 'label' => _('Date End:'), diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 4ac671541..12ae5e4ae 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -23,7 +23,15 @@ class Application_Service_ShowService public function addUpdateShow($showData, $isUpdate=false) { - $repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; + if ($showData["add_show_repeats"]) { + $repeatType = $showData["add_show_repeat_type"]; + if ($showData["add_show_repeat_type"] == 2) { + $repeatType = $showData["add_show_monthly_repeat_type"]; + } + } else { + $repeatType = -1; + } + //$repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; @@ -709,9 +717,9 @@ SQL; * @param string $showStart * @param string $timezone user's local timezone */ - private function getMonthlyWeeklyRepeatInterval($showStart, $timezone) + private function getMonthlyWeeklyRepeatInterval($showStart) { - $start = new DateTime($showStart, new DateTimeZone($timezone)); + $start = clone $showStart; $dayOfMonth = $start->format("j"); $dayOfWeek = $start->format("l"); diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index a1f053699..3fc150797 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -216,11 +216,22 @@ function setAddShowEvents() { form.find("#add_show_repeat_type").change(function(){ if($(this).val() == 2) { form.find("#add_show_day_check-label, #add_show_day_check-element").hide(); + //form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").show(); } else { form.find("#add_show_day_check-label, #add_show_day_check-element").show(); + //form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").hide(); } + toggleMonthlyRepeatType(); }); + toggleMonthlyRepeatType(); + function toggleMonthlyRepeatType() { + if (form.find("#add_show_repeat_type").val() == 2) { + form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").show(); + } else { + form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").hide(); + } + } form.find("#add_show_day_check-label").addClass("block-display"); form.find("#add_show_day_check-element").addClass("block-display clearfix"); From 5b69761833e098184a495ef246d59318aa9b1ac8 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 25 Mar 2013 13:48:11 -0400 Subject: [PATCH 032/128] CC-4961: Show linking Populate repeat show form correctly when a show is repeating monthly on the same day of the week --- .../application/services/ShowFormService.php | 14 ++++++++++++-- airtime_mvc/public/js/airtime/schedule/add-show.js | 12 ++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 6202f4862..e8a085b08 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -149,12 +149,22 @@ class Application_Service_ShowFormService //subtract one day $repeatEndDate->sub(new DateInterval("P1D")); + $repeatType = $ccShowDays[0]->getDbRepeatType(); + if ($repeatType == REPEAT_MONTHLY_WEEKLY) { + $monthlyRepeatType = $repeatType; + //a repeat type of 2 means the show is repeating monthly + $repeatType = 2; + } elseif ($repeatType == REPEAT_MONTHLY_MONTHLY) { + $monthlyRepeatType = $repeatType; + } + $form->populate( array( - 'add_show_repeat_type' => $ccShowDays[0]->getDbRepeatType(), + 'add_show_repeat_type' => $repeatType, 'add_show_day_check' => $days, 'add_show_end_date' => $repeatEndDate->format("Y-m-d"), - 'add_show_no_end' => (!$service_show->getRepeatingEndDate()))); + 'add_show_no_end' => (!$service_show->getRepeatingEndDate()), + 'add_show_monthly_repeat_type' => $monthlyRepeatType)); } private function populateFormWho($form) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 3fc150797..7f0d0e29f 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -214,7 +214,13 @@ function setAddShowEvents() { }); form.find("#add_show_repeat_type").change(function(){ - if($(this).val() == 2) { + toggleRepeatDays(); + toggleMonthlyRepeatType(); + }); + toggleMonthlyRepeatType(); + toggleRepeatDays(); + function toggleRepeatDays() { + if(form.find("#add_show_repeat_type").val() >= 2) { form.find("#add_show_day_check-label, #add_show_day_check-element").hide(); //form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").show(); } @@ -222,9 +228,7 @@ function setAddShowEvents() { form.find("#add_show_day_check-label, #add_show_day_check-element").show(); //form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").hide(); } - toggleMonthlyRepeatType(); - }); - toggleMonthlyRepeatType(); + } function toggleMonthlyRepeatType() { if (form.find("#add_show_repeat_type").val() == 2) { form.find("#add_show_monthly_repeat_type-label, #add_show_monthly_repeat_type-element").show(); From ef8f87df5d3d245b874abcae2f32b90fbeef0cea Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 25 Mar 2013 16:28:53 -0400 Subject: [PATCH 033/128] Show linking --- airtime_mvc/application/models/Show.php | 4 +- .../application/services/ShowService.php | 38 +++++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 8490f6295..da71f3a21 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1664,7 +1664,9 @@ SQL; $showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil(); //if application is requesting shows past our previous populated until date, generate shows up until this point. if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) { - Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp); + //Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp); + $service_show = new Application_Service_ShowService(); + $service_show->delegateInstanceCreation(null, false, $end_timestamp); Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp); } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 12ae5e4ae..f44c2c64d 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -93,11 +93,15 @@ class Application_Service_ShowService * Receives a cc_show id and determines whether to create a * single show instance or repeating show instances */ - private function delegateInstanceCreation($isRebroadcast, $isUpdate) + public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null) { $populateUntil = $this->getPopulateShowUntilDateTIme(); - $ccShowDays = $this->ccShow->getCcShowDays(); + if (is_null($this->ccShow)) { + $ccShowDays = $this->getShowDaysInRange($populateUntil, $end); + } else { + $ccShowDays = $this->ccShow->getCcShowDays(); + } foreach ($ccShowDays as $day) { switch ($day->getDbRepeatType()) { @@ -123,6 +127,32 @@ class Application_Service_ShowService } } + private function getShowDaysInRange($start, $end) + { + $endTimeString = $end->format("Y-m-d H:i:s"); + if (!is_null($start)) { + $startTimeString = $start->format("Y-m-d H:i:s"); + } else { + $today_timestamp = new DateTime("now", new DateTimeZone("UTC")); + $startTimeString = $today_timestamp->format("Y-m-d H:i:s"); + } + + return CcShowDaysQuery::create() + ->add("last_show", null, "=") + ->addOr("first_show", $endTimeString, "<") + ->add("last_show", $startTimeString, ">") + ->find(); + /*$sql = <<< SQL +SELECT * FROM cc_show_days +WHERE last_show IS NULL + OR first_show < :endTimeString + AND last_show > :startTimeString +SQL; + + return Application_Common_Database::prepareAndExecute($sql, + array( ':endTimeString' => $endTimeString, ':startTimeString' => $startTimeString ), 'all');*/ + } + public static function formatShowDuration($duration) { $hPos = strpos($duration, 'h'); @@ -650,7 +680,7 @@ SQL; //DateTime local $start = $this->getNextRepeatingPopulateStartDateTime($showDay); - if (isset($last_how)) { + if (isset($last_show)) { $end = new DateTime($last_show, new DateTimeZone($timezone)); } else { $end = $populateUntil; @@ -1023,7 +1053,7 @@ SQL; * * @return DateTime object */ - private function getPopulateShowUntilDateTIme() + private static function getPopulateShowUntilDateTIme() { $populateUntil = Application_Model_Preference::GetShowsPopulatedUntil(); From 230d1a6aa9f51fe21bae360a232766313f9207c1 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Mar 2013 10:33:06 -0400 Subject: [PATCH 034/128] Fixed bug where shows weren't populating when moving forward in the calendar --- .../application/services/ShowService.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index f44c2c64d..fadda8e6b 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -103,6 +103,10 @@ class Application_Service_ShowService $ccShowDays = $this->ccShow->getCcShowDays(); } + if (!is_null($end)) { + $populateUntil = $end; + } + foreach ($ccShowDays as $day) { switch ($day->getDbRepeatType()) { case NO_REPEAT: @@ -137,20 +141,12 @@ class Application_Service_ShowService $startTimeString = $today_timestamp->format("Y-m-d H:i:s"); } - return CcShowDaysQuery::create() - ->add("last_show", null, "=") - ->addOr("first_show", $endTimeString, "<") - ->add("last_show", $startTimeString, ">") - ->find(); - /*$sql = <<< SQL -SELECT * FROM cc_show_days -WHERE last_show IS NULL - OR first_show < :endTimeString - AND last_show > :startTimeString -SQL; + $c = new Criteria(); + $c->add(CcShowDaysPeer::FIRST_SHOW, $endTimeString, Criteria::LESS_THAN); + $c->addAnd(CcShowDaysPeer::LAST_SHOW, $startTimeString, Criteria::GREATER_THAN); + $c->addOr(CcShowDaysPeer::LAST_SHOW, null, Criteria::ISNULL); - return Application_Common_Database::prepareAndExecute($sql, - array( ':endTimeString' => $endTimeString, ':startTimeString' => $startTimeString ), 'all');*/ + return CcShowDaysPeer::doSelect($c); } public static function formatShowDuration($duration) @@ -664,7 +660,7 @@ SQL; } } $nextDate = $utcEndDateTime->add($repeatInterval); - $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day); + $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); } private function createMonthlyMonthlyRepeatInstances($showDay, $populateUntil, @@ -736,7 +732,7 @@ SQL; } $start = $this->getNextMonthlyMonthlyRepeatDate($start, $timezone); } - $this->setNextRepeatingShowDate($start->format("Y-m-d"), $day); + $this->setNextRepeatingShowDate($start->format("Y-m-d"), $day, $show_id); } /** @@ -1107,12 +1103,12 @@ SQL; * @param $showId * @param $day */ - private function setNextRepeatingShowDate($nextDate, $day) + private function setNextRepeatingShowDate($nextDate, $day, $showId) { $nextInfo = explode(" ", $nextDate); $repeatInfo = CcShowDaysQuery::create() - ->filterByDbShowId($this->ccShow->getDbId()) + ->filterByDbShowId($showId) ->filterByDbDay($day) ->findOne(); From 5ab52b12c710c5d15fd2d8487b134c3c8e414b51 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 26 Mar 2013 15:00:41 -0400 Subject: [PATCH 035/128] CC-4417: Opus codec support --- .../pypo/liquidsoap_scripts/ls_lib.liq | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index ccb37026f..8a6d325eb 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -250,6 +250,74 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de ignore(output_mono(%vorbis(quality=0.9, channels = 1), mean(!source))) end end + else + if bitrate == 24 then + if stereo then + ignore(output_stereo(%opus(bitrate = 24, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 24, stereo = false), mean(!source))) + end + elsif bitrate == 32 then + if stereo then + ignore(output_stereo(%opus(bitrate = 32, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 32, stereo = false), mean(!source))) + end + elsif bitrate == 48 then + if stereo then + ignore(output_stereo(%opus(bitrate = 48, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 48, stereo = false), mean(!source))) + end + elsif bitrate == 64 then + if stereo then + ignore(output_stereo(%opus(bitrate = 64, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 64, stereo = false), mean(!source))) + end + elsif bitrate == 96 then + if stereo then + ignore(output_stereo(%opus(bitrate = 96, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 96, stereo = false), mean(!source))) + end + elsif bitrate == 128 then + if stereo then + ignore(output_stereo(%opus(bitrate = 128, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 128, stereo = false), mean(!source))) + end + elsif bitrate == 160 then + if stereo then + ignore(output_stereo(%opus(bitrate = 160, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 160, stereo = false), mean(!source))) + end + elsif bitrate == 192 then + if stereo then + ignore(output_stereo(%opus(bitrate = 192, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 192, stereo = false), mean(!source))) + end + elsif bitrate == 224 then + if stereo then + ignore(output_stereo(%opus(bitrate = 224, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 224, stereo = false), mean(!source))) + end + elsif bitrate == 256 then + if stereo then + ignore(output_stereo(%opus(bitrate = 256, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 256, stereo = false), mean(!source))) + end + elsif bitrate == 320 then + if stereo then + ignore(output_stereo(%opus(bitrate = 320, stereo = true), !source)) + else + ignore(output_mono(%opus(bitrate = 320, stereo = false), mean(!source))) + end + end end else user_ref = ref user From 418bf0b5ff3a545d1dc539b1d11bf6e33ed85d3f Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 26 Mar 2013 16:03:53 -0400 Subject: [PATCH 036/128] Created calendar service and moved the context menu creation there --- airtime_mvc/application/common/DateHelper.php | 2 +- .../controllers/ScheduleController.php | 146 ++-------------- .../models/airtime/CcShowInstances.php | 10 ++ .../application/services/CalendarService.php | 164 +++++++++++++++++- .../application/services/ShowFormService.php | 29 ++++ .../public/js/airtime/schedule/schedule.js | 6 +- 6 files changed, 218 insertions(+), 139 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index 5d40e9b5f..bbac8abc1 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -266,7 +266,7 @@ class Application_Common_DateHelper public static function ConvertToLocalDateTime($p_dateString){ $dateTime = new DateTime($p_dateString, new DateTimeZone("UTC")); - $dateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); + $dateTime->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone())); return $dateTime; } diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 1d55f282e..0702ede49 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -255,107 +255,12 @@ class ScheduleController extends Zend_Controller_Action public function makeContextMenuAction() { - $id = $this->_getParam('id'); - $menu = array(); - $epochNow = time(); - $baseUrl = Application_Common_OsPath::getBaseDir(); + $instanceId = $this->_getParam('instanceId'); + $showId = $this->_getParam('showId'); - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - try { - $instance = new Application_Model_ShowInstance($id); - } catch (Exception $e) { - $this->view->show_error = true; + $service_calendar = new Application_Service_CalendarService($instanceId); - return false; - } - - $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); - $isDJ = $user->isHostOfShow($instance->getShowId()); - - $showStartLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceStart()); - $showEndLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceEnd()); - - if ($instance->isRecorded() && $epochNow > $showEndLocalDT->getTimestamp()) { - - $file = $instance->getRecordedFile(); - $fileId = $file->getId(); - - $menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview", - "url" => $baseUrl."library/edit-file-md/id/".$fileId); - } - - if ($epochNow < $showStartLocalDT->getTimestamp()) { - if ( ($isAdminOrPM || $isDJ) - && !$instance->isRecorded() - && !$instance->isRebroadcast()) { - - $menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content", - "url" => $baseUrl."showbuilder/builder-dialog/"); - - $menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content", - "url" => $baseUrl."schedule/clear-show"); - } - } - - if (!$instance->isRecorded()) { - - $menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."schedule/show-content-dialog"); - } - - if ($showEndLocalDT->getTimestamp() <= $epochNow - && $instance->isRecorded() - && Application_Model_Preference::GetUploadToSoundcloudOption()) { - - $file = $instance->getRecordedFile(); - $fileId = $file->getId(); - $scid = $instance->getSoundCloudFileId(); - - if ($scid > 0) { - $url = $file->getSoundCloudLinkToFile(); - $menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url); - } - - $text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud'); - $menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud"); - } - - if ($showStartLocalDT->getTimestamp() <= $epochNow && - $epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) { - - if ($instance->isRecorded()) { - $menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); - } else { - - if (!$instance->isRebroadcast()) { - $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); - } - - $menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete"); - } - } - - if ($epochNow < $showStartLocalDT->getTimestamp()) { - - if (!$instance->isRebroadcast() && $isAdminOrPM) { - $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."Schedule/populate-show-form"); - } - - if ($instance->getShow()->isRepeating() && $isAdminOrPM) { - - //create delete sub menu. - $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "items" => array()); - - $menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); - - $menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."schedule/cancel-show"); - } elseif ($isAdminOrPM) { - - $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."schedule/delete-show"); - } - } - - $this->view->items = $menu; + $this->view->items = $service_calendar->makeContextMenu(); } public function clearShowAction() @@ -462,9 +367,7 @@ class ScheduleController extends Zend_Controller_Action unset($this->view->showContent); } - // we removed edit show instance option in menu item - // this feature is disabled in 2.1 and should be back in 2.2 - /*public function populateShowInstanceFormAction(){ + public function populateShowInstanceFormAction(){ $formWhat = new Application_Form_AddShowWhat(); $formWho = new Application_Form_AddShowWho(); $formWhen = new Application_Form_AddShowWhen(); @@ -527,7 +430,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->action = "edit-show-instance"; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); - }*/ + } public function populateShowFormAction() { @@ -538,13 +441,13 @@ class ScheduleController extends Zend_Controller_Action $this->view->action = "edit-show"; $isAdminOrPM = $this->currentUser->isAdminOrPM(); - $isHostOfShow = $this->currentUser->isHostOfShow($showId); + /*$isHostOfShow = $this->currentUser->isHostOfShow($showId); // in case a user was once a dj and had been assigned to a show // but was then changed to an admin user we need to allow // the user to edit the show as an admin (CC-4925) if ($isHostOfShow && !$isAdminOrPM) { $this->view->action = "dj-edit-show"; - } + }*/ $forms = $this->createShowFormAction(); @@ -568,7 +471,7 @@ class ScheduleController extends Zend_Controller_Action } } - public function djEditShowAction() + /*public function djEditShowAction() { $js = $this->_getParam('data'); $data = array(); @@ -586,7 +489,7 @@ class ScheduleController extends Zend_Controller_Action $show->setCustomPassword($data["custom_password"]); $this->view->edit = true; - } + }*/ /*public function editShowInstanceAction(){ $js = $this->_getParam('data'); @@ -782,32 +685,9 @@ class ScheduleController extends Zend_Controller_Action public function calculateDurationAction() { - $startParam = $this->_getParam('startTime'); - $endParam = $this->_getParam('endTime'); - - try { - $startDateTime = new DateTime($startParam); - $endDateTime = new DateTime($endParam); - - $UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC')); - $UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC')); - - $duration = $UTCEndDateTime->diff($UTCStartDateTime); - - $day = intval($duration->format('%d')); - if ($day > 0) { - $hour = intval($duration->format('%h')); - $min = intval($duration->format('%i')); - $hour += $day * 24; - $hour = min($hour, 99); - $sign = $duration->format('%r'); - $result = sprintf('%s%02dh %02dm', $sign, $hour, $min); - } else { - $result = $duration->format('%r%Hh %Im'); - } - } catch (Exception $e) { - $result = "Invalid Date"; - } + $service_showForm = new Application_Service_ShowFormService(); + $result = $service_showForm->calculateDuration($this->_getParam('startTime'), + $this->_getParam('endTime')); echo Zend_Json::encode($result); exit(); diff --git a/airtime_mvc/application/models/airtime/CcShowInstances.php b/airtime_mvc/application/models/airtime/CcShowInstances.php index 4625d1f91..fb886f684 100644 --- a/airtime_mvc/application/models/airtime/CcShowInstances.php +++ b/airtime_mvc/application/models/airtime/CcShowInstances.php @@ -175,4 +175,14 @@ class CcShowInstances extends BaseCcShowInstances { return true; } + public function isRecorded() + { + return $this->getDbRecord() == 1 ? true : false; + } + + public function isRebroadcast() + { + return $this->getDbRebroadcast() == 1 ? true : false; + } + } // CcShowInstances diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 0541ed57b..c1f0a0057 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -2,9 +2,169 @@ class Application_Service_CalendarService { - public function __construct() + private $currentUser; + private $ccShowInstance; + private $showId; + + public function __construct($instanceId = null) { - + if (!is_null($instanceId)) { + $this->ccShowInstance = CcShowInstancesQuery::create()->findPk($instanceId); + $this->showId = $this->ccShowInstance->getDbShowId(); + } + + $service_user = new Application_Service_UserService(); + $this->currentUser = $service_user->getCurrentUser(); + } + + /** + * + * Enter description here ... + */ + public function makeContextMenu() + { + $menu = array(); + $now = time(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + $isAdminOrPM = $this->currentUser->isAdminOrPM(); + $isHostOfShow = $this->currentUser->isHostOfShow($this->showId); + + //DateTime objects in UTC + $startDT = new DateTime($this->ccShowInstance->getDbStarts(), + new DateTimeZone("UTC")); + $endDT = new DateTime($this->ccShowInstance->getDbEnds(), + new DateTimeZone("UTC")); + + //timestamps + $start = $startDT->getTimestamp(); + $end = $endDT->getTimestamp(); + + //show has ended + if ($now > $end) { + if ($this->ccShowInstance->isRecorded()) { + + $ccFile = $this->ccShowInstance->getCcFiles(); + + $menu["view_recorded"] = array( + "name" => _("View Recorded File Metadata"), + "icon" => "overview", + "url" => $baseUrl."library/edit-file-md/id/".$ccFile->getDbId()); + + //recorded show can be uploaded to soundcloud + if (Application_Model_Preference::GetUploadToSoundcloudOption()) { + $scid = $ccFile->getDbSoundcloudId(); + + if ($scid > 0) { + $menu["soundcloud_view"] = array( + "name" => _("View on Soundcloud"), + "icon" => "soundcloud", + "url" => $ccFile->getDbSoundcloudLinkToFile()); + } + + $text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud'); + $menu["soundcloud_upload"] = array( + "name"=> $text, + "icon" => "soundcloud"); + } + } + } else { + //Show content can be modified from the calendar if: + // the show has not started, + // the user is admin or hosting the show, + // the show is not recorded or rebroadcasted + if ($now < $start && ($isAdminOrPM || $isHostOfShow) && + !$this->ccShowInstance->isRecorded() && !$this->ccShowInstance->isRebroadcast()) { + + $menu["schedule"] = array( + "name"=> _("Add / Remove Content"), + "icon" => "add-remove-content", + "url" => $baseUrl."showbuilder/builder-dialog/"); + + $menu["clear"] = array( + "name"=> _("Remove All Content"), + "icon" => "remove-all-content", + "url" => $baseUrl."schedule/clear-show"); + } + + //"Show Content" should be a menu item at all times except when + //the show is recorded + if (!$this->ccShowInstance->isRecorded()) { + + $menu["content"] = array( + "name"=> _("Show Content"), + "icon" => "overview", + "url" => $baseUrl."schedule/show-content-dialog"); + } + + //show is currently playing and user is admin + if ($start <= $now && $now < $end && $isAdminOrPM) { + + if ($this->ccShowInstance->isRecorded()) { + $menu["cancel_recorded"] = array( + "name"=> _("Cancel Current Show"), + "icon" => "delete"); + } else { + $menu["cancel"] = array( + "name"=> _("Cancel Current Show"), + "icon" => "delete"); + } + } + + $isRepeating = $this->ccShowInstance->getCcShow()->getFirstCcShowDay()->isRepeating(); + if (!$this->ccShowInstance->isRebroadcast()) { + if ($isRepeating) { + $menu["edit"] = array( + "name" => _("Edit"), + "icon" => "edit", + "items" => array()); + + $menu["edit"]["items"]["all"] = array( + "name" => _("Edit Show"), + "icon" => "edit", + "url" => $baseUrl."Schedule/populate-show-form"); + + $menu["edit"]["items"]["instance"] = array( + "name" => _("Edit This Instance"), + "icon" => "edit", + "url" => $baseUrl."Schedule/populate-show-instance-form"); + } else { + $menu["edit"] = array( + "name"=> _("Edit Show"), + "icon" => "edit", + "_type"=>"all", + "url" => $baseUrl."Schedule/populate-show-form"); + } + } + + //show hasn't started yet and user is admin + if ($now < $start && $isAdminOrPM) { + //show is repeating so give user the option to delete all + //repeating instances or just the one + if ($isRepeating) { + //create delete sub menu. + $menu["del"] = array( + "name"=> _("Delete"), + "icon" => "delete", + "items" => array()); + + $menu["del"]["items"]["single"] = array( + "name"=> _("Delete This Instance"), + "icon" => "delete", + "url" => $baseUrl."schedule/delete-show"); + + $menu["del"]["items"]["following"] = array( + "name"=> _("Delete This Instance and All Following"), + "icon" => "delete", + "url" => $baseUrl."schedule/cancel-show"); + } else { + $menu["del"] = array( + "name"=> _("Delete"), + "icon" => "delete", + "url" => $baseUrl."schedule/delete-show"); + } + } + } + return $menu; } } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index e8a085b08..4d0f099ee 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -149,6 +149,8 @@ class Application_Service_ShowFormService //subtract one day $repeatEndDate->sub(new DateInterval("P1D")); + //default monthly repeat type + $monthlyRepeatType = 2; $repeatType = $ccShowDays[0]->getDbRepeatType(); if ($repeatType == REPEAT_MONTHLY_WEEKLY) { $monthlyRepeatType = $repeatType; @@ -360,4 +362,31 @@ SQL; return false; } } + + public function calculateDuration($start, $end) + { + try { + $startDateTime = new DateTime($start); + $endDateTime = new DateTime($end); + + $UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC')); + $UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC')); + + $duration = $UTCEndDateTime->diff($UTCStartDateTime); + + $day = intval($duration->format('%d')); + if ($day > 0) { + $hour = intval($duration->format('%h')); + $min = intval($duration->format('%i')); + $hour += $day * 24; + $hour = min($hour, 99); + $sign = $duration->format('%r'); + return sprintf('%s%02dh %02dm', $sign, $hour, $min); + } else { + return $duration->format('%r%Hh %Im'); + } + } catch (Exception $e) { + return "Invalid Date"; + } + } } \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index a4fd1851e..ac5e2dcc1 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -379,7 +379,7 @@ $(document).ready(function() { //edit a single instance callback = function() { - $.get(edit.instance.url, {format: "json", id: data.id, type: "instance"}, function(json){ + $.get(edit.instance.url, {format: "json", showId: data.showId, instanceId: data.id, type: "instance"}, function(json){ beginEditShow(json); }); }; @@ -497,11 +497,11 @@ $(document).ready(function() { items = oItems; } - + $.ajax({ url: baseUrl+"schedule/make-context-menu", type: "GET", - data: {id : data.id, format: "json"}, + data: {instanceId : data.id, showId: data.showId, format: "json"}, dataType: "json", async: false, success: function(json){ From 33230295079989dd96da0d42e447ea416f53bee3 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 27 Mar 2013 12:33:47 +0000 Subject: [PATCH 037/128] Prompt user to run airtime-install script with -d option for custom Apache setups --- debian/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index d3c7ca5c9..2e410febe 100755 --- a/debian/postinst +++ b/debian/postinst @@ -16,7 +16,7 @@ includefile="${configdir}/apache.conf" a2tplfile="${configdir}/apache.vhost.tpl" phpinifile="${configdir}/airtime.ini" OLDVERSION="$2" -NEWVERSION="2.3.0" +NEWVERSION="2.3.1" case "$1" in configure|reconfigure) @@ -229,7 +229,7 @@ case "$1" in echo "Upgrades from Airtime versions before 2.1.0 are not supported. Please back up your files and perform a clean install." elif [ "${APACHESETUP}" == "no thanks" ]; then - echo "Please run the ${tmpdir}/install_minimal/airtime-install script after you have set up the web server." + echo "Please run the ${tmpdir}/install_minimal/airtime-install script with the -d option after you have set up the web server." else From e259639d1a9ce7683f86a601ae69c1b100460f90 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 27 Mar 2013 09:02:49 -0400 Subject: [PATCH 038/128] Removed scheduleController private variable, currentUser Removed showService private variable, currentUser --- .../controllers/ScheduleController.php | 93 +++++-------------- .../application/services/ShowFormService.php | 7 +- .../application/services/ShowService.php | 7 +- 3 files changed, 32 insertions(+), 75 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 0702ede49..9555504ac 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -5,8 +5,6 @@ class ScheduleController extends Zend_Controller_Action protected $sched_sess = null; - private $currentUser; - public function init() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); @@ -40,9 +38,6 @@ class ScheduleController extends Zend_Controller_Action ->initContext(); $this->sched_sess = new Zend_Session_Namespace("schedule"); - - $service_user = new Application_Service_UserService(); - $this->currentUser = $service_user->getCurrentUser(); } public function indexAction() @@ -117,13 +112,16 @@ class ScheduleController extends Zend_Controller_Action public function eventFeedAction() { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + $start = new DateTime($this->_getParam('start', null)); $start->setTimezone(new DateTimeZone("UTC")); $end = new DateTime($this->_getParam('end', null)); $end->setTimezone(new DateTimeZone("UTC")); $events = &Application_Model_Show::getFullCalendarEvents($start, $end, - $this->currentUser->isAdminOrPM()); + $currentUser->isAdminOrPM()); $this->view->events = $events; } @@ -367,81 +365,32 @@ class ScheduleController extends Zend_Controller_Action unset($this->view->showContent); } - public function populateShowInstanceFormAction(){ - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - $formLive = new Application_Form_AddShowLiveStream(); + public function populateShowInstanceFormAction() + { + $showId = $this->_getParam('showId'); + $instanceId = $this->_getParam('instanceId'); + $service_showForm = new Application_Service_ShowFormService($showId, $instanceId); - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); + $forms = $this->createShowFormAction(); + + $service_showForm->delegateShowInstanceFormPopulation($forms); - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; - $this->view->live = $formLive; $this->view->addNewShow = false; - - $showInstanceId = $this->_getParam('id'); - - $show_instance = CcShowInstancesQuery::create()->findPK($showInstanceId); - $show = new Application_Model_Show($show_instance->getDbShowId()); - - $starts_string = $show_instance->getDbStarts(); - $ends_string = $show_instance->getDbEnds(); - - $starts_datetime = new DateTime($starts_string, new DateTimeZone("UTC")); - $ends_datetime = new DateTime($ends_string, new DateTimeZone("UTC")); - - $starts_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); - $ends_datetime->setTimezone(new DateTimeZone(date_default_timezone_get())); - - $instance_duration = $starts_datetime->diff($ends_datetime); - - $formWhat->populate(array('add_show_id' => $show->getId(), - 'add_show_instance_id' => $showInstanceId, - 'add_show_name' => $show->getName(), - 'add_show_url' => $show->getUrl(), - 'add_show_genre' => $show->getGenre(), - 'add_show_description' => $show->getDescription())); - - $formWhen->populate(array('add_show_start_date' => $starts_datetime->format("Y-m-d"), - 'add_show_start_time' => $starts_datetime->format("H:i"), - 'add_show_end_date_no_repeat' => $ends_datetime->format("Y-m-d"), - 'add_show_end_time' => $ends_datetime->format("H:i"), - 'add_show_duration' => $instance_duration->format("%h"))); - - $formWhat->disable(); - $formWho->disable(); - $formWhen->disableRepeatCheckbox(); - $formRepeats->disable(); - $formStyle->disable(); - - //$formRecord->disable(); - //$formAbsoluteRebroadcast->disable(); - //$formRebroadcast->disable(); - $this->view->action = "edit-show-instance"; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } public function populateShowFormAction() { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + $showId = $this->_getParam('showId'); $instanceId = $this->_getParam('instanceId'); $service_showForm = new Application_Service_ShowFormService($showId, $instanceId); - $this->view->action = "edit-show"; - - $isAdminOrPM = $this->currentUser->isAdminOrPM(); - /*$isHostOfShow = $this->currentUser->isHostOfShow($showId); + $isAdminOrPM = $currentUser->isAdminOrPM(); + /*$isHostOfShow = $currentUser->isHostOfShow($showId); // in case a user was once a dj and had been assigned to a show // but was then changed to an admin user we need to allow // the user to edit the show as an admin (CC-4925) @@ -451,7 +400,7 @@ class ScheduleController extends Zend_Controller_Action $forms = $this->createShowFormAction(); - $service_showForm->delegateFormPopulation($forms); + $service_showForm->delegateShowFormPopulation($forms); if (!$isAdminOrPM) { foreach ($forms as $form) { @@ -459,13 +408,17 @@ class ScheduleController extends Zend_Controller_Action } } + $this->view->action = "edit-show"; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); $this->view->entries = 5; } public function getFormAction() { - if ($this->currentUser->isAdminOrPM()) { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + + if ($currentUser->isAdminOrPM()) { $this->createShowFormAction(true); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 4d0f099ee..bdf41d78c 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -73,6 +73,11 @@ class Application_Service_ShowFormService $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); } + public function delegateShowInstanceFormPopulation($forms) + { + $this->populateFormWhat($forms["what"]); + } + /** * * Delegates populating each show form with the appropriate @@ -80,7 +85,7 @@ class Application_Service_ShowFormService * * @param $forms */ - public function delegateFormPopulation($forms) + public function delegateShowFormPopulation($forms) { $this->populateFormWhat($forms["what"]); $this->populateFormWhen($forms["when"]); diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index fadda8e6b..e589786b2 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -9,20 +9,19 @@ define("REPEAT_MONTHLY_WEEKLY", 3); class Application_Service_ShowService { private $ccShow; - private $currentUser; public function __construct($showId=null) { if (!is_null($showId)) { $this->ccShow = CcShowQuery::create()->findPk($showId); } - - $service_user = new Application_Service_UserService(); - $this->currentUser = $service_user->getCurrentUser(); } public function addUpdateShow($showData, $isUpdate=false) { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + if ($showData["add_show_repeats"]) { $repeatType = $showData["add_show_repeat_type"]; if ($showData["add_show_repeat_type"] == 2) { From 731b86b36c7859aabb43c04dbeb0dd1b7b91128d Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 27 Mar 2013 16:25:39 -0400 Subject: [PATCH 039/128] Added back editing a repeating show instance feature --- .../controllers/ScheduleController.php | 40 ++++++++--- .../application/services/CalendarService.php | 9 +-- .../application/services/SchedulerService.php | 10 ++- .../application/services/ShowFormService.php | 54 ++++++++++++++- .../application/services/ShowService.php | 68 +++++++++++++++++-- 5 files changed, 158 insertions(+), 23 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 9555504ac..473e54e13 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -22,7 +22,7 @@ class ScheduleController extends Zend_Controller_Action ->addActionContext('get-current-playlist', 'json') ->addActionContext('remove-group', 'json') ->addActionContext('populate-show-form', 'json') - ->addActionContext('populate-show-instance-form', 'json') + ->addActionContext('populate-repeating-show-instance-form', 'json') ->addActionContext('cancel-show', 'json') ->addActionContext('cancel-current-show', 'json') ->addActionContext('get-form', 'json') @@ -30,7 +30,7 @@ class ScheduleController extends Zend_Controller_Action ->addActionContext('content-context-menu', 'json') ->addActionContext('set-time-scale', 'json') ->addActionContext('set-time-interval', 'json') - ->addActionContext('edit-show-instance', 'json') + ->addActionContext('edit-repeating-show-instance', 'json') ->addActionContext('dj-edit-show', 'json') ->addActionContext('calculate-duration', 'json') ->addActionContext('get-current-show', 'json') @@ -365,7 +365,7 @@ class ScheduleController extends Zend_Controller_Action unset($this->view->showContent); } - public function populateShowInstanceFormAction() + public function populateRepeatingShowInstanceFormAction() { $showId = $this->_getParam('showId'); $instanceId = $this->_getParam('instanceId'); @@ -376,7 +376,7 @@ class ScheduleController extends Zend_Controller_Action $service_showForm->delegateShowInstanceFormPopulation($forms); $this->view->addNewShow = false; - $this->view->action = "edit-show-instance"; + $this->view->action = "edit-repeating-show-instance"; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } @@ -444,7 +444,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->edit = true; }*/ - /*public function editShowInstanceAction(){ + public function editRepeatingShowInstanceAction(){ $js = $this->_getParam('data'); $data = array(); @@ -453,15 +453,39 @@ class ScheduleController extends Zend_Controller_Action $data[$j["name"]] = $j["value"]; } - $success = Application_Model_Schedule::updateShowInstance($data, $this); - if ($success) { + $data['add_show_hosts'] = $this->_getParam('hosts'); + + $service_showForm = new Application_Service_ShowFormService( + $data["add_show_id"], $data["add_show_instance_id"]); + $service_show = new Application_Service_ShowService(); + + $forms = $this->createShowFormAction(); + + list($data, $validateStartDate, $validateStartTime, $originalShowStartDateTime) = + $service_showForm->preEditShowValidationCheck($data); + + if ($service_showForm->validateShowForms($forms, $data, $validateStartDate, + $originalShowStartDateTime, true, $data["add_show_instance_id"])) { + + //treat repeating instance has a new and separate show + $service_show->deleteRepeatingInstance($data["add_show_instance_id"]); + $service_show->addUpdateShow($data); + $this->view->addNewShow = true; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } else { + if (!$validateStartDate) { + $this->view->when->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } + if (!$validateStartTime) { + $this->view->when->getElement('add_show_start_time')->setOptions(array('disabled' => true)); + } + $this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true)); $this->view->addNewShow = false; + $this->view->action = "edit-show"; $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } - }*/ + } public function editShowAction() { diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index c1f0a0057..0d60e8a1f 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -30,10 +30,8 @@ class Application_Service_CalendarService $isHostOfShow = $this->currentUser->isHostOfShow($this->showId); //DateTime objects in UTC - $startDT = new DateTime($this->ccShowInstance->getDbStarts(), - new DateTimeZone("UTC")); - $endDT = new DateTime($this->ccShowInstance->getDbEnds(), - new DateTimeZone("UTC")); + $startDT = $this->ccShowInstance->getDbStarts(null); + $endDT = $this->ccShowInstance->getDbEnds(null); //timestamps $start = $startDT->getTimestamp(); @@ -126,7 +124,7 @@ class Application_Service_CalendarService $menu["edit"]["items"]["instance"] = array( "name" => _("Edit This Instance"), "icon" => "edit", - "url" => $baseUrl."Schedule/populate-show-instance-form"); + "url" => $baseUrl."Schedule/populate-repeating-show-instance-form"); } else { $menu["edit"] = array( "name"=> _("Edit Show"), @@ -141,7 +139,6 @@ class Application_Service_CalendarService //show is repeating so give user the option to delete all //repeating instances or just the one if ($isRepeating) { - //create delete sub menu. $menu["del"] = array( "name"=> _("Delete"), "icon" => "delete", diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index 4a4f9172b..097e1f3ae 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -8,9 +8,10 @@ class Application_Service_SchedulerService */ public static function updateScheduleStartTime($instanceIds, $diff) { + $con = Propel::getConnection(); if (count($instanceIds) > 0 && $diff != 0) { $showIdList = implode(",", $instanceIds); - $sql = << $diff, ':diff2' => $diff, ':showIds' => $showIdList), - 'execute'); + 'execute');*/ + $sql = "UPDATE cc_schedule " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE instance_id IN ($showIdList)"; + $con->exec($sql); } } diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index bdf41d78c..eaaf4da1d 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -76,6 +76,17 @@ class Application_Service_ShowFormService public function delegateShowInstanceFormPopulation($forms) { $this->populateFormWhat($forms["what"]); + $this->populateInstanceFormWhen($forms["when"]); + $this->populateFormWho($forms["who"]); + $this->populateFormLive($forms["live"]); + $this->populateFormStyle($forms["style"]); + + //no need to populate these forms since the user won't + //be able to see them + $forms["repeats"]->disable(); + $forms["record"]->disable(); + $forms["rebroadcast"]->disable(); + $forms["abs_rebroadcast"]->disable(); } /** @@ -92,6 +103,7 @@ class Application_Service_ShowFormService $this->populateFormRepeats($forms["repeats"]); $this->populateFormWho($forms["who"]); $this->populateFormStyle($forms["style"]); + $this->populateFormLive($forms["live"]); $this->populateFormRecord($forms["record"]); $this->populateFormRebroadcastRelative($forms["rebroadcast"]); $this->populateFormRebroadcastAbsolute($forms["abs_rebroadcast"]); @@ -137,6 +149,36 @@ class Application_Service_ShowFormService 'add_show_repeats' => $ccShowDay->isRepeating() ? 1 : 0)); } + private function populateInstanceFormWhen($form) + { + $ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId); + + $timezone = new DateTimeZone(Application_Model_Preference::GetTimezone()); + //DateTime object in UTC + $showStart = $ccShowInstance->getDbStarts(null); + $showStart->setTimezone($timezone); + + $showEnd = $ccShowInstance->getDbEnds(null); + $showEnd->setTimezone($timezone); + + //if the show has started, do not allow editing on the start time + if ($showStart->getTimestamp() <= time()) { + $form->disableStartDateAndTime(); + } + + $form->populate( + array( + 'add_show_start_date' => $showStart->format("Y-m-d"), + 'add_show_start_time' => $showStart->format("H:i"), + 'add_show_end_date_no_repeat' => $showEnd->format("Y-m-d"), + 'add_show_end_time' => $showEnd->format("H:i"), + 'add_show_duration' => $this->calculateDuration( + $showStart->format("Y-m-d H:i:s"), $showEnd->format("Y-m-d H:i:s")), + 'add_show_repeats' => 0)); + + $form->getElement('add_show_repeats')->setOptions(array("disabled" => true)); + } + private function populateFormRepeats($form) { $ccShowDays = $this->ccShow->getCcShowDays(); @@ -194,6 +236,16 @@ class Application_Service_ShowFormService 'add_show_color' => $this->ccShow->getDbColor())); } + private function populateFormLive($form) + { + $form->populate( + array( + "cb_airtime_auth" => $this->ccShow->getDbLiveStreamUsingAirtimeAuth(), + "cb_custom_auth" => $this->ccShow->getDbLiveStreamUsingCustomAuth(), + "custom_username" => $this->ccShow->getDbLiveStreamUser(), + "custom_password" => $this->ccShow->getDbLiveStreamPass())); + } + private function populateFormRecord($form) { $form->populate( @@ -388,7 +440,7 @@ SQL; $sign = $duration->format('%r'); return sprintf('%s%02dh %02dm', $sign, $hour, $min); } else { - return $duration->format('%r%Hh %Im'); + return $duration->format('%Hh %Im'); } } catch (Exception $e) { return "Invalid Date"; diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index e589786b2..671b3971a 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -17,6 +17,19 @@ class Application_Service_ShowService } } + /** + * + * When the user is editing a single instance of a repeating show + * we want to treat it as a completely new show so we need to delete + * the instance first + * + * @param $instanceId + */ + public function deleteRepeatingInstance($instanceId) + { + CcShowInstancesQuery::create()->findPk($instanceId)->delete(); + } + public function addUpdateShow($showData, $isUpdate=false) { $service_user = new Application_Service_UserService(); @@ -30,7 +43,6 @@ class Application_Service_ShowService } else { $repeatType = -1; } - //$repeatType = ($showData['add_show_repeats']) ? $showData['add_show_repeat_type'] : -1; $isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0; $isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0; @@ -40,7 +52,7 @@ class Application_Service_ShowService $con = Propel::getConnection(); $con->beginTransaction(); try { - if (!$this->currentUser->isAdminOrPM()) { + if (!$currentUser->isAdminOrPM()) { throw new Exception("Permission denied"); } //update ccShow @@ -52,7 +64,7 @@ class Application_Service_ShowService // schedule start/end times $this->applyShowStartEndDifference($showData); $this->deleteRebroadcastInstances(); - $this->deleteCcShowDays(); + //$this->deleteCcShowDays(); $this->deleteCcShowHosts(); if ($isRebroadcast) { //delete entry in cc_show_rebroadcast @@ -105,7 +117,7 @@ class Application_Service_ShowService if (!is_null($end)) { $populateUntil = $end; } - +Logging::info($ccShowDays); foreach ($ccShowDays as $day) { switch ($day->getDbRepeatType()) { case NO_REPEAT: @@ -379,6 +391,14 @@ SQL; } } + foreach ($daysRemoved as $day) { + //delete the cc_show_day entries as well + CcShowDaysQuery::create() + ->filterByDbShowId($showId) + ->filterByDbDay($day) + ->delete(); + } + $uncheckedDays = pg_escape_string(implode(",", $daysRemovedUTC)); $sql = << gmdate("Y-m-d H:i:s"), ":showId" => $showId), "execute"); + } private function deleteAllInstances($showId) @@ -857,6 +878,27 @@ SQL; } } + private function hasCcShowDay($repeatType, $day) + { + return $this->getCcShowDay($repeatType, $day) ? true : false; + } + + private function getCcShowDay($repeatType, $day) + { + $ccShowDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->ccShow->getDbId()) + ->filterByDbDay($day) + ->filterByDbRepeatType($repeatType) + ->limit(1) + ->find(); + + if ($ccShowDay->isEmpty()) { + return false; + } else { + return $ccShowDay[0]; + } + } + /** * * Sets the fields for a cc_show table row @@ -923,7 +965,11 @@ SQL; // Don't set day for monthly repeat type, it's invalid if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { - $showDay = new CcShowDays(); + if ($this->hasCcShowDay($repeatType, null)) { + $showDay = $this->getCcShowDay($repeatType, null); + } else { + $showDay = new CcShowDays(); + } $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTime->format("H:i:s")); @@ -932,6 +978,9 @@ SQL; $showDay->setDbRepeatType($repeatType); $showDay->setDbShowId($showId); $showDay->setDbRecord($isRecorded); + //in case we are editing a show we need to set this to the first show + //so when editing, the date period iterator will start from the beginning + $showDay->setDbNextPopDate($startDateTime->format("Y-m-d")); $showDay->save(); } else { foreach ($showData['add_show_day_check'] as $day) { @@ -946,7 +995,11 @@ SQL; $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); } if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { - $showDay = new CcShowDays(); + if ($this->hasCcShowDay($repeatType, $day)) { + $showDay = $this->getCcShowDay($repeatType, $day); + } else { + $showDay = new CcShowDays(); + } $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTimeClone->format("H:i")); @@ -956,6 +1009,9 @@ SQL; $showDay->setDbRepeatType($repeatType); $showDay->setDbShowId($showId); $showDay->setDbRecord($isRecorded); + //in case we are editing a show we need to set this to the first show + //so when editing, the date period iterator will start from the beginning + $showDay->setDbNextPopDate($startDateTimeClone->format("Y-m-d")); $showDay->save(); } } From d0691b114cb128ddcf38036e671caea547ed5352 Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 28 Mar 2013 14:25:40 -0400 Subject: [PATCH 040/128] Show linking --- .../application/services/ShowService.php | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 671b3971a..8ba8fd0f9 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -73,7 +73,7 @@ class Application_Service_ShowService } //update ccShowDays - $this->setCcShowDays($showData, $repeatType, $isRecorded); + $this->setCcShowDays($showData, $repeatType, $isRecorded, $isRebroadcast, $isUpdate); //update ccShowRebroadcasts $this->setCcShowRebroadcasts($showData, $repeatType, $isRecorded); @@ -104,12 +104,14 @@ class Application_Service_ShowService * Receives a cc_show id and determines whether to create a * single show instance or repeating show instances */ - public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null) + public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null, $ccShowDay=null) { $populateUntil = $this->getPopulateShowUntilDateTIme(); if (is_null($this->ccShow)) { $ccShowDays = $this->getShowDaysInRange($populateUntil, $end); + } elseif ($isUpdate && !is_null($ccShowDay)) { + $ccShowDays = array(0 => $ccShowDay); } else { $ccShowDays = $this->ccShow->getCcShowDays(); } @@ -117,7 +119,7 @@ class Application_Service_ShowService if (!is_null($end)) { $populateUntil = $end; } -Logging::info($ccShowDays); + foreach ($ccShowDays as $day) { switch ($day->getDbRepeatType()) { case NO_REPEAT: @@ -679,8 +681,10 @@ SQL; } } } - $nextDate = $utcEndDateTime->add($repeatInterval); - $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); + if (!$isUpdate) { + $nextDate = $utcEndDateTime->add($repeatInterval); + $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); + } } private function createMonthlyMonthlyRepeatInstances($showDay, $populateUntil, @@ -822,6 +826,7 @@ SQL; private function getNextRepeatingPopulateStartDateTime($showDay) { $nextPopDate = $showDay->getDbNextPopDate(); + Logging::info($nextPopDate); $startTime = $showDay->getDbStartTime(); if (isset($nextPopDate)) { @@ -938,7 +943,7 @@ SQL; * @param $isRecorded * @param $showDay ccShowDay object we are setting values on */ - private function setCcShowDays($showData, $repeatType, $isRecorded) + private function setCcShowDays($showData, $repeatType, $isRecorded, $isRebroadcast, $isUpdate) { $showId = $this->ccShow->getDbId(); @@ -967,8 +972,10 @@ SQL; if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { if ($this->hasCcShowDay($repeatType, null)) { $showDay = $this->getCcShowDay($repeatType, null); + $newShowDay = false; } else { $showDay = new CcShowDays(); + $newShowDay = true; } $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); @@ -982,6 +989,9 @@ SQL; //so when editing, the date period iterator will start from the beginning $showDay->setDbNextPopDate($startDateTime->format("Y-m-d")); $showDay->save(); + if ($newShowDay && $isUpdate) { + $this->delegateInstanceCreation($isRebroadcast, $isUpdate, $endDateTime, $showDay); + } } else { foreach ($showData['add_show_day_check'] as $day) { $daysAdd=0; @@ -997,8 +1007,10 @@ SQL; if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { if ($this->hasCcShowDay($repeatType, $day)) { $showDay = $this->getCcShowDay($repeatType, $day); + $newShowDay = false; } else { $showDay = new CcShowDays(); + $newShowDay = true; } $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); $showDay->setDbLastShow($endDate); @@ -1013,6 +1025,9 @@ SQL; //so when editing, the date period iterator will start from the beginning $showDay->setDbNextPopDate($startDateTimeClone->format("Y-m-d")); $showDay->save(); + if ($newShowDay && $isUpdate) { + $this->delegateInstanceCreation($isRebroadcast, $isUpdate, $endDateTime, $showDay); + } } } } From 1eba09fc4cd63664bdc6c47f4afda489fa4859d3 Mon Sep 17 00:00:00 2001 From: denise Date: Thu, 28 Mar 2013 16:19:05 -0400 Subject: [PATCH 041/128] Show linking --- .../application/services/ShowService.php | 38 ++++--------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 8ba8fd0f9..3665febe0 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -64,7 +64,7 @@ class Application_Service_ShowService // schedule start/end times $this->applyShowStartEndDifference($showData); $this->deleteRebroadcastInstances(); - //$this->deleteCcShowDays(); + $this->deleteCcShowDays(); $this->deleteCcShowHosts(); if ($isRebroadcast) { //delete entry in cc_show_rebroadcast @@ -73,7 +73,7 @@ class Application_Service_ShowService } //update ccShowDays - $this->setCcShowDays($showData, $repeatType, $isRecorded, $isRebroadcast, $isUpdate); + $this->setCcShowDays($showData, $repeatType, $isRecorded); //update ccShowRebroadcasts $this->setCcShowRebroadcasts($showData, $repeatType, $isRecorded); @@ -104,14 +104,12 @@ class Application_Service_ShowService * Receives a cc_show id and determines whether to create a * single show instance or repeating show instances */ - public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null, $ccShowDay=null) + public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null) { $populateUntil = $this->getPopulateShowUntilDateTIme(); if (is_null($this->ccShow)) { $ccShowDays = $this->getShowDaysInRange($populateUntil, $end); - } elseif ($isUpdate && !is_null($ccShowDay)) { - $ccShowDays = array(0 => $ccShowDay); } else { $ccShowDays = $this->ccShow->getCcShowDays(); } @@ -681,10 +679,8 @@ SQL; } } } - if (!$isUpdate) { - $nextDate = $utcEndDateTime->add($repeatInterval); - $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); - } + $nextDate = $utcEndDateTime->add($repeatInterval); + $this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id); } private function createMonthlyMonthlyRepeatInstances($showDay, $populateUntil, @@ -943,7 +939,7 @@ SQL; * @param $isRecorded * @param $showDay ccShowDay object we are setting values on */ - private function setCcShowDays($showData, $repeatType, $isRecorded, $isRebroadcast, $isUpdate) + private function setCcShowDays($showData, $repeatType, $isRecorded) { $showId = $this->ccShow->getDbId(); @@ -970,13 +966,7 @@ SQL; // Don't set day for monthly repeat type, it's invalid if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) { - if ($this->hasCcShowDay($repeatType, null)) { - $showDay = $this->getCcShowDay($repeatType, null); - $newShowDay = false; - } else { - $showDay = new CcShowDays(); - $newShowDay = true; - } + $showDay = new CcShowDays(); $showDay->setDbFirstShow($startDateTime->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTime->format("H:i:s")); @@ -989,9 +979,6 @@ SQL; //so when editing, the date period iterator will start from the beginning $showDay->setDbNextPopDate($startDateTime->format("Y-m-d")); $showDay->save(); - if ($newShowDay && $isUpdate) { - $this->delegateInstanceCreation($isRebroadcast, $isUpdate, $endDateTime, $showDay); - } } else { foreach ($showData['add_show_day_check'] as $day) { $daysAdd=0; @@ -1005,13 +992,7 @@ SQL; $startDateTimeClone->add(new DateInterval("P".$daysAdd."D")); } if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) { - if ($this->hasCcShowDay($repeatType, $day)) { - $showDay = $this->getCcShowDay($repeatType, $day); - $newShowDay = false; - } else { - $showDay = new CcShowDays(); - $newShowDay = true; - } + $showDay = new CcShowDays(); $showDay->setDbFirstShow($startDateTimeClone->format("Y-m-d")); $showDay->setDbLastShow($endDate); $showDay->setDbStartTime($startDateTimeClone->format("H:i")); @@ -1025,9 +1006,6 @@ SQL; //so when editing, the date period iterator will start from the beginning $showDay->setDbNextPopDate($startDateTimeClone->format("Y-m-d")); $showDay->save(); - if ($newShowDay && $isUpdate) { - $this->delegateInstanceCreation($isRebroadcast, $isUpdate, $endDateTime, $showDay); - } } } } From ab10ae68a279a1a749fc5f5db4c3138693a31eec Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 1 Apr 2013 14:42:35 -0400 Subject: [PATCH 042/128] CC-5036: Add back edit show instance functionality --- .../controllers/ScheduleController.php | 4 +- airtime_mvc/application/models/Show.php | 2 +- .../application/services/ShowService.php | 128 ++++++++++++++---- 3 files changed, 105 insertions(+), 29 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 473e54e13..3a30319e7 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -467,9 +467,7 @@ class ScheduleController extends Zend_Controller_Action if ($service_showForm->validateShowForms($forms, $data, $validateStartDate, $originalShowStartDateTime, true, $data["add_show_instance_id"])) { - //treat repeating instance has a new and separate show - $service_show->deleteRepeatingInstance($data["add_show_instance_id"]); - $service_show->addUpdateShow($data); + $service_show->createShowFromRepeatingInstance($data); $this->view->addNewShow = true; $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index da71f3a21..5cd0d727d 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1666,7 +1666,7 @@ SQL; if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $end_timestamp->getTimestamp()) { //Application_Model_Show::populateAllShowsInRange($showsPopUntil, $end_timestamp); $service_show = new Application_Service_ShowService(); - $service_show->delegateInstanceCreation(null, false, $end_timestamp); + $service_show->delegateInstanceCreation(null, false, null, $end_timestamp); Application_Model_Preference::SetShowsPopulatedUntil($end_timestamp); } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 3665febe0..614e28d37 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -17,17 +17,71 @@ class Application_Service_ShowService } } - /** - * - * When the user is editing a single instance of a repeating show - * we want to treat it as a completely new show so we need to delete - * the instance first - * - * @param $instanceId - */ - public function deleteRepeatingInstance($instanceId) - { - CcShowInstancesQuery::create()->findPk($instanceId)->delete(); + public function createShowFromRepeatingInstance($showData) { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + + $showData["add_show_duration"] = $this->formatShowDuration( + $showData["add_show_duration"]); + + $con = Propel::getConnection(); + $con->beginTransaction(); + try { + if (!$currentUser->isAdminOrPM()) { + throw new Exception("Permission denied"); + } + + /****** UPDATE SCHEDULE START TIME ******/ + //get the ccShow object to which this instance belongs + //so we can get the original start date and time + $oldCcShow = CcShowQuery::create() + ->findPk($showData["add_show_id"]); + $currentShowDay = $oldCcShow->getFirstCcShowDay(); + + //DateTime in user's local time + $newStartDateTime = new DateTime($showData["add_show_start_date"]." ". + $showData["add_show_start_time"], + new DateTimeZone(Application_Model_Preference::GetTimezone())); + + $diff = $this->calculateShowStartDiff($newStartDateTime, + $currentShowDay->getLocalStartDateAndTime()); + + Application_Service_SchedulerService::updateScheduleStartTime( + array($showData["add_show_instance_id"]), $diff); + /****** UPDATE SCHEDULE START TIME ENDS******/ + + $this->setCcShow($showData); + $this->setCcShowDays($showData); + $this->setCcShowHosts($showData); + $this->delegateInstanceCreation(); + + //get the new instance id + $ccShowInstance = CcShowInstancesQuery::create() + ->filterByDbShowId($this->ccShow->getDbId()) + ->findOne(); + + $newInstanceId = $ccShowInstance->getDbId(); + + //update cc_schedule with the new instance id + $ccSchedules = CcScheduleQuery::create() + ->filterByDbInstanceId($showData["add_show_instance_id"]) + ->find(); + + foreach ($ccSchedules as $ccSchedule) { + $ccSchedule->setDbInstanceId($newInstanceId); + $ccSchedule->save(); + } + + //delete the edited instance from the repeating sequence + CcShowInstancesQuery::create()->findPk($showData["add_show_instance_id"])->delete(); + + $con->commit(); + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + $con->rollback(); + Logging::info("EXCEPTION: Show update failed."); + Logging::info($e->getMessage()); + } } public function addUpdateShow($showData, $isUpdate=false) @@ -58,8 +112,9 @@ class Application_Service_ShowService //update ccShow $this->setCcShow($showData, $isUpdate); + $daysAdded = array(); if ($isUpdate) { - $this->delegateInstanceCleanup($showData, $isRecorded, $repeatType); + $daysAdded = $this->delegateInstanceCleanup($showData, $isRecorded, $repeatType); // updates cc_show_instances start/end times, and updates // schedule start/end times $this->applyShowStartEndDifference($showData); @@ -82,7 +137,7 @@ class Application_Service_ShowService $this->setCcShowHosts($showData); //create new ccShowInstances - $this->delegateInstanceCreation($isRebroadcast, $isUpdate); + $this->delegateInstanceCreation($isRebroadcast, $isUpdate, $daysAdded); if ($isUpdate) { $service_scheduler = new Application_Service_SchedulerService(); @@ -104,7 +159,7 @@ class Application_Service_ShowService * Receives a cc_show id and determines whether to create a * single show instance or repeating show instances */ - public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $end=null) + public function delegateInstanceCreation($isRebroadcast=null, $isUpdate=false, $daysAdded=null, $end=null) { $populateUntil = $this->getPopulateShowUntilDateTIme(); @@ -125,11 +180,11 @@ class Application_Service_ShowService break; case REPEAT_WEEKLY: $this->createRepeatingInstances($day, $populateUntil, REPEAT_WEEKLY, - new DateInterval("P7D"), $isRebroadcast, $isUpdate); + new DateInterval("P7D"), $isRebroadcast, $isUpdate, $daysAdded); break; case REPEAT_BI_WEEKLY: $this->createRepeatingInstances($day, $populateUntil, REPEAT_BI_WEEKLY, - new DateInterval("P14D"), $isRebroadcast, $isUpdate); + new DateInterval("P14D"), $isRebroadcast, $isUpdate, $daysAdded); break; case REPEAT_MONTHLY_MONTHLY: $this->createMonthlyMonthlyRepeatInstances($day, $populateUntil, $isRebroadcast, $isUpdate); @@ -219,6 +274,8 @@ SQL; { $showId = $this->ccShow->getDbId(); + $daysAdded = array(); + //CcShowDay object $currentShowDay = $this->ccShow->getFirstCcShowDay(); @@ -233,6 +290,12 @@ SQL; //repeat option was toggled if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) { $this->deleteAllRepeatInstances($currentShowDay, $showId); + //if repeat option was checked we need to treat the current show day + //as a new show day so the repeat instances get created properly + //in createRepeatingInstances() + if ($showData['add_show_repeats']) { + array_push($daysAdded, $currentShowDay->getDbDay()); + } } if ($showData['add_show_repeats']) { @@ -280,6 +343,10 @@ SQL; if ($repeatingDaysChanged) { $daysRemoved = array_diff($showDays, $showData['add_show_day_check']); + $newDays = array_diff($showData["add_show_day_check"], $showDays); + foreach ($newDays as $newDay) { + array_push($daysAdded, $newDay); + } if (count($daysRemoved) > 0) { //delete repeating show instances for the repeating @@ -324,6 +391,8 @@ SQL; } } }//if repeats + + return $daysAdded; } public function getRepeatingEndDate() @@ -608,7 +677,7 @@ SQL; * @param unknown_type $isRebroadcast */ private function createRepeatingInstances($showDay, $populateUntil, - $repeatType, $repeatInterval, $isRebroadcast, $isUpdate) + $repeatType, $repeatInterval, $isRebroadcast, $isUpdate, $daysAdded=null) { $show_id = $showDay->getDbShowId(); $first_show = $showDay->getDbFirstShow(); //non-UTC @@ -648,11 +717,21 @@ SQL; * This will be the case when we are adding a new show day to * a repeating show */ - if ($isUpdate && $this->hasInstance($utcStartDateTime)) { - $ccShowInstance = $this->getInstance($utcStartDateTime); - $newInstance = false; - $updateScheduleStatus = true; - } else { + if ($isUpdate) { + if ($this->hasInstance($utcStartDateTime)) { + $ccShowInstance = $this->getInstance($utcStartDateTime); + $newInstance = false; + $updateScheduleStatus = true; + } elseif (in_array($day, $daysAdded)) { + $newInstance = true; + $ccShowInstance = new CcShowInstances(); + $updateScheduleStatus = false; + } else { + //if we get here, an instance was edited on it's own and + //thus became it's own show so there is nothing to update + break 1; + } + } else { $newInstance = true; $ccShowInstance = new CcShowInstances(); $updateScheduleStatus = false; @@ -822,7 +901,6 @@ SQL; private function getNextRepeatingPopulateStartDateTime($showDay) { $nextPopDate = $showDay->getDbNextPopDate(); - Logging::info($nextPopDate); $startTime = $showDay->getDbStartTime(); if (isset($nextPopDate)) { @@ -906,7 +984,7 @@ SQL; * @param $ccShow * @param $showData */ - private function setCcShow($showData, $isUpdate) + private function setCcShow($showData, $isUpdate=false) { if (!$isUpdate) { $ccShow = new CcShow(); @@ -939,7 +1017,7 @@ SQL; * @param $isRecorded * @param $showDay ccShowDay object we are setting values on */ - private function setCcShowDays($showData, $repeatType, $isRecorded) + private function setCcShowDays($showData, $repeatType=-1, $isRecorded=0) { $showId = $this->ccShow->getDbId(); From 7f729cb0381ed186915157eebb8fba83a55e11e5 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 2 Apr 2013 10:31:58 +0100 Subject: [PATCH 043/128] Explicit dependency on libc-bin and locales packages so we can check or set UTF-8 locale --- debian/control | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/control b/debian/control index 19e4adf93..1bdec9e86 100644 --- a/debian/control +++ b/debian/control @@ -17,6 +17,7 @@ Depends: apache2, gzip (>= 1.3.12), libao-ocaml, libapache2-mod-php5, + libc-bin, libcamomile-ocaml-data, libesd0, libmad-ocaml, @@ -27,6 +28,7 @@ Depends: apache2, libsoundtouch-ocaml, libtaglib-ocaml, liquidsoap (>= 1.0.0~), + locales, lsof, monit, multitail, From ebbb9f1b9c75a48eca7811aab9647a03ff010c3c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 2 Apr 2013 17:06:16 +0100 Subject: [PATCH 044/128] Added Austrian German localization, thanks Hoerich! --- airtime_mvc/build/sql/defaultdata.sql | 1 + .../locale/de_AT/LC_MESSAGES/django.mo | Bin 0 -> 58362 bytes .../locale/de_AT/LC_MESSAGES/django.po | 3261 +++++++++++++++++ .../upgrades/airtime-2.3.0/data/upgrade.sql | 1 + 4 files changed, 3263 insertions(+) create mode 100644 airtime_mvc/locale/de_AT/LC_MESSAGES/django.mo create mode 100644 airtime_mvc/locale/de_AT/LC_MESSAGES/django.po diff --git a/airtime_mvc/build/sql/defaultdata.sql b/airtime_mvc/build/sql/defaultdata.sql index 94e1de23e..5614ea932 100644 --- a/airtime_mvc/build/sql/defaultdata.sql +++ b/airtime_mvc/build/sql/defaultdata.sql @@ -328,6 +328,7 @@ INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_C INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('cs_CZ', 'Český'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_AT', 'Österreichisches Deutsch'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('es_ES', 'Español'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('fr_FR', 'Français'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('it_IT', 'Italiano'); diff --git a/airtime_mvc/locale/de_AT/LC_MESSAGES/django.mo b/airtime_mvc/locale/de_AT/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..0b46487fd149731f386925c071c67e8c4d9b9ba1 GIT binary patch literal 58362 zcmeIbd6->QmG^&`A)zrHsU(O4prVN4 zjEdrbO^bj7iYSOe1f0Mb?G|l^#tB>6u~BJ#Ki{?XKKI;8!ti$g@jk!jcb}a4o;{pB zuD$kJYY+L+0Xx4f;rI0&ljKP7tp_K`13M+jUfuFdlF4T#$ON0A$0dEA)$N!7qV({p*l4J%r1onXM0;hss4)|wK z`5ikuNlpiAU>EpdQ2BoooB%%eY|nQJcq;CNpz?nixGQ)SxI6e}kZLCH4tPCC6C@u5 zmCiqb3ja8G0{AIV;XeW8|L@>!;4i_W!RzMm4R{y03)nx`%j}b8mRog0V=&m!TrG}L4CK+LQn4iu#Edq z@MQ2ZP;_tycp~^1xDR;rBJYnLa8KN4fJ$c(xGT5}R6W;#ir)t+y^FzP!5cxv|0=jM z_;pa_`wpn~_!THReKO!Ai0hTOSAx5P-vE{VzkuqGUxD+$KY&X2)FmG846qCLd{FsT zK-K>mkS0uS1P=p$1ByO&UF!5Z6BOMRLDlC?;DO+^pvrl3aNh$y7x#BTjgvouN^k#V zKE6%>A*JLTQ1tZ{a3Xjccmeoba1Zb#i2nuPS>Rgm9pF7XP%dyU+_$dua^DF)2lux? z_46;mUBEws-vXZmRj;qFa{q%?dpjHsDxYHmc7qdep9(6yxuELx0#M}}0rvyn81Q|d zzW+F=@9qST2k!?}@Baum;hZEn3U?Q{JGcP66I=-@-h?$tGF{=|^S~E?u#V(%@D%VK za5DG=xEnaJ*VCB-svl+s_vxU*=YlHNQc&ry4gME{>gP?M+UXil^zz<-w}Lz3z8e(% z-2*C}`@ucIZ-D!NkAVAukAZ5ZCqdEI0d$h;cQCj=cr>W^GeG5YHmL7bg9m~IP~~rd z2Z1jI)qZaR4+ZZ4RgQ0h%Ku?d{r=N{kAnx`eiBr^`>yl&hl1*lqk?-fsPOK9r+}*0 zY*6jB1XOv>0Y$eZFa@swRlW~_D#y*B+U?_@zW+R^_Wg43|2bI1{YOywpLec*Uj)?- z!=Tz_GpPE#9-IVz2vj+~3aXsn2KD_TpxX5ppy=;0P~&y)_1+FMK()(R;6dP0Q1y5T zsPr13(z^syd9MJK?i)b0^E*MM{{>L-z6h$G4}xlkZ-E-0zYFgD8I0oF(?N}|WuW@? z98mQufJ%Qf;3WZH4bH&-P2fr37EpBd1gQM~2CAL^0jm7Fp6BH`96SN{v7qu>1uEV; zP;~SnQ2CF5s?Vk1!Qc(S|4vZfeHDBT_)Spt`vthW_z3tI?msbEF9m<{LNDjk7kRu3 z0``NVyCLupumzsT_g91BNB6wg`P1buq0b5bKB#ifywKa_0#NynfGXeRpxX6aU>Eq= zfIkHf!#$zk{dpXCD(=%k<$p1#etj9Jc6)Vjzb?4n461%_2PcB>4*s7D{`Y`tkNZKj z3DERY${{Tf#hxU7YxuT5vA~mCm`K>Qw;MeuJRWeI=-J zT?wikuL0FQUjmihgP_LEzkq7r--0`Ve*=}?KS0sfE=6yb=YU7zJ{A-|KO0nj7l7hJ z8$q?-RiM6mC#dv39Qiy< zr=aNnac~!Kw*hb8y}^mNp93nNQ$da6xuC}BxxqaMD*a19<#!dRad9npB6usP{{1Pa za{UohIi3Jj-yH_Mo%RNI#l0V>c!z+yfk%L9$74a|b3Ca2IR#X`SA&zlb)eF{1XTI1 z09Bv2ff}Fh29@6@K*hT|gg*d^E*}Jy{v#p$H=xS@Cs5;h%8=9f5>V;(f-3KM0WSpA zK7*j><`Pilcmt^PuLm_wZUvRk9pG&6OCU{=>|XYMt%2gl*MdstHgGraeo*y&2-LXx zHmG*~4XAqUc#+fnKA_?s3+@4)04lwcLG}A;Q2Ac~9uHPQ(f!*%)$2A;^za!_?fgyf zIPfu0{kz|==W|rRnV|An1gf3S0VjY%pz7ZM)h<_n%J*7O`TR4e_PZ5SJwF91-j_g? z^AS+>{57cd->Ks6V?mYU%z#V4-Ep4_?g_pGRQZR&B6vA?1o%r({jl?hm+L_A7~IDN zTm*{FE&`R#2q?PU1nvc11&S`O1(n}*p!(xO;NIX(pwho1xE}yjzwZYBM?j_X7^wDn z0#tkKRQ2x<1m&IxD*qYaKH&2~wc~Pd4ftYE{r)jf<+&eJ`+o&ge%}FA{~v&&gFk?K zgMR}Re~+4fzc;A%Jr-0w&J6x@K=s3VP~{y4Ro;!D%5^y?dU_+McD)Hye)oea=Z`?; z_c*9{{|%l39y;p%z6zX-dmXq8d>N>6eg)hQ{1&Kk{R~uno&=TeP8WN*_61e0V?m`e z9o!#04;0@Y2Gu^V02S};pwj&ysCs=e;FrLuxE}#kzdh>S-UorI*RkLNf?!C#|XAY=%=Ycc8 zSAk2wPlJ8n4x63t6~SY1Uj-`vj|TU5K(*5o;O^j)pvtw&CGI{FRJ%?B)lMgXbagTl zR6BhLRDXRUgnt24yFCCZ-LHV^pNBw|@8RIT`%AqXdx4Yip8<*<)`Ozo7lHeLBjAzX zOF_}oJ3;055%3`JGvEQ>L!jv7C!px#cOm@0LDlPkOTFKZ09B8Zz$3sjz{A1ypuVev z;x8`)HBPPs4+Y->D&EbY(t7|DpZ*4@`2Pv2o&E}HJj#fqc0L$91Uv&&e!ZZ|TLV?k z%Rsf)TR`Rac2MPbKd5%Q1yp{Y0-p=s4XPb}25UGC*XfEDEfX+z;A-$OS@d|;U|M?*8(WIc{QkV z-wdkVe+C`{{smOO9C?NJ-|?W@aW=RUxES0STn?)K=YWde2ObMnz@xxxK#hl6LG|N( zp!(^DpxWn`;Ev#LLDALkg8K9aQ>ffxCfA zz+J#|f_puvcrOW91Vx`^a2N2h;D04}9PX>ZDc~nS)&CJtbnz%CI{OQ#^mci*e?I|K z`St_le@Jj2394Mjg0I~H8!)&F?mHlg)4{vJGr%XnLGYw29j^mL_dCDV`BDn1e=Y(= zS671*!Rx`}!F#~-!C!(4zB;4Nt#ZUhVP64~FqHVx)z?t9&!BfG9!Sld< zUhm^!2vmQLfoFqn1NQ5b(c1_3z)n3E$~dXuNK2S}486G6ql8Qd4#0)83%HmLaTd9%022SN4! zO`yirM?s^1a18ek!K1--Z}IZA!2NJv1F9X~4=TM6fi>_W;7Q;SZ}om!4Qkw84vJrW z7TgQ`GN|t!29?eup!(;>pvwJ=fPV+i#{HbP`Mh#2sQ6ccD);Nb6nqo7KllmoB=C#i z$>3kWTfu2>_i^?kQ04eJC_4BPI0yVYX#M&Q_n!}*h5rh03HW+&G59ce8F=)yE(d%7 zRR8}JRQ!G4>HKRYxCiddp!)R+P~+qJ;Jy=Fh5KP}8hHG>{QGmkQ*plyTn#=L+|PZt z*XvyHM*Ob=RsIvNLl*(h4EQndr#nD9@9}ot?Rux9gTTXycRF|gxE54<4}w1is{vQN z&*^{q`@Q^UfEo`AK;^eO_@4(JhPxkBx|f2Y^J_uT+owUb^8=vT;bBne{1}`KJ_gPN zPxyf21>lLe-vo*-?gNkB0lgkn`j36k*Q0j5!RL{a!87o`091d!3lv}ZI;i~q3@X3m zLtf84!QF5k5b$tN^*IIV#?fFkmUz0%PI|Wof%mnrQf`IElrBebA1UG<+|GMCQ3-~tfeL%I}QQ)57X`tfI2NiD#xGT6mxGw;A!CeXdbx`fO2|NV69GnQg z8x);>4%GL50(S$S1Xb^y|JmzxFnBEP<3W{YDaa5?&I{qc1NGewANKfrfNGb+K-F(5 zsQNAj_W&E9`t{O)SAwd~Tfj-+wcu&s-Jsgzzd+@?^G%-KfuP!B8mN4ig1duj0=^L3 z19uVBxUPcY3-1OM|9VjEb0esBxFz7%1O5)wI5_Yl9)Biy5bjx^`gv8rmxS;dsQkx3 zmHQRo67Vyi=xnE(9d`wl{~n;|Vt-KOoCMAQr-3S00aSksg6gj-sD6GmsPeuQR6e(Z z&jB9?)qcC&;_eBc(n-OicA(z^&cBtp4gbE6x?J}KQ2FfqG5>x~a4+2Zfy(zN@Nm9A z8T>W4`r~f5IO8^CKf>P!P6ZG6q}OLQsBzW{P6kK8>EJs-@r$nnobV}+w-i)9gWyW= z<)HF^2vj@$093#I3{*LP5!}B8Ro~x(qJ#em{s-Ld{s)7q{}G_Rn+Phs$)NgaIw<-+ zJ-C;F`{7;-sy|AgzORADgDp_>e;ugwz5t3I9{^7Q9|lhb_x`k}GY{Mw_gYZnpbyk{ zE$~qArJ(YETfiGZ)#o$dp5Wb}=;JHF{UcCx_iIq)`zx4&JKy2;nFPwe2Rsox4ODs+ zQ0ZL^s$VVzRi1Z+@LNFD^An)bzXMdczXWRBJ`8Fc{2mnl+y68E{RyDrodv3#%R%+i zg~43})y^A1mE)D5>i=p`3E^0`9MZ%J*SV_4@&+^8ExG_eQ2xh*tHC+J|IMJv^?p$G{t&40-U_On zJ_)MbJ`F0~-Jr^IZwUVisD678RQf**;ZJ}oa3`PhbXS6kw?4QB!6R{xf@-g;LACR> zA^ZkV^}7XBd*2)UzYm^@`zK%*c-YjY5l8KA!F1*d=`p!n50g8vPm=-}?) z|23MW;u6(es-L9*28*z>C2halai@KfM!F z`Zs_|_x2EeFQ|6C4^;Ud1l8Z)14Tc-21S3#eI9Q=Q0;aosCJnIs{AK{N`G!}uLYG( zKdAa|0F};bK(*^Tz!!iY4es6V_i>VfD#vl)u3!(S_BuJZ*MQ3ZJW%Bx0M*`A@Hp_w z;C~CK{`?fEes~B}Ie!J}`zJuP!!8f__xpp&=LAsYTMVk)7Y4jI_+JKUe7*}5UH%dj z-~Ju=Dsa-5yj&jv_5E$&@!%K1UBSmd<@>NNza{Fi|$ z_j^FK^G%@m_g$ds`3>+?@K>Pvd*WBTzEiXgeK$YiFup9ghsB#_t zprHp+@EY(R;6vaw{8~{{R<*e+G8~XVa+N;5<<6aWN=*dnb4x_+D^7@DrfQvnBZd2s{Ay z??H`&UB2gh=qONhc4Ba^0yRELpvw7j@M!QVQ04pxsP?`CRQo*wD!)Cy@9~cW6>l=A zc0M`a3xfY8pxWs*I;_+vK2jji~RJ~fD+UpunboUle z<$W)x^lk$80B-|N0Y3+-{(l6Y1Mc>({{2y);-{d(r+|lmXM#;|EvR0N^#?60%hk}Ry)a8T|LG{x* zP<-b?a7S$ zpuT$yRC<33?wx<;bhHnscvC>7GYy;yo&=r<7C`0qHc<6>4=6gj9n^RC2K*AJdOQ@| zkANBnKLu6q$H5&yjnVh<@@sH8kA7$E=otS#pYU(;d@%U00$)YoPT&Xee?7P#kNV{# zu!7%Q9!S7`ufR{gd-03EVf?PcadGevZ66il?E}6!yvO*$8NsnP>3p2$zj1$xc=v*T z!hJgLZ{$(`yc<-zl)>3N`rX7cC07Rdy^t`Czdz&uW^h=Z{0_%|9jLK)UHE1yxD^7cyc~z$&v-t-BYyd=5cpQy`n?)_9nV?3&j)wo z+063>3#I?TD|t@9uZ!n0o>86yR4(vT9{oOpTSXI%tmkD8&+~Xci}1Pv!tdJf{@(E2 zF1Wu#*gT$h?yCk^3OxRy} z|F7V_G^AO=e-h76g8vZjNAkRy=TpSFh-U`x3qttkaL>Z6-+Oq@4DYZP`_&0&YDs>< za{%un;QM&K%JW5@6u(X2LcV(i?>F#%98YgZ=e^({{+|wRf|4h2KL_`( z!Z(A52S4%KCVu*z7}EI@?_cG;#WNxJDf~?0U6ympFaBN}{J)FGM~Mf^HCwyF4Q;Cc)#H}o9BMwEa17D=dC>Z;ddL)&qMsb@ct0~U*|c9=VsjR0rgwU`;NT- zj`#QQzJMqGKE(SXo|S~}1zs8gZVTVOC7`?~^8VrwULfvKJo?QBy9hg%_wVw4AkR;E zpU?Ak-hT`J6g-UQg50kmm@VvkANc)ZG0bk7Psrj>qr4;Pr|} zzWP1Mdl6g*eg(gyd0t{6{^zt1?{1tgAd=b z$@BIQVGREY&x?32M}lwX z>E+p%XGfmT;lIX0NgKQoKmAVT`KZ026O2pmEyOtmKh1v=d3NII#!u@7`n`j&U+}&Q zPm}kTf+z7jLD=aQgE5L*zhemRtw}D>;UrO3n@*IJCPf)*i;QuWi#JprNIKp$Ag`mrU zr|^7>=R5d!^UXuxUwJMF-@h}UKB@4W!IR=wBhG0&`rU=Q1#SZW5d0dve-giAf_px0 z$%P-|8NzQKZvA?|V|iZ7`v-Wg3;y5a{hxSW8{BIGz7YS-;hk60VIBgnCe2^UBlo)? zykAV%tvu8DZVC9M;C~?QYj|$QPrrkCzkv6D<9P}1uMGZo@}B?o;dq>|Yk58p!aj&! zjpv;q;)lSOhxZ6ei2DV;S(i)iT->XOa1%HoM0`HslX3r+=Oa9GaUV=ri}(2Z0WX*H zOv3LK;P-j=yi< z%X|FoO59~RxBMkj599ZvasCQBf%sGP!td{dKMo!az7l`^4&i+--ly??GI$kurULkV zg=f!@=GEpyp9S~E;Qm+KXNR=j6v7nrq2Tu-{B93%_Xj_W|2^PX@Y{#*$9TUSEP=lR z_4_l=kvv}t?xg|G0Pj!)eyf7t$4K*&JfFe+a_|!H6NK*$UI;GYnZf(3!P^Nx0bC6J zGtVacr}69{H~wGbJ^#BexUVAo{k*@C=QX_lcksW3$Y+j#@{u(Jb-&GcpuNf#61f9D1IY6FUP$x#D8wUml8g}^B10f@Z5|4 zQZWB3;`e1d_608s0gsW^S9sorpMF2!{aBv(ds*<`6~BHwuL5_+?`OQf3A`KkyLjHl za~SUb!2f8TAL9NZ?tkKaCaB*(@cVc08=!uV@?6jJ1)l%J?*$>=mAuczPrv;`+_w|< zx9~3i=i&Y`?nU62c;1NLKZWpA5%>+_|NY?iT->ka{l9qbz<-LxfG&8~?*;gm!9#<4 zBJR)e{wW257vk3MVesqVE#Uj`{}}incyb8;Fk#0kBERGCe+0Y;d=24KLH&;B`Mlz% z&03mFYNY+OYO_$THqvUT(JU3yu|l(d2rQQCrT%8EzG+rEsiBC)TB%X(YNn-)TP3)n?it!NOokiKn&t_(TS3m13#h zNR`SZJ#6Uetb<2HHW6{cW>7v!k(+xc*l2F$qYTqhN>N2{p3J#Q;7PUwPRkD#n zGwqt>FO#~S>I>C1`(p9pStBF)=#;5aYKV{u)pXKGxjHHBA1c%f{Y@j5T6Hj&Hjzha zv`mOx*!VP&tF_RLrIA9pk`{`^y7CI--B)Oo`(w!}wf;h-d$dq*o;_4+G^+)=s@)8s zm-|Z1u@W8CWd-fBF5#VWbWJ7I{z|J+-cYJ+O1hSps)Nm;uCy^!YgLMAUrCvEO`kr? z{&j_1lgUe}3>E8!S~^;eNR-@6=#NjX_?M_$Jsyb;uTqA7#)$1sYDG=NjXj z9vbUOX|IlIt4$TYp)KX1x-5HGdc(4HS1ny#DQvR&Mc+_@ zUZbA5qMjHfPFADiqDKE5!NpIqepLItbBQ$^+tojvvxKJ&&ySPD>O!M222Y~rH6o+;xv*oZleua6R<+R*8Hr+?0wC}f zOk@BT;R6hVK%W}lLxoXIa$`gM5xpo_j6p*(PHe?G{F6{77t5f~-w(qsYcRsI@?Swx zg|-+IKamL26(j($=S`X}7@L*87F55HhFCE%2pV+RNcVpWs7R0L&z?`?< z*=HkNTTACyvC?BAK_8PYsSea;Llcu17(1pslphKlDGXE7I-{psY<#R-gd;Ul8hE&8 zN|wQBi3+b}(i>K35L0Zr8bZG6({$5-oh5TdM;Rv0uS@khN3!OO+Eb=Flv-@m`a>^c z1sEXNGnH16$ZU89>CEM@*%OR!7>|@t5%{V4gpOk(^3fZ6zv5gDF1Ed#iZDM~$#RN( zP^^A(W6JDj|J74`k}GYLW*}gXZ4jDn^w;Te^Bk-zMHmBV))i0U-^DEi`JS|E zq*g3-rHCuYDa?QxE#<0-tep{&fVPS|$_R&ZBy&s35spxBmS+6gDS+~*CquWVh&5vA z_!u{~2>=PCRBfe*lFeGxCs2*@A}WCMp?Yo9i71yO#T+YFi;Svftwssp_G=_D$Cq^S zvcA#Al*~=FH$lWDpB`*b_0={`O_!vFK^jW!mS>b*5~)YwA%*@;>1d7dvT0JICz-c; zT{16BIlNSDT4o-vGF>YPA0Fs6FzP`@8;rHCcrcUB>eNdbsTRpP(c{?YDbN|vo=p)Q z-Y8n$?+VJvx-(Kl!+M;H%P@s{sjm*D^plPXZTVZ;_9aXn5s|PEA_c6!WpX6}NNSZr zebD52DyRUsa!e)0HAZcbX+7FqES1>CiJ6g+ShxQL6Jw zx8*lGdS;Vth$syT!ly(oMFe>v)>gqo68VZP4U z@CzM`s^M&~HZTCE!(33GrjA4(l}_ohb9hI_2*ZcYP!`WD;p)?+yPZU9CP}HluI#{h znsDA`L26XGYSAKkPNSFU*I(KZGz-JFnwneFrly6dDILc&0ZPtP4W;a9B$&`a-6R{r zs3l_X&n6D@s!!=j&s{#xJ{)l$r%O5;Eu@C*)7QebAPGmo)>l;(aN4=6*34bf8_MZ< zX?o8pQbvA|PA%dN8r>|Fe3NS>?FRSBxy`ZYdyV4~WCa1EF88EM222;T)X z5Q)&p$-LT#GPO!eC;>$94HS;Y)5UVpp5ujSE~+`>myhR$27&5{I9Px zK{60x1#FNRwrGKq-i1);G~WBf%9S+wa$ zj4O+Vm_z@rIB}hgDpT;r2d-Y;yZyiy^sZjm5n63x`Ap{djN_cTLv!tl(n42MU0v3Z z#wxC1^q*<1>fEjqOs*q7JS?a5$UuYXkr7&;3rpQTuV9+#VBkIJDw#D3(iGw1opvP)N@zemtA(>YDI>(Loc8JMoDrSoA{8~pS2C?bug`=HuS zCZ&3RxxiHa6d99tE~;EHE7YfFnGww?1~#Ws=CYrs%yg@WqIi|EhSWR{L1+mrVjv3T zWfcaFfWgN&eKAT+Oc15C+NxA&W|wFprb`%QhzQQ6l)78KMeA~50Ut?MX9LLH>ll`1 zPMp6qnZFcPIA3zkf@(3m^-7ZP_i1ZoE6sx3nT2o4Y<`W=Qa{!^#EpJ@L5!<)=O=tTPJhwa(}7X$VD(cDP6m1)cmB`k(4QTrZz6AA}S&B zZPU}}R|+<*1e1ne#AulzB~uLNqk0mG)>F1QKL4)b`4=*8wH-FcjAHjr=9e30`_#*@ z{YiUA3n~^vjX$oTCG&&Sn7xp)n-?Q?7>Ytz-Y=aO?2OP$40e+o@`V`LXuTv`n@W=` z=$7`LEP(slpL9i#R@`NLae*oL)ACFhUfh&w(MUWHI}?V8=<3gyAsj{afS%N)E}O|M zHOP#qkU&qyx`AF5uSdQcDiOERG6Eu_f%s9;+CU3}GEokLPaURsNW=G*F_Q+vS|Lh@Qo8 zSsnhUj-YiI%;LzVJS>o*glV~m_?)<7q%o-XjiX|-u`}I77(5wpveUZX!UAIn4q_Y1kVomAzs(v5B(ZCzUS5jY74&86`biV(Lj2miqM6TUd;fg?wUv#+iy$fnaxe znqU%?4Q;EnyYO`gE<4X6Rhv|xsh%DWYUq1Ok0{yB!h(A-k|B$O1k*+eQOr8(?Mf|+ z*sD0&tYjgrYb!EEXxy4$s8ku9%Jhb{LcK7l(Sj~DjkO9D>Eh$QK$sk@lnPAmxlf|i zX+`)dSy<;^Sx>P*sbrqIL`JGhC7N8)tX-PG;LOIKy=0_oYoJ;WFmYd6WLz{*+Kp%s)kb$-R5weR>gj_|4ZDb0Ia=^Uk+xolccs>cQ8*jqi)6@278mM8 zTkCW46!bL;i7loL?N6kGls>G>Mu)KmF6_lJwal0L(%~x7uv8ft|Js6o88%@IJ74Cl zh1Gg#u!Z#i2?Qd^mZM5lG)ELa<1p5XrH!zQatTk&&TZj!dn;5@GS%o~r7mUzvxFKq zQhNv|^DcSWj0NdF(yyX(9Xq$^^NedMcw z|KqyWOBk_YPfF;+UhIYm_=~G^ad=4kaRokfQrmn4OIloJ@J&r8Oo$!DRK+^7*&1nh zQnika;=aCsqLL-OYv$RXbY)9I#jIpWe@P~(^xRs#k2JE`3^g;B1n<5Q>+7sQq*yJ* zQeX_I6ikVg%2cDuk-{d%S74HH4#G&MMa^2BL14=&q8FRsk#0~DwnewBv(^y1`l0P5 zV)bNB`P=|*v>kJCrUNmxMr|g^rQ4`!PHc#?8Jh|z((sMuG?i)E2*y{fYG4$wcACGG zeu*hVsKIuq@dfcp(4lH|v$k7n_(JiF=`&BVF>uo9Gftk-lLXZ~XO`E%GW!D!7W={% zMzO==2L-rpjp%Rsmz7uZGVM$dCR{dZXu%fJ#)4SGROAamR_wNpZ*hiLd`cTIY7J~9 ze{%PX=`b%UR75$Jt%wBO)Qk4*;u{@FU&wMxE-P29rMYdyhU{jgyeOHqO4o&!@c3?l%7p2Zm2y~P%qp@`3^JW$=+;)M;Hi|g z6a~juy|nB|xzVp|Zpbws!$C5*@5IPb$XXT4D+?~IQ5rV(U_Fha!WlmsOAyIrfn$uu z4jo9l++NnDl%WczX$@-nN-LkNSQo0p?L;fm=)9ZN3uu^{xU!YxLSxuzBFm&BVaPe` zHHi6=@<@S-M;QvSSoXn-MrodlMoau1RZBq!gXIC@b|^R7Z1BW=V}b?rBvU=cdt;2C zm#NJ*!}c;5VJOf`Ow%z0>K+LLiDn4V zwFkn9l|>?TiPj{sE=Z1`PcSIDK;@bP-!FQfsSPRyL1`*6td{K_N9!#d=IAe69h+(Gh zbkTw~Q3VU#QwGi&7rMe4e>Iyqn&U!NGe2ftHkzUA9y7+^sVzxG|Eg$4eoT|HE?E}(D9Zsyd&lH_q(0kPDql)Fr@D#B zkDkb{Po6S;`bM5?iX~}uWu{lYvB+^}MG>D3dfdXb5*0@rko1yO%aTY7lB&+(H zdTO$Ptr|{NG0UN}A}kbGr77V?2K0FdhR?_h;#yC#iVZ3DCtK;3OpTS5_6z$Akc?!~ zPFAt;rp&gU>?Msxv{ej!@-@{hFr2oU7rbRjOT@^~V0jrsSxr`J#EZFjgLXP65*+OC z@kNTPtn?TspodH-z|G!;4q3h@`?xJ~C?jS#usMZ3akSNUzqHt{%A&8tz(jR9$-CMviHYRf(p zKmWZ|osB}q8cJq-Qy)T7NVMn0eSHvRNi#wrQ-Xq}1`#Ho--dD_^+dLnjf6X&7^J9V z12vQWr=iTMUuX)*I*kXj5WCAa^|seu~93GYPuuH_E-7jhs)L+eBOaT!+z8e zTNyX1qiR0SxZOdEYRPKm9juE%2i4{^$(TVkOx7&uU9dJ;Q|fN{HW(V9Z8F3^(^>Tq z?O+y_NsaL#Qq^+7DNMOD(rmuaMvL_LG?!@fv{aW%Ra#PwF~vjt8*!(FGAe}_ZSPsU z4oWJiw<}aakSelrE7F_+6D$oADf(5l5Nqy@`U~F*z)A)iBmy(>5b>dCol>D}uLrVY zg9VJ>;`=%(-LTYV+a4AJGE;hc*-S=twVNdqw?<{gM*_4VAgsm)ha33a(NGaa8Tsj= z0-{aWOU%Mji}6?07AR2w{tbw7>;3cTWRs^MW5&optCFI6F}sSa*)+}K4|YP$;~FBrfRmlLY1&x@k zE2g%Z62gt0`o`X@=}cF}U=I7F`)p4XEjl7@X3=eQ22SmpSQWX4EQvmT>pH%pdLUO# z*uB1%>@Z%(P!jbGtWHG?Yf|X{_+Y^qL2nQHz9s)qEmwjy-D&W!)yB;{3K+9L><^sN zxlvF-Y;_*ez8#kETO;h+HNQAs&0$L*?jK}r^Y-`glJ@q4tcb{hzN;oL+~&WrxxqXb zK{jc7&aj;^*`(M2Hv&ah&1mL9W9%pK1$CV_a2pM?UT*VQCNqRB=}O;=2%{Mb=~Vn;+5Uhmhrc0HLuEMgw>aZ1ZwQYq=dVSfrKdJyx<_OkH25^zt zLq|iTa!d^I*?{Q_*%+I1GXZp1M)0)WHvVoWGo*RYLcT4ZrWs}KswTFCqQ6Wd0Xmc+ z56OGQsgic^50E@^>%>s462lXXz1DV_1{Q8&*$FY(Ds=a;9F@t zK(RMzn6&suJEGia{s=pX7KXz>nMWh64Y|QvdHa^WaaLFD4M=)zeKuKJsPSW*8;N*{K0xZs20?Uox0fUGvP0C^8pD=rE0A;I20@? zL7LG7lG9(}pzJ}hm8$EM6n6iSEOQO?))>-fro-iuk@c>q_2UtA)bgl4rcccj2G!;# ziXN+u8T!OBReG0AOGUE)YrS0ih|?8w#sAoPH=NqIbCa!_N-0_bDp7$CJONRP*4f!n zgf<%l+7)x3CPOiJU#6DU&=0Ap36%xgZm@a7Y}pE0(Shepkn(Z-*Q$h>62 z-?*>hYR8y%HKeTRjg&cL!QxveX~wIy{Nf{=<|Pw}hZ05Et!}0|7)4OfmI_p)D&J z9p!ncvoezLK^4wn#FT7&(%~9nn$cLlYcZ7Bu2X2jF4&qIxd0Rh{n*Sb(*;FlpbzS( z7-`%0qERVyp}HXp5*pGl4fCGtXRyikX{-=U)1eI-HJg}!OS@o5N>-x~CrA^f3F?%K zNsmD%(DZ1H6C+t0G-}N2(hvI@HSIZ5oR*$?L$lvnXf*5a_D(o?ZXBOqG}qdxO?VddR2;3 z;?SV>G_{waC6db!vkn6Rd+Uq&uY*r7G|~>wiRW$4w)xwIrZgU8=08f)3}G4^?{O9eA+4EJmr$+oL8NF&2OZ z`=@bM5SSQAoX_+_wG;Dx8elL&*#P6V6=^#Y%|t8?$N@Y}H0`r)t=KzVwlUi`_$Zmt zV46=u00l!Q=MSpR`k@;CeIVv8k{XpkRl{(-6vb@OUbASH1aUTCcPRESbZj3SThlq* z#st@soX6~De`fJ_+;*enydZkES#*2;(OiS^n`<57S?mIYrCsQLzR+blDy>sns*!)H z0?Qt(FXzB*#45KsQc5WiL%kUWOS7|b*aQ(YN%2iTB5S%JZD4aMH424(CXv(a#f~$L zu?33SnXFkp#Rm|v0?WtvpsPpP@#?K=RZ&!n3Jiv&j=HgS1Xi!~jZG}WZ7R#?Kmd%O{k z22X0BgFee|%)tG0-()A#f*kiW@xz(7JbhZ}MZt_+<0hR4NZtKsT2~YaU-CB!a zD+**pC-9||(EPbn31%>sMk4OX!%MuRA_OJm_(;Q0dFAX<>vYk}1eIzFTwxz4KlsQ^p z93<*J{usa3t~5##8Y;WuC7s+eeM;B1Bjs9?_%Wsy?oc@sjnTHkZl>ALJtt0Jxrd?Ly`nK#E_Tmt z4K}*h*4T{YvLS+EYoy1=MSHPt+Jx1s)^_`GoLaSeKD={QI&=DrncXvHbk96JoiSt9 zNhftr=gJo%cCVpEvMaRXo!C8{;F;-+Q)Zof+6mKV5Kp_Bx)F@44LC7Jc3ASLve=t0 zh1eVEnMHH;TqM`o^`j>Pqkoqw%g7!FuZ4_r}dSa z6OvRLXA|^P2G!7(8`wkvAJ-ls7C=xx8tIn1cpJlhhOkRtZ7yM2tzwih>Ds^4#at}u zut}XTBRO3gv|M(W{O9$~?|YOhak88W6_mi?W~;fMk6DvpC|)p z_5Zni#>$w(wr;wtt|bbMM$%a=JgM;3UttjFXmRvq=J(KQ!%Av!%Uzfh2l+Y|(K7R{ z7-YSZ?yT}rb}3jh9rr0ig)2z5AETb04<(GYs>62GS{SDk!|w&i>%uq_i5Xx}8FXB-l@a#{3Wk5PjSItQTk5=- zVu_gj&M+F!GNc_kFAQrk(+tI!x-jf1VyeqZS$C%kXuEQydyZ`-K@}g7vY~5>ilIVJ zePg7Rh{a|c8y;*um!|Y6~$(ly}HI+8Z-fydo9Ry zBTgw|P$z9bcJ+?@2!-iVIjXzmdUd-pUIyo^W2V|X#?1gKfRU9`3Brs^L&vw+rq)N$c5R4Fj7$(-jbvXS1M_s8L!s8 zU)GCGAROxxJ*%*TrLiqH3~|=WhGdCt<>4yCY(kl+$Rcpg(mzGJbhL@F8#RFHPCivX zGl%5O0BNelxUd6)uqx!+tX*!60};dxnh$9Xqip(Z13I$4cs9+LY`G5h&cPSjSFOts z37wSl!UnRS+GLVuTqG-KF-mPc624eyAF_bsyK(6=WE^WR??khBDu_7<=4XK~#WX!V#QC_cA;A4=WL+GTfIHSWr`a)gIPWA>FP}gIp11 z#fdfOVi!b?szM#|)umWW4t|JpoPVxulk-`}3Q~d1CcghKmuo%-jIg~5-_d#`labmu ziqE$%^GO=VtL2ecv$LJbeLYPMY>tWRaL-Cu-lxm_Hnm(xZ>xXEmk1U5>~2$ob(XBB zAU6&$F`gOd%yp$v_9ieo19f)Jg^N~ZS7oA3jK61Md-thv(UCSaWhF$EkZ7E_!x-@) z$dNW^N#;gL*yS+X;bs!doEHVgFe-z-HUvi20}1*!qAZadw>pT;YNbNVt*=1jbY-cz zxk3!a+c0Z+s%w^sBMwenHZOubzZW@1zgCOOuu46flNzP zyKQY-?M`n~BJ7nxeu;BVH9fyI$X%5K#?_CBBPDm`+MF5eZ-UaYQ7X?xicEn8^8m)9@ zH6)JIKg8uoxhvV$Gy8=x438hSiBT=c#sXcED@7w~VCR0-*%Rh_r*qPd!^2d@hdJ|^ z8q&IzB*i8Iop;9x0ZV5)zsQCH!;b?kD@J9@?PBq4gv@_L*|MP93E9hb5pFlr*=c0vByz$AuW#%A7PvF^QsTiG-O zvIY|6_hw53@r%3(){n`j%jCPbhAhKYT~zwkz+lNc$?jOoXt;fO z+xe~fmb+N(+1wgI78&7~97NdQOhb|4u~%D@5e#gQ42uH=cnn9TjZ%hmoSjbwL=4>L zhS{jp)xDYtfgMJ)p`;j+a?OKN)7$!J86(RK$s)%3R%wI_-r6%1XLzP&jpUMCq#tLv zaoXgTBOf+2f+oUja_hA=AE<1(0s0|BpFVTbN*A(Bm@k9uNh{Ke+EqQDs&-Yo=IdTK zWBQp4WRt$#2B+;#y8O+yJ+<$GlXDhrshtXphT+ZZ9<(lp9jU9cJCE%GIF&%;(Q0mH zC42}m6N5rkc4A!w7a2%G9sAgrBCerSeFX!_q`TJ?N0(Zh;XyHsc^7k{Y~}1?80A9E z-)3-8=nlLRGiXQ6H^BFquq2?zlwdH3tv;|Rl!iWMubKIbGv`y!muY(mby96C*HeBO z=MIXBcH~N^v6+k|s*zxID8a5uIZtmw)v{qoShGnYNSsk7u{q6KP}PHyI;*#hD)>b$ zP+WZ=G~giG!j|hpzTw&y6c??JJWXU}xTwSmd9x_x%4+0uWBYT?XXG;*uBc{S$B??m zozvHc6+*8kgRGbAQ1_M$vm4R<>cE#~BbU%RUYwQpPd z5nV527GV^s#$K6iBppurSv#8k`84tK3itHX&u_^jtX_Bq*}*Vu*T70yK6i}#{)eDurajg;M z1UAWe@?_MRfz55YtB-Kz#(W$9-+eS;uC~a@WV&7!EYWAa-N#G-i5#U}Z8|;F)b!|K zwmpmQNt!U`s`<_&g#2)&Hkhh=V0Tpvj&RQ?B@tjeU7|)KUAEeWrKzh1w;l@HM9E%`MO+>Hl$_i-U5hT%0(znJ3y< zJ5R`wm8w;?x}7s@ghg#?Z^LTUAbj4|tQ$QOCi`1=I}TlunpnbBqnf~3k#=n$&`QHr zup_xhvNVYX65*~{9se=GLHfPVZBr)b-ax4n?Rx_?1rWKxPHM>lSnG96NBk6pa86%i z6e~DUlsKiGhERwVITqTctU@%~5G^bFtaNTk8`(42lt3><BNq{n1fLW>8zmW?GFemw>M+*ENZSy;W6-&6 zc|5@iQsjW;3RqGcHBR%o^BQWPQrWm+QO3<}Dz}l=)+RX(&`BNtH$%LQaK6k2tRk)7C3Z6hx*ccO zB8RvpAi^&zTkc|k3Bz6BQ3-b_KHE=pv*NS;W;r%=v}!jSQiI4>;xw=SNkfcC{y{2U zQL1ja3lV{Ft|^LcWrE4nkSNi2(I>G>j2*EWml1$Zx8uI#(ng>AyCOgFG3C;-n4LJ@ z2rG#k)inc&&AdKQo28&F`MWg4zCW~c-Qx(Up|)@|%~>PtU56`2m|u0Ozn<~Cw)A02 z5iA6XLbhc)ea8il=eJl`(IU@N1f`tHp8vF$J7y^nJ$GN@Q>UAYsLx_H+r8LvJDG6y z0s|C>A-8$0WBa3gv}^{(oEzri@fSOqDu65>F@_r%WJ-gMA*{4}9bxN|Y%-~wO9Jfj zle}5RM5Yc=pWDc}^1R8)Q?bOE2G{~yhcb?^jX-Wz3m@2azjy&;TXJ6jrO!&*Zf2fv z7i4Q>n!F_&6N6D7Jwg=CfwovAS;JP+!Z=Rmmp1DOr|ZIsRkvMMXLmx9fGuL78`-6h zncHMhJ1pbj%h^9t-JJ67~IHxa|%fm#TlWrN@TC*zj(Hv2H5Ub~|$hhu} z@X_3ibp`9xAQz2gb|Fe;t>J&;eUX$TT>r=$LpWyz&-v%Q+v`W7owCVKBe~_LxMCu6 zkLxXnc_dyyDhPH=?vvDJVv1vP@Un7naSSl9z0KM{HAqv3R=PWld(G z)5JioTEK@6NXg!=rqsZa1q^e7)xB+SbvI|)T*F_gSQw;))p!%8 zwiww}m|0h4qog~xRt*OrLk-JpX`9n+zU(b_oVyWooWN^V6hzKsS*yOeP{mRv?H@tT zw0-ns-xa~47CI}MrCCwc2Q*)pqPW|*b5F%MhU5EaBEt!HX7W)7>snOU>f%f+9fO6w z5*A{*L>ERz4iy?QFH-Wq7BNINo7QL>6U33!gJxPb+M&mSYL%-Ltrpa1u8k~JMz-9r z<$8ElrcPxB6!uOOhL}kP8^jlFKzFetrKS#`AB&T-&^X^#4@kL}5=cwzT3VPI$A@m0 zq#j+?S*)q}7G>k3uundaWuQDHg*B;|Oj$}5VPCg0{r_9X?;YJv>loXn z6-5$5%tKkPmZY!HQ3xY8;!V|8FT_x^u742BhWFMhN>d!ir+v4O=pwTdZV>Vyfl z1He1oWU`9Apj!dZJd!rH5dX{XpeA;VP_s)AdIr6vtdpZ}ADd(|e5QuyQO+(y} zjL@^za26AXsWl?|zUT7_fL^v|^e^IzHlAqdhOOxSI6;bW<6_()qcjqjnZuq!DztkhEd)!qb%wr z=2(d(v}U)Tt>%Q8wnH=|(+BgR2qxIa0y8l>vRgQNOT%U^fONQM6Y`TC&GsENXt@3% zbakEVbIIA;67@7})M}>77A#r0U?nU2Y=M;$K{9sEd^wCUyOnbsFKu7GX|kP~*r)q- zBN9T*>^Ip20!T8Jul>1K1=h;)FT6dOs)n!hI(YCN7R+? ze*T+I-)78~J2zpHgYV98llekjOe-OizO6tdeD8gk&qTKm1{43BY>wPe%CD@o!uBKq>|G;DXn$~HZalZE6X%Pqo%eYC@M90O;E(7iSpdE`!M8eLt zK9X!q&YQR6o=|1@tiR9gjb9hn)*&qPY|)4a%(tYr1M8AKBwA1eorsKEft7hY%+@Vg z!9NboWJfbe5-uzM)Pzv}(=+=I<1{1q!kMmG#vU=kg4ZlA6dixLsO}ZjQ$|~@t7!TX zJ=RPT!A_5vu&hf(%UlS`F!#T7>L@3Ah7f2Su`qBjx4BvW6>8wP+*QcnVeICDY{fyh z7yF#~tYgKP>uY?*gwgX^?knFWiU;RPs>hkz!`kzLp^J+`VF&gnaAkXsYbXmuVzfj4#!_Qx;xDi# z$awR3?hr#F4DnasyYE@@F$t3R7WUVVF~++gBHZ zE3P%h?beeSMN`IwQG~E~)#x@$x+fez&0nU}8DiHdg;Myu7|W1vPW;M&I6G?>%|#gc z88N>6%>|?UW2+BF75+b6B(oK(@Zf~iV8RSOG9uEBF9c$Q=)A==r~4bBi#)?ljB!&G zg|S68O!e9>te#+c*8Y5`EgH`9zHuKV0}k22mX&>98(Gi~aS|2vNUn9YIE4A8j`fmR z=wH}NmaOMB0%l+aE~oBPCmv*c#kEG`E?TJ~#NX?gyeQT}5vR!}4;XhwExjcj3a%kUkdFfdZ>=Ya{QP(}$v>9S4*l+E%@(bH>(rTVMSe&DHI%l#ZK| z+DXwYK{di^rmKlCwz12Pxr8C6L8YO{6v6Z(muiA$VJcNs<2M#N6D3UJ$QnuVy(eb^ zm}zwC`fjpi(A&@9avnKg1%F?Q+WiLvfEUH#fxD zQ6o(jwMi)ZBmC_QfgZDIb5hzc3nww5gnUfxsm|CxW!PS< zw!fHn5;bRRk&r6m2^p5&A1Nm!g<9#jz{Li^I@6ia@sp(GbkntjK>)b8p$BlB>n4=?1E*ejmjHZWt zpi_0!kv$1vqfJh9iydRTxO%zTc8DVfakOf5E)p4c|1Ae6 z!~M6u7&e)`Vd9ev1Q)<*h$$Ioj|M|G7q-30gijc&fh{p*C_7iJjhw@#mjW|EU875C z$1{qQ-IZ&*w|zEeG}A(pm$k3T^*!9ZbGRCJ1l0)HI9qkdW}G;4*mO~iCiZMETv(uq z{4?(TLcLqrd z?nel!qu!(T*Qq$>LlFNv)y8~aUNOu2o5~o=E=@`Eq*Du4MO%wb}re94YOA6L`fP`_r|lE9$*D5dxrp&6p~$0*jR>r7tOw+*{(ekvEPZU z!E7^aTRE7~;t|xy%sW1bCLGmBa{{y#_fO?EnrZbt3jWk{0qn*Zp-;CG*P_8Ls|Ab$ znV>4M4tZ?+1;25O$AC=3V+K?or<3__I$^nfPMYgUpUHK0-p7C-ReGha!f#@c3J*8rpEHgD;;%75(p#u&2&Au?>W8Q+@kiTnGELe^R_B=A1dafX%3`MzgA9V0Hg2nwHc4|~ z3s=Quv$4iTMY4*NzPO}j{L^>*qu^RWOuh-$kF|x$Fu8Ht9<>TP9I_V;jzAG~>UO+? zn1h|v=27HR+9K>R$~?ox!WKi4dJO1}2NU_f0SfG2HZvbh)g1?d?F~=X4aqzPAyC2= z|BEY{?UoyKc(X&0vxbc}U4#K=d%C?Dj&D(5W(j1Ahs=S=yVx1 zu5iXB9!7Ng1h*LkY#Ay?Rq+^XI8mEzpq&u+3Ta-1aTjfOb~uTErci{FY8Vf|J+*x# zJEm@WhnL2-Y_|#6HAyXMil=HeFoR7rQF+y*%>+|%kmtBSIT%yWQMkr9idv)E?#6$y z!LA$eDhlZ7xmv6;XPQwuW(P|7KQ6hsL$gjAtv^9YTEV@>&!Rv?Wwj8AMdxJQ$j@vD z(ZPwt1?VspXCYifrGyD-qY?kRx!r&qo7{VG8`V)MZKXh!K$NDuy*{ROoCwa%e|nFC z=PZW)@f}R8ts&rbQOB%($F0tW&NhJ*BkIUSRek$P;-@|(`+zHGBc(S(d!KtG<9rgxg0R}^=G+oSyY(h| z%=SjVCG+#si4PhI;2jcppbAvX?+m3R)^uSRuf4v={-X4Jj-bmZ)dz*DZ>?q9QH#};b{dInER>fsR znR+f6kA6Z~x5b@UdN10xKaY!T(rQgc%-za7UuyumG(e3P1cTgdE)e+q8hTr`gzDJf z4ll0WA$PykMwVwpy*?Y+VTXn+Df~A&?JJtYnODlEbwHyL_<)^rV?H2mr6zMT9Wc?3 zUBEONjKu}MhGxa`;UA8!F-`a>3u~zn5=G*n0;ZW8mxAl~eJZ``HMDl_2-{G@ z7_KSMc$hR5#6q1mi0UxSDhs7GNH*>yp|QzQr#y5~Q~sD0!mAob8+?3j5r39h*qQ*M zll&4&+`c>_mNyP;F>JOA6j% z-mhFY5YFAvo$-91?|7)P!AV0=&)jf9v`smh*C&N*pjU@$pgRPhjGbAQ+|bT`Ezh1# zr5y^~2aWNk;vv%dlKD$SY~px>$mPsVQKHC3GIbBuY)KZrb3F_m%`>(s#7L5%!pBw2 z1_*j~BeaIEoE%m!jzBF zE({_%_A6uW&IGbm2oK5kQxCkD9ZuUzo&gkeH_qLE3+Ts@}k&9#6{_Hj7B5ll*5GpDX8~dd5 zPn^)pv=@1y?ITr!nnd$`%f7jAO}42Pgsu*Yjafj!Zb;E=v%bLk3T#20t!0bc3Xyi| zX?AT-Y(`whX|i03kELV1Iv@z!0ZqE<#&L|8IkY5&NUfR^xYBC#s{5 zXZRg=(Uhuvc81nS1hYJ?s%x=b{t25gMN($z#T0xOv#ZY}Y~HQcHnZKDlSkoZ2z}YB zwQZCBZBB=G>jaEEn14btl-yOU2HQ4&UsWX*livafK_0LCgds z9w+<%2hybDpv1Mh(Itp9-VAQ{nbeRtC4piyJJ;w8tQpihcfva;c`jd3HTbMa6%GBj zb3~PClv88mp>)N|IQbx3*|{!?WRXzDWms2v;2Ovk7}-J`lTDeJlwPEN#p7^8PDPjL z%9VFxs@h-@%lj-p;=dNOV#L`qtrfVRYJBdw``NOrr{+uKr>-(4!8G4CHP{-jk*yop z;fUUHnjB+sy%a|Iv`l`g$RwHZh3Y)imTw+UjCyTGz)_b=(&;QxJ~5vSkYL#EtlqQL zY8J0Dbq;$t-B^!Sf4bhL)<7XXQe;JmClpOylT9aFhXrYI4DuNbrXK!_FLHhsqffM! z%PU^J1ue&8jZU4-<+>?oW`&D>#`c{@6u%r3{9x89~B!da%9RK|Ao7RM%yg z>0JUAt$PE;Bp9xCJ3fQU($8l}W=t#=YqTu{&$qg3tC>ciowd=POw*{Mn3$7Rpt{bZ z3q1)bnLSeLkG2Mx`8ciNl;wk|Gg%;ImHkATKh9V2VS#aXeaHRkZOPyG!d7wdO?4f+ z-NYVFLXaw&Qe5Vw@ey(Gp?E}~-+Awh(Y}2ZgD<^^2)tyzCS|ywh8CP5LEG2Uu}#c8 zm@I=PZ_a2sUZ#CMD{|D7uZ47F+B-ezGzpj1!E~0kid>5(N+ZVToJK&N? pCfPck_j^y$XKNMS_1r)*I?5R=-88Stx9eph8#am@QReom{~z8?8, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: Airtime 2.3\n" +"Report-Msgid-Bugs-To: http://forum.sourcefabric.org/\n" +"POT-Creation-Date: 2012-11-29 11:44-0500\n" +"PO-Revision-Date: 2013-04-02 16:58+0100\n" +"Last-Translator: Daniel James \n" +"Language-Team: Austrian Localization \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: airtime_mvc/application/configs/navigation.php:12 +msgid "Now Playing" +msgstr "Jetzt" + +#: airtime_mvc/application/configs/navigation.php:19 +msgid "Add Media" +msgstr "Medien hinzufügen" + +#: airtime_mvc/application/configs/navigation.php:26 +msgid "Library" +msgstr "Mediensammlung" + +#: airtime_mvc/application/configs/navigation.php:33 +msgid "Calendar" +msgstr "Kalender" + +#: airtime_mvc/application/configs/navigation.php:40 +msgid "System" +msgstr "System" + +#: airtime_mvc/application/configs/navigation.php:45 +#: airtime_mvc/application/views/scripts/preference/index.phtml:2 +msgid "Preferences" +msgstr "Einstellungen" + +#: airtime_mvc/application/configs/navigation.php:50 +msgid "Users" +msgstr "Benutzer" + +#: airtime_mvc/application/configs/navigation.php:57 +msgid "Media Folders" +msgstr "Medienverzeichnisse" + +#: airtime_mvc/application/configs/navigation.php:64 +msgid "Streams" +msgstr "Streams" + +#: airtime_mvc/application/configs/navigation.php:70 +#: airtime_mvc/application/controllers/PreferenceController.php:134 +msgid "Support Feedback" +msgstr "Support Feedback" + +#: airtime_mvc/application/configs/navigation.php:76 +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:5 +msgid "Status" +msgstr "Status" + +#: airtime_mvc/application/configs/navigation.php:83 +msgid "Playout History" +msgstr "Playout Historie" + +#: airtime_mvc/application/configs/navigation.php:90 +msgid "Listener Stats" +msgstr "Hörerstatistiken" + +#: airtime_mvc/application/configs/navigation.php:99 +#: airtime_mvc/application/views/scripts/error/error.phtml:13 +msgid "Help" +msgstr "Hilfe" + +#: airtime_mvc/application/configs/navigation.php:104 +msgid "Getting Started" +msgstr "Kurzanleitung" + +#: airtime_mvc/application/configs/navigation.php:111 +msgid "User Manual" +msgstr "Benutzerhandbuch" + +#: airtime_mvc/application/configs/navigation.php:116 +#: airtime_mvc/application/views/scripts/dashboard/about.phtml:2 +msgid "About" +msgstr "Über" + +#: airtime_mvc/application/layouts/scripts/bare.phtml:5 +#: airtime_mvc/application/views/scripts/dashboard/stream-player.phtml:2 +msgid "Live stream" +msgstr "Live Stream" + +#: airtime_mvc/application/layouts/scripts/audio-player.phtml:5 +#: airtime_mvc/application/controllers/LocaleController.php:34 +msgid "Audio Player" +msgstr "Audio Player" + +#: airtime_mvc/application/layouts/scripts/layout.phtml:26 +msgid "Logout" +msgstr "Abmelden" + +#: airtime_mvc/application/layouts/scripts/login.phtml:16 +#, php-format +msgid "Airtime Copyright ©Sourcefabric o.p.s. All rights reserved.%sMaintained and distributed under GNU GPL v.3 by %sSourcefabric o.p.s%s" +msgstr "Airtime Copyright ©Sourcefabric o.p.s. Alle Rechte vorbehalten.%sGepflegt und vertrieben unter GNU GPL v.3 von %sSourcefabric o.p.s%s" + +#: airtime_mvc/application/models/StoredFile.php:797 +#: airtime_mvc/application/controllers/LocaleController.php:277 +msgid "Track preview" +msgstr "Titelvorschau" + +#: airtime_mvc/application/models/StoredFile.php:799 +msgid "Playlist preview" +msgstr "Playlist Vorschau" + +#: airtime_mvc/application/models/StoredFile.php:802 +msgid "Webstream preview" +msgstr "Webstream Vorschau" + +#: airtime_mvc/application/models/StoredFile.php:804 +msgid "Smart Block" +msgstr "Smart Block" + +#: airtime_mvc/application/models/StoredFile.php:937 +msgid "Failed to create 'organize' directory." +msgstr "Fehler beim Erstellen des Ordners 'organize'" + +#: airtime_mvc/application/models/StoredFile.php:950 +#, php-format +msgid "The file was not uploaded, there is %s MB of disk space left and the file you are uploading has a size of %s MB." +msgstr "Die Datei konnte nicht hochgeladen werden. Es sind %s MB Speicherplatz frei und die Datei, die sie hochladen wollen, hat eine Größe von %s MB." + +#: airtime_mvc/application/models/StoredFile.php:959 +msgid "This file appears to be corrupted and will not be added to media library." +msgstr "Die Datei scheint fehlerhaft zu sein und wird der Mediensammlung nicht hinzugefügt." + +#: airtime_mvc/application/models/StoredFile.php:995 +msgid "The file was not uploaded, this error can occur if the computer hard drive does not have enough disk space or the stor directory does not have correct write permissions." +msgstr "Die Datei konnte nicht hochgeladen werden. Dieser Fehler kann auftreten, wenn die Festplatte des Computers nicht genug Speicherplatz frei hat oder sie keine Schreibberechtigung für den Ordner 'stor' haben." + +#: airtime_mvc/application/models/Preference.php:469 +msgid "Select Country" +msgstr "Land wählen" + +#: airtime_mvc/application/models/MusicDir.php:160 +#, php-format +msgid "%s is already watched." +msgstr "%s wird bereits überwacht." + +#: airtime_mvc/application/models/MusicDir.php:164 +#, php-format +msgid "%s contains nested watched directory: %s" +msgstr "%s enthält andere bereits überwachte Verzeichnisse: %s " + +#: airtime_mvc/application/models/MusicDir.php:168 +#, php-format +msgid "%s is nested within existing watched directory: %s" +msgstr "%s ist ein Unterverzeichnis eines bereits überwachten Verzeichnisses: %s" + +#: airtime_mvc/application/models/MusicDir.php:189 +#: airtime_mvc/application/models/MusicDir.php:363 +#, php-format +msgid "%s is not a valid directory." +msgstr "%s ist kein gültiges Verzeichnis." + +#: airtime_mvc/application/models/MusicDir.php:231 +#, php-format +msgid "%s is already set as the current storage dir or in the watched folders list" +msgstr "%s ist bereits als aktuelles Speicherverzeichnis bestimmt oder in der Liste überwachter Verzeichnisse." + +#: airtime_mvc/application/models/MusicDir.php:381 +#, php-format +msgid "%s is already set as the current storage dir or in the watched folders list." +msgstr "%s ist bereits als aktuelles Speicherverzeichnis bestimmt oder in der Liste überwachter Verzeichnisse." + +#: airtime_mvc/application/models/MusicDir.php:424 +#, php-format +msgid "%s doesn't exist in the watched list." +msgstr "%s existiert nicht in der Liste überwachter Verzeichnisse." + +#: airtime_mvc/application/models/Playlist.php:724 +#: airtime_mvc/application/models/Block.php:757 +msgid "Cue in and cue out are null." +msgstr "Cue In und Cue Out sind Null." + +#: airtime_mvc/application/models/Playlist.php:754 +#: airtime_mvc/application/models/Playlist.php:777 +#: airtime_mvc/application/models/Block.php:803 +#: airtime_mvc/application/models/Block.php:824 +msgid "Can't set cue in to be larger than cue out." +msgstr "Cue In darf nicht größer als Cue Out sein." + +#: airtime_mvc/application/models/Playlist.php:761 +#: airtime_mvc/application/models/Playlist.php:802 +#: airtime_mvc/application/models/Block.php:792 +#: airtime_mvc/application/models/Block.php:848 +msgid "Can't set cue out to be greater than file length." +msgstr "Cue In darf nicht größer als die Gesamtdauer der Datei sein." + +#: airtime_mvc/application/models/Playlist.php:795 +#: airtime_mvc/application/models/Block.php:859 +msgid "Can't set cue out to be smaller than cue in." +msgstr "Cue Out darf nicht kleiner als Cue In sein." + +#: airtime_mvc/application/models/Show.php:180 +msgid "Shows can have a max length of 24 hours." +msgstr "Die Maximaldauer einer Sendung beträgt 24 Stunden." + +#: airtime_mvc/application/models/Show.php:211 +#: airtime_mvc/application/forms/AddShowWhen.php:120 +msgid "End date/time cannot be in the past" +msgstr "Enddatum / Endzeit darf nicht in der Vergangheit liegen." + +#: airtime_mvc/application/models/Show.php:222 +msgid "" +"Cannot schedule overlapping shows.\n" +"Note: Resizing a repeating show affects all of its repeats." +msgstr "" +"Sendungen können nicht überlappend geplant werden.\n" +"Beachte: Wird die Dauer einer wiederkehrenden Sendung verändert, wirkt sich das auch auf alle Wiederholungen aus." + +#: airtime_mvc/application/models/Webstream.php:157 +msgid "Length needs to be greater than 0 minutes" +msgstr "Dauer muß länger als 0 Minuten sein." + +#: airtime_mvc/application/models/Webstream.php:162 +msgid "Length should be of form \"00h 00m\"" +msgstr "Dauer im Format \"00h 00m\" eingeben." + +#: airtime_mvc/application/models/Webstream.php:175 +msgid "URL should be of form \"http://domain\"" +msgstr "URL im Format \"http://domain\" eingeben." + +#: airtime_mvc/application/models/Webstream.php:178 +msgid "URL should be 512 characters or less" +msgstr "URL darf aus höchstens 512 Zeichen bestehen." + +#: airtime_mvc/application/models/Webstream.php:184 +msgid "No MIME type found for webstream." +msgstr "Es konnte kein MIME-Typ für den Webstream gefunden werden." + +#: airtime_mvc/application/models/Webstream.php:200 +msgid "Webstream name cannot be empty" +msgstr "Die Bezeichnung eines Webstreams darf nicht leer sein." + +#: airtime_mvc/application/models/Webstream.php:269 +msgid "Could not parse XSPF playlist" +msgstr "XSPF-Playlist konnte nicht aufgeschlüsselt werden." + +#: airtime_mvc/application/models/Webstream.php:281 +msgid "Could not parse PLS playlist" +msgstr "PLS-Playlist konnte nicht aufgeschlüsselt werden." + +#: airtime_mvc/application/models/Webstream.php:300 +msgid "Could not parse M3U playlist" +msgstr "M3U-Playlist konnte nicht aufgeschlüsselt werden." + +#: airtime_mvc/application/models/Webstream.php:314 +msgid "Invalid webstream - This appears to be a file download." +msgstr "Ungültiger Webstream - Die eingegebene URL scheint ein Dateidownload zu sein." + +#: airtime_mvc/application/models/Webstream.php:318 +#, php-format +msgid "Unrecognized stream type: %s" +msgstr "Unbekannter Stream-Typ: %s" + +#: airtime_mvc/application/models/ShowInstance.php:245 +msgid "Can't drag and drop repeating shows" +msgstr "Wiederkehrende Sendungen können nicht per Drag'n'Drop verschoben werden." + +#: airtime_mvc/application/models/ShowInstance.php:253 +msgid "Can't move a past show" +msgstr "Eine in der Vergangenheit liegende Sendung kann nicht verschoben werden." + +#: airtime_mvc/application/models/ShowInstance.php:270 +msgid "Can't move show into past" +msgstr "Eine Sendung kann nicht in die Vergangenheit verschoben werden." + +#: airtime_mvc/application/models/ShowInstance.php:276 +#: airtime_mvc/application/forms/AddShowWhen.php:254 +#: airtime_mvc/application/forms/AddShowWhen.php:268 +#: airtime_mvc/application/forms/AddShowWhen.php:291 +#: airtime_mvc/application/forms/AddShowWhen.php:297 +#: airtime_mvc/application/forms/AddShowWhen.php:302 +msgid "Cannot schedule overlapping shows" +msgstr "Sendungen können nicht überlappend geplant werden." + +#: airtime_mvc/application/models/ShowInstance.php:290 +msgid "Can't move a recorded show less than 1 hour before its rebroadcasts." +msgstr "Eine aufgezeichnete Sendung kann nicht verschoben werden, wenn der Zeitpunkt der Wiederholung weniger als eine Stunde bevor liegt." + +#: airtime_mvc/application/models/ShowInstance.php:303 +msgid "Show was deleted because recorded show does not exist!" +msgstr "Die Sendung wurde gelöscht, weil die aufgezeichnete Sendung nicht existiert." + +#: airtime_mvc/application/models/ShowInstance.php:310 +msgid "Must wait 1 hour to rebroadcast." +msgstr "Das Wiederholen einer Sendung ist erst nach einer Stunde Wartezeit möglich." + +#: airtime_mvc/application/models/ShowInstance.php:342 +msgid "can't resize a past show" +msgstr "Die Dauer einer vergangenen Sendung kann nicht verändert werden." + +#: airtime_mvc/application/models/ShowInstance.php:364 +msgid "Should not overlap shows" +msgstr "Sendungen sollten nicht überlappen." + +#: airtime_mvc/application/models/Auth.php:33 +#, php-format +msgid "" +"Hi %s, \n" +"\n" +"Click this link to reset your password: " +msgstr "" +"Hallo %s,\n" +"\n" +"Klicke auf diesen Link um dein Passwort zurückzusetzen:" + +#: airtime_mvc/application/models/Auth.php:36 +msgid "Airtime Password Reset" +msgstr "Airtime Passwort Reset" + +#: airtime_mvc/application/models/Scheduler.php:82 +msgid "The schedule you're viewing is out of date! (sched mismatch)" +msgstr "Der Kalender den sie sehen ist nicht mehr aktuell! (Kalender falsch eingepasst)" + +#: airtime_mvc/application/models/Scheduler.php:87 +msgid "The schedule you're viewing is out of date! (instance mismatch)" +msgstr "Der Kalender den sie sehen ist nicht mehr aktuell! (Objekt falsch eingepasst)" + +#: airtime_mvc/application/models/Scheduler.php:95 +#: airtime_mvc/application/models/Scheduler.php:346 +msgid "The schedule you're viewing is out of date!" +msgstr "Der Kalender den sie sehen ist nicht mehr aktuell." + +#: airtime_mvc/application/models/Scheduler.php:105 +#, php-format +msgid "You are not allowed to schedule show %s." +msgstr "Sie haben nicht die erforderliche Berechtigung einen Termin für die Sendung %s zu festzulegen." + +#: airtime_mvc/application/models/Scheduler.php:109 +msgid "You cannot add files to recording shows." +msgstr "Einer Sendungsaufzeichnung können keine Dateien hinzugefügt werden." + +#: airtime_mvc/application/models/Scheduler.php:115 +#, php-format +msgid "The show %s is over and cannot be scheduled." +msgstr "Die Sendung %s ist beendet und kann daher nicht festgelegt werden." + +#: airtime_mvc/application/models/Scheduler.php:122 +#, php-format +msgid "The show %s has been previously updated!" +msgstr "Die Sendung %s wurde bereits aktualisiert." + +#: airtime_mvc/application/models/Scheduler.php:141 +#: airtime_mvc/application/models/Scheduler.php:222 +msgid "A selected File does not exist!" +msgstr "Eine der gewählten Dateien existiert nicht!" + +#: airtime_mvc/application/models/ShowBuilder.php:198 +#, php-format +msgid "Rebroadcast of %s from %s" +msgstr "Wiederholung von %s am %s" + +#: airtime_mvc/application/models/Block.php:1207 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:41 +msgid "Select criteria" +msgstr "Kriterien wählen" + +#: airtime_mvc/application/models/Block.php:1208 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:42 +#: airtime_mvc/application/controllers/LocaleController.php:68 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:8 +msgid "Album" +msgstr "Album" + +#: airtime_mvc/application/models/Block.php:1209 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:43 +msgid "Bit Rate (Kbps)" +msgstr "Bitrate (Kbps)" + +#: airtime_mvc/application/models/Block.php:1210 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:44 +#: airtime_mvc/application/controllers/LocaleController.php:70 +msgid "BPM" +msgstr "BPM" + +#: airtime_mvc/application/models/Block.php:1211 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:45 +#: airtime_mvc/application/controllers/LocaleController.php:71 +#: airtime_mvc/application/controllers/LocaleController.php:154 +msgid "Composer" +msgstr "Komponist" + +#: airtime_mvc/application/models/Block.php:1212 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:46 +#: airtime_mvc/application/controllers/LocaleController.php:72 +msgid "Conductor" +msgstr "Dirigent" + +#: airtime_mvc/application/models/Block.php:1213 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:47 +#: airtime_mvc/application/controllers/LocaleController.php:73 +#: airtime_mvc/application/controllers/LocaleController.php:155 +msgid "Copyright" +msgstr "Copyright" + +#: airtime_mvc/application/models/Block.php:1214 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:48 +#: airtime_mvc/application/controllers/LocaleController.php:67 +#: airtime_mvc/application/controllers/LocaleController.php:151 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:7 +msgid "Creator" +msgstr "Interpret" + +#: airtime_mvc/application/models/Block.php:1215 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:49 +#: airtime_mvc/application/controllers/LocaleController.php:74 +msgid "Encoded By" +msgstr "Encoded By" + +#: airtime_mvc/application/models/Block.php:1216 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:132 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:50 +#: airtime_mvc/application/controllers/LocaleController.php:75 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:10 +msgid "Genre" +msgstr "Genre" + +#: airtime_mvc/application/models/Block.php:1217 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:51 +#: airtime_mvc/application/controllers/LocaleController.php:76 +msgid "ISRC" +msgstr "ISRC" + +#: airtime_mvc/application/models/Block.php:1218 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:52 +#: airtime_mvc/application/controllers/LocaleController.php:77 +msgid "Label" +msgstr "Label" + +#: airtime_mvc/application/models/Block.php:1219 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:53 +#: airtime_mvc/application/forms/GeneralPreferences.php:56 +#: airtime_mvc/application/controllers/LocaleController.php:78 +msgid "Language" +msgstr "Sprache" + +#: airtime_mvc/application/models/Block.php:1220 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:54 +#: airtime_mvc/application/controllers/LocaleController.php:79 +msgid "Last Modified" +msgstr "Zuletzt geändert" + +#: airtime_mvc/application/models/Block.php:1221 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:55 +#: airtime_mvc/application/controllers/LocaleController.php:80 +msgid "Last Played" +msgstr "Zuletzt gespielt" + +#: airtime_mvc/application/models/Block.php:1222 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:56 +#: airtime_mvc/application/controllers/LocaleController.php:81 +#: airtime_mvc/application/controllers/LocaleController.php:153 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:9 +msgid "Length" +msgstr "Dauer" + +#: airtime_mvc/application/models/Block.php:1223 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:57 +#: airtime_mvc/application/controllers/LocaleController.php:82 +msgid "Mime" +msgstr "Mime" + +#: airtime_mvc/application/models/Block.php:1224 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:58 +#: airtime_mvc/application/controllers/LocaleController.php:83 +msgid "Mood" +msgstr "Stimmung" + +#: airtime_mvc/application/models/Block.php:1225 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:59 +#: airtime_mvc/application/controllers/LocaleController.php:84 +msgid "Owner" +msgstr "Besitzer" + +#: airtime_mvc/application/models/Block.php:1226 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:60 +#: airtime_mvc/application/controllers/LocaleController.php:85 +msgid "Replay Gain" +msgstr "Replay Gain" + +#: airtime_mvc/application/models/Block.php:1227 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:61 +msgid "Sample Rate (kHz)" +msgstr "Sample Rate (KHz)" + +#: airtime_mvc/application/models/Block.php:1228 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:62 +#: airtime_mvc/application/controllers/LocaleController.php:66 +#: airtime_mvc/application/controllers/LocaleController.php:150 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:6 +msgid "Title" +msgstr "Titel" + +#: airtime_mvc/application/models/Block.php:1229 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:63 +#: airtime_mvc/application/controllers/LocaleController.php:87 +msgid "Track Number" +msgstr "Titelnummer" + +#: airtime_mvc/application/models/Block.php:1230 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:64 +#: airtime_mvc/application/controllers/LocaleController.php:88 +msgid "Uploaded" +msgstr "Hochgeladen" + +#: airtime_mvc/application/models/Block.php:1231 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:65 +#: airtime_mvc/application/controllers/LocaleController.php:89 +msgid "Website" +msgstr "Webseite" + +#: airtime_mvc/application/models/Block.php:1232 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:66 +#: airtime_mvc/application/controllers/LocaleController.php:90 +msgid "Year" +msgstr "Jahr" + +#: airtime_mvc/application/common/DateHelper.php:335 +#, php-format +msgid "The year %s must be within the range of 1753 - 9999" +msgstr "Das Jahr %s muß innerhalb des Bereichs von 1753 - 9999 liegen." + +#: airtime_mvc/application/common/DateHelper.php:338 +#, php-format +msgid "%s-%s-%s is not a valid date" +msgstr "%s-%s-%s ist kein gültiges Datum" + +#: airtime_mvc/application/common/DateHelper.php:362 +#, php-format +msgid "%s:%s:%s is not a valid time" +msgstr "%s-%s-%s ist kein gültiger Zeitpunkt." + +#: airtime_mvc/application/forms/EmailServerPreferences.php:17 +msgid "Enable System Emails (Password Reset)" +msgstr "System E-Mails aktivieren (Passwort Reset)" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:27 +msgid "Reset Password 'From' Email" +msgstr "Reset Passwort 'From' E-Mail (Absenderbezeichnung)" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:34 +msgid "Configure Mail Server" +msgstr "Mail-Server konfigurieren" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:43 +msgid "Requires Authentication" +msgstr "Authentifizierung erforderlich" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:53 +msgid "Mail Server" +msgstr "Mail-Server" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:67 +msgid "Email Address" +msgstr "E-Mail Adresse" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:82 +#: airtime_mvc/application/forms/PasswordChange.php:17 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:120 +msgid "Password" +msgstr "Passwort" + +#: airtime_mvc/application/forms/EmailServerPreferences.php:100 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:109 +msgid "Port" +msgstr "Port" + +#: airtime_mvc/application/forms/RegisterAirtime.php:30 +#: airtime_mvc/application/forms/SupportSettings.php:21 +#: airtime_mvc/application/forms/GeneralPreferences.php:22 +msgid "Station Name" +msgstr "Sendername:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:39 +#: airtime_mvc/application/forms/SupportSettings.php:34 +msgid "Phone:" +msgstr "Telefon:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:51 +#: airtime_mvc/application/forms/AddUser.php:54 +#: airtime_mvc/application/forms/SupportSettings.php:46 +msgid "Email:" +msgstr "E-Mail:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:62 +#: airtime_mvc/application/forms/SupportSettings.php:57 +msgid "Station Web Site:" +msgstr "Sender-Webseite:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:73 +#: airtime_mvc/application/forms/SupportSettings.php:68 +msgid "Country:" +msgstr "Land:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:84 +#: airtime_mvc/application/forms/SupportSettings.php:79 +msgid "City:" +msgstr "Stadt:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:96 +#: airtime_mvc/application/forms/SupportSettings.php:91 +msgid "Station Description:" +msgstr "Sender Beschreibung:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:106 +#: airtime_mvc/application/forms/SupportSettings.php:101 +msgid "Station Logo:" +msgstr "Sender Logo:" + +#: airtime_mvc/application/forms/RegisterAirtime.php:116 +#: airtime_mvc/application/forms/SupportSettings.php:112 +msgid "Send support feedback" +msgstr "Support Feedback senden" + +#: airtime_mvc/application/forms/RegisterAirtime.php:126 +#: airtime_mvc/application/forms/SupportSettings.php:122 +msgid "Promote my station on Sourcefabric.org" +msgstr "Meine Radio Station auf Sourcefabric.org bewerben" + +#: airtime_mvc/application/forms/RegisterAirtime.php:149 +#: airtime_mvc/application/forms/SupportSettings.php:148 +#, php-format +msgid "By checking this box, I agree to Sourcefabric's %sprivacy policy%s." +msgstr "Hiermit akzeptiere ich Sourcefabric's %sDatenschutzrichtlinien%s." + +#: airtime_mvc/application/forms/RegisterAirtime.php:166 +#: airtime_mvc/application/forms/SupportSettings.php:173 +msgid "You have to agree to privacy policy." +msgstr "Sie müssen die Datenschutzrichtlinien akzeptieren." + +#: airtime_mvc/application/forms/PasswordChange.php:28 +msgid "Confirm new password" +msgstr "Neues Passwort bestätigen" + +#: airtime_mvc/application/forms/PasswordChange.php:36 +msgid "Password confirmation does not match your password." +msgstr "Passwortbestätigung stimmt nicht mit Passwort überein" + +#: airtime_mvc/application/forms/PasswordChange.php:43 +msgid "Get new password" +msgstr "Neues Passwort erhalten" + +#: airtime_mvc/application/forms/DateRange.php:16 +#: airtime_mvc/application/forms/ShowBuilder.php:18 +msgid "Date Start:" +msgstr "Zeitpunkt Start:" + +#: airtime_mvc/application/forms/DateRange.php:35 +#: airtime_mvc/application/forms/DateRange.php:63 +#: airtime_mvc/application/forms/AddShowRebroadcastDates.php:31 +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:99 +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:118 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:100 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:123 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:144 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:174 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:186 +#: airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php:26 +#: airtime_mvc/application/forms/ShowBuilder.php:37 +#: airtime_mvc/application/forms/ShowBuilder.php:65 +msgid "Invalid character entered" +msgstr "Ungültiges Zeichen eingeben" + +#: airtime_mvc/application/forms/DateRange.php:44 +#: airtime_mvc/application/forms/AddShowRepeats.php:40 +#: airtime_mvc/application/forms/ShowBuilder.php:46 +msgid "Date End:" +msgstr "Zeitpunkt Ende:" + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:8 +#: airtime_mvc/application/forms/customvalidators/ConditionalNotEmpty.php:26 +msgid "Value is required and can't be empty" +msgstr "Wert erforderlich. Feld darf nicht leer sein." + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:19 +msgid "'%value%' is no valid email address in the basic format local-part@hostname" +msgstr "'%value%' ist keine gültige E-Mail-Adresse im Standardformat local-part@hostname" + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:33 +msgid "'%value%' does not fit the date format '%format%'" +msgstr "'%value%' wurde nicht im erforderlichen Datumsformat '%format%' eingegeben" + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:59 +msgid "'%value%' is less than %min% characters long" +msgstr "'%value%' ist kürzer als %min% Zeichen lang" + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:64 +msgid "'%value%' is more than %max% characters long" +msgstr "'%value%' ist mehr als %max% Zeichen lang" + +#: airtime_mvc/application/forms/helpers/ValidationTypes.php:76 +msgid "'%value%' is not between '%min%' and '%max%', inclusively" +msgstr "'%value%' liegt nicht zwischen '%min%' und '%max%'" + +#: airtime_mvc/application/forms/AddShowRebroadcastDates.php:15 +#: airtime_mvc/application/views/scripts/partialviews/trialBox.phtml:6 +msgid "days" +msgstr "Tage" + +#: airtime_mvc/application/forms/AddShowRebroadcastDates.php:63 +#: airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php:58 +msgid "Day must be specified" +msgstr "Tag muß angegeben werden" + +#: airtime_mvc/application/forms/AddShowRebroadcastDates.php:68 +#: airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php:63 +msgid "Time must be specified" +msgstr "Zeit muß angegeben werden" + +#: airtime_mvc/application/forms/AddShowRebroadcastDates.php:95 +#: airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php:86 +msgid "Must wait at least 1 hour to rebroadcast" +msgstr "Das Wiederholen einer Sendung ist erst nach einer Stunde Wartezeit möglich." + +#: airtime_mvc/application/forms/AddShowRR.php:10 +msgid "Record from Line In?" +msgstr "Aufzeichnen von Line-In?" + +#: airtime_mvc/application/forms/AddShowRR.php:16 +msgid "Rebroadcast?" +msgstr "Wiederholen?" + +#: airtime_mvc/application/forms/AddShowStyle.php:10 +msgid "Background Colour:" +msgstr "Hintergrundfarbe:" + +#: airtime_mvc/application/forms/AddShowStyle.php:29 +msgid "Text Colour:" +msgstr "Textfarbe:" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:19 +msgid "Auto Switch Off" +msgstr "Automatisch abschalten" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:26 +msgid "Auto Switch On" +msgstr "Automatisch anschalten" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:33 +msgid "Switch Transition Fade (s)" +msgstr "Übergang beim Umschalten (Fade in Sekunden)" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:36 +msgid "enter a time in seconds 00{.000000}" +msgstr "Eingabe der Zeit in Sekunden 00{.000000}" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:45 +msgid "Master Username" +msgstr "Master Benutzername" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:62 +msgid "Master Password" +msgstr "Master Passwort" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:70 +msgid "Master Source Connection URL" +msgstr "Master-Quelle Adresse (URL)" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:78 +msgid "Show Source Connection URL" +msgstr "Show-Quelle Adresse (URL)" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:87 +msgid "Master Source Port" +msgstr "Master-Quelle Port" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:90 +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:109 +#: airtime_mvc/application/forms/StreamSettingSubForm.php:112 +msgid "Only numbers are allowed." +msgstr "Es sind nur Zahlen erlaubt" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:96 +msgid "Master Source Mount Point" +msgstr "Master-Quelle Mount Point" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:106 +msgid "Show Source Port" +msgstr "Show-Quelle Port" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:115 +msgid "Show Source Mount Point" +msgstr "Show-Quelle Mount Point" + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:153 +msgid "You cannot use same port as Master DJ port." +msgstr "Sie können nicht denselben Port wie für die Master-Quelle verwenden." + +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:164 +#: airtime_mvc/application/forms/LiveStreamingPreferences.php:182 +#, php-format +msgid "Port %s is not available" +msgstr "Port %s ist nicht verfügbar" + +#: airtime_mvc/application/forms/WatchedDirPreferences.php:14 +msgid "Import Folder:" +msgstr "Import Verzeichnis:" + +#: airtime_mvc/application/forms/WatchedDirPreferences.php:25 +msgid "Watched Folders:" +msgstr "Überwachte Verzeichnisse:" + +#: airtime_mvc/application/forms/WatchedDirPreferences.php:40 +msgid "Not a valid Directory" +msgstr "Kein gültiges Verzeichnis" + +#: airtime_mvc/application/forms/AddUser.php:23 +#: airtime_mvc/application/forms/Login.php:19 +msgid "Username:" +msgstr "Benutzername:" + +#: airtime_mvc/application/forms/AddUser.php:32 +#: airtime_mvc/application/forms/Login.php:34 +msgid "Password:" +msgstr "Passwort:" + +#: airtime_mvc/application/forms/AddUser.php:40 +msgid "Firstname:" +msgstr "Vorname:" + +#: airtime_mvc/application/forms/AddUser.php:47 +msgid "Lastname:" +msgstr "Nachname:" + +#: airtime_mvc/application/forms/AddUser.php:63 +msgid "Mobile Phone:" +msgstr "Mobiltelefon:" + +#: airtime_mvc/application/forms/AddUser.php:69 +msgid "Skype:" +msgstr "Skype:" + +#: airtime_mvc/application/forms/AddUser.php:75 +msgid "Jabber:" +msgstr "Jabber:" + +#: airtime_mvc/application/forms/AddUser.php:82 +msgid "User Type:" +msgstr "Benutzertyp:" + +#: airtime_mvc/application/forms/AddUser.php:86 +#: airtime_mvc/application/controllers/LocaleController.php:309 +msgid "Guest" +msgstr "Gast" + +#: airtime_mvc/application/forms/AddUser.php:87 +#: airtime_mvc/application/controllers/LocaleController.php:307 +msgid "DJ" +msgstr "DJ" + +#: airtime_mvc/application/forms/AddUser.php:88 +#: airtime_mvc/application/controllers/LocaleController.php:308 +msgid "Program Manager" +msgstr "Programm Manager" + +#: airtime_mvc/application/forms/AddUser.php:89 +#: airtime_mvc/application/controllers/LocaleController.php:306 +msgid "Admin" +msgstr "Admin" + +#: airtime_mvc/application/forms/AddUser.php:97 +#: airtime_mvc/application/forms/SupportSettings.php:158 +#: airtime_mvc/application/forms/EditAudioMD.php:128 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:23 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:20 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:15 +#: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:6 +#: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:81 +#: airtime_mvc/application/views/scripts/preference/index.phtml:6 +#: airtime_mvc/application/views/scripts/preference/index.phtml:14 +msgid "Save" +msgstr "Speichern" + +#: airtime_mvc/application/forms/AddUser.php:107 +msgid "Login name is not unique." +msgstr "Benutzername ist nicht einmalig." + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:48 +msgid "Enabled:" +msgstr "Aktiviert:" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:57 +msgid "Stream Type:" +msgstr "Stream Typ:" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:67 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:9 +msgid "Bit Rate:" +msgstr "Bitrate:" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:77 +msgid "Service Type:" +msgstr "Service Typ:" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:87 +msgid "Channels:" +msgstr "Kanäle:" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:88 +msgid "1 - Mono" +msgstr "1 - Mono" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:88 +msgid "2 - Stereo" +msgstr "2 - Stereo" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:97 +msgid "Server" +msgstr "Server" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:141 +msgid "URL" +msgstr "URL" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:153 +msgid "Name" +msgstr "Name" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:162 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:51 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:53 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:40 +msgid "Description" +msgstr "Beschreibung" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:171 +msgid "Mount Point" +msgstr "Mount Point" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:183 +#: airtime_mvc/application/forms/PasswordRestore.php:25 +#: airtime_mvc/application/views/scripts/user/add-user.phtml:18 +msgid "Username" +msgstr "Benutzername" + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:194 +#: airtime_mvc/application/controllers/LocaleController.php:168 +msgid "Getting information from the server..." +msgstr "Erhalte Information vom Server..." + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:208 +msgid "Server cannot be empty." +msgstr "Server darf nicht leer sein." + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:213 +msgid "Port cannot be empty." +msgstr "Port darf nicht leer sein." + +#: airtime_mvc/application/forms/StreamSettingSubForm.php:219 +msgid "Mount cannot be empty with Icecast server." +msgstr "Mount darf nicht leer sein, wenn Icecast-Server verwendet wird." + +#: airtime_mvc/application/forms/AddShowRepeats.php:11 +msgid "Repeat Type:" +msgstr "Wiederholungstyp:" + +#: airtime_mvc/application/forms/AddShowRepeats.php:14 +msgid "weekly" +msgstr "Wöchentlich" + +#: airtime_mvc/application/forms/AddShowRepeats.php:15 +msgid "bi-weekly" +msgstr "Zweiwöchentlich" + +#: airtime_mvc/application/forms/AddShowRepeats.php:16 +msgid "monthly" +msgstr "Monatlich" + +#: airtime_mvc/application/forms/AddShowRepeats.php:25 +msgid "Select Days:" +msgstr "Tage wählen:" + +#: airtime_mvc/application/forms/AddShowRepeats.php:28 +#: airtime_mvc/application/controllers/LocaleController.php:246 +msgid "Sun" +msgstr "SO" + +#: airtime_mvc/application/forms/AddShowRepeats.php:29 +#: airtime_mvc/application/controllers/LocaleController.php:247 +msgid "Mon" +msgstr "MO" + +#: airtime_mvc/application/forms/AddShowRepeats.php:30 +#: airtime_mvc/application/controllers/LocaleController.php:248 +msgid "Tue" +msgstr "DI" + +#: airtime_mvc/application/forms/AddShowRepeats.php:31 +#: airtime_mvc/application/controllers/LocaleController.php:249 +msgid "Wed" +msgstr "MI" + +#: airtime_mvc/application/forms/AddShowRepeats.php:32 +#: airtime_mvc/application/controllers/LocaleController.php:250 +msgid "Thu" +msgstr "DO" + +#: airtime_mvc/application/forms/AddShowRepeats.php:33 +#: airtime_mvc/application/controllers/LocaleController.php:251 +msgid "Fri" +msgstr "FR" + +#: airtime_mvc/application/forms/AddShowRepeats.php:34 +#: airtime_mvc/application/controllers/LocaleController.php:252 +msgid "Sat" +msgstr "SA" + +#: airtime_mvc/application/forms/AddShowRepeats.php:53 +msgid "No End?" +msgstr "Kein Enddatum?" + +#: airtime_mvc/application/forms/AddShowRepeats.php:79 +msgid "End date must be after start date" +msgstr "Enddatum muß nach Startdatum liegen." + +#: airtime_mvc/application/forms/AddShowWhat.php:26 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:27 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:127 +msgid "Name:" +msgstr "Name:" + +#: airtime_mvc/application/forms/AddShowWhat.php:30 +msgid "Untitled Show" +msgstr "Unbenannte Sendung" + +#: airtime_mvc/application/forms/AddShowWhat.php:36 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:131 +msgid "URL:" +msgstr "URL:" + +#: airtime_mvc/application/forms/AddShowWhat.php:45 +#: airtime_mvc/application/forms/EditAudioMD.php:41 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:11 +msgid "Genre:" +msgstr "Genre:" + +#: airtime_mvc/application/forms/AddShowWhat.php:54 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:34 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:130 +msgid "Description:" +msgstr "Beschreibung:" + +#: airtime_mvc/application/forms/AddShowWho.php:10 +msgid "Search Users:" +msgstr "Suche Benutzer:" + +#: airtime_mvc/application/forms/AddShowWho.php:24 +msgid "DJs:" +msgstr "DJs:" + +#: airtime_mvc/application/forms/StreamSetting.php:22 +msgid "Hardware Audio Output" +msgstr "Hardware Audioausgabe" + +#: airtime_mvc/application/forms/StreamSetting.php:33 +msgid "Output Type" +msgstr "Ausgabetyp" + +#: airtime_mvc/application/forms/StreamSetting.php:44 +msgid "Icecast Vorbis Metadata" +msgstr "Icecast Vorbis Metadata" + +#: airtime_mvc/application/forms/StreamSetting.php:54 +msgid "Stream Label:" +msgstr "Streambezeichnung:" + +#: airtime_mvc/application/forms/StreamSetting.php:55 +msgid "Artist - Title" +msgstr "Artist - Titel" + +#: airtime_mvc/application/forms/StreamSetting.php:56 +msgid "Show - Artist - Title" +msgstr "Sendung - Artist - Titel" + +#: airtime_mvc/application/forms/StreamSetting.php:57 +msgid "Station name - Show name" +msgstr "Radiostation - Sendungsname" + +#: airtime_mvc/application/forms/PasswordRestore.php:14 +msgid "E-mail" +msgstr "E-Mail" + +#: airtime_mvc/application/forms/PasswordRestore.php:36 +msgid "Restore password" +msgstr "Passwort wiederherstellen" + +#: airtime_mvc/application/forms/PasswordRestore.php:46 +#: airtime_mvc/application/forms/EditAudioMD.php:138 +#: airtime_mvc/application/controllers/LocaleController.php:303 +msgid "Cancel" +msgstr "Abbrechen" + +#: airtime_mvc/application/forms/AddShowWhen.php:16 +msgid "'%value%' does not fit the time format 'HH:mm'" +msgstr "'%value%' ist nicht im Format 'HH:mm'" + +#: airtime_mvc/application/forms/AddShowWhen.php:22 +msgid "Date/Time Start:" +msgstr "Datum/Zeit Start:" + +#: airtime_mvc/application/forms/AddShowWhen.php:49 +msgid "Date/Time End:" +msgstr "Datum/Zeit Ende:" + +#: airtime_mvc/application/forms/AddShowWhen.php:74 +msgid "Duration:" +msgstr "Dauer:" + +#: airtime_mvc/application/forms/AddShowWhen.php:83 +msgid "Repeats?" +msgstr "Wiederholungen?" + +#: airtime_mvc/application/forms/AddShowWhen.php:103 +msgid "Cannot create show in the past" +msgstr "Eine Sendung kann nicht für einen bereits vergangenen Zeitpunkt geplant werden" + +#: airtime_mvc/application/forms/AddShowWhen.php:111 +msgid "Cannot modify start date/time of the show that is already started" +msgstr "Beginn- & Endzeit einer bereits laufenden Sendung können nicht geändert werden" + +#: airtime_mvc/application/forms/AddShowWhen.php:130 +msgid "Cannot have duration 00h 00m" +msgstr "Die Dauer einer Sendung kann nicht 00h 00m sein" + +#: airtime_mvc/application/forms/AddShowWhen.php:134 +msgid "Cannot have duration greater than 24h" +msgstr "Die Dauer einer Sendung kann nicht länger als 24h sein" + +#: airtime_mvc/application/forms/AddShowWhen.php:138 +msgid "Cannot have duration < 0m" +msgstr "Die Dauer einer Sendung kann nicht kürzer als 0 Minuten sein." + +#: airtime_mvc/application/forms/EditAudioMD.php:13 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:3 +msgid "Title:" +msgstr "Titel" + +#: airtime_mvc/application/forms/EditAudioMD.php:20 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:4 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:28 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:129 +msgid "Creator:" +msgstr "Interpret:" + +#: airtime_mvc/application/forms/EditAudioMD.php:27 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:5 +msgid "Album:" +msgstr "Album:" + +#: airtime_mvc/application/forms/EditAudioMD.php:34 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:6 +msgid "Track:" +msgstr "Titelnummer:" + +#: airtime_mvc/application/forms/EditAudioMD.php:48 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:12 +msgid "Year:" +msgstr "Jahr:" + +#: airtime_mvc/application/forms/EditAudioMD.php:60 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:13 +msgid "Label:" +msgstr "Label:" + +#: airtime_mvc/application/forms/EditAudioMD.php:67 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:15 +msgid "Composer:" +msgstr "Komponist:" + +#: airtime_mvc/application/forms/EditAudioMD.php:74 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:16 +msgid "Conductor:" +msgstr "Dirigent:" + +#: airtime_mvc/application/forms/EditAudioMD.php:81 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:10 +msgid "Mood:" +msgstr "Stimmung:" + +#: airtime_mvc/application/forms/EditAudioMD.php:89 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:14 +msgid "BPM:" +msgstr "BPM:" + +#: airtime_mvc/application/forms/EditAudioMD.php:98 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:17 +msgid "Copyright:" +msgstr "Copyright:" + +#: airtime_mvc/application/forms/EditAudioMD.php:105 +msgid "ISRC Number:" +msgstr "ISRC Nummer:" + +#: airtime_mvc/application/forms/EditAudioMD.php:112 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:19 +msgid "Website:" +msgstr "Webseite:" + +#: airtime_mvc/application/forms/EditAudioMD.php:119 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:20 +msgid "Language:" +msgstr "Sprache:" + +#: airtime_mvc/application/forms/Login.php:59 +#: airtime_mvc/application/views/scripts/login/index.phtml:3 +msgid "Login" +msgstr "Anmeldung" + +#: airtime_mvc/application/forms/Login.php:77 +msgid "Type the characters you see in the picture below." +msgstr "Geben sie die Zeichen ein, die im darunter liegenden Bild zu sehen sind." + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:78 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:94 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:214 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:329 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:367 +#: airtime_mvc/application/controllers/LocaleController.php:139 +msgid "Select modifier" +msgstr "Wähle Modifikator" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:79 +#: airtime_mvc/application/controllers/LocaleController.php:140 +msgid "contains" +msgstr "enthält" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:80 +#: airtime_mvc/application/controllers/LocaleController.php:141 +msgid "does not contain" +msgstr "enthält nicht" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:81 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:95 +#: airtime_mvc/application/controllers/LocaleController.php:142 +msgid "is" +msgstr "ist" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:82 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:96 +#: airtime_mvc/application/controllers/LocaleController.php:143 +msgid "is not" +msgstr "ist nicht" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:83 +#: airtime_mvc/application/controllers/LocaleController.php:144 +msgid "starts with" +msgstr "beginnt mit" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:84 +#: airtime_mvc/application/controllers/LocaleController.php:145 +msgid "ends with" +msgstr "endet mit" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:97 +#: airtime_mvc/application/controllers/LocaleController.php:146 +msgid "is greater than" +msgstr "ist größer als" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:98 +#: airtime_mvc/application/controllers/LocaleController.php:147 +msgid "is less than" +msgstr "ist kleiner als" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:99 +#: airtime_mvc/application/controllers/LocaleController.php:148 +msgid "is in the range" +msgstr "ist im Bereich" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:109 +msgid "hours" +msgstr "Stunden" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:110 +msgid "minutes" +msgstr "Minuten" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:111 +msgid "items" +msgstr "Objekte" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:133 +msgid "Set smart block type:" +msgstr "Bestimme Smart Block Typ:" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:136 +#: airtime_mvc/application/controllers/LibraryController.php:459 +msgid "Static" +msgstr "Statisch" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:137 +#: airtime_mvc/application/controllers/LibraryController.php:462 +msgid "Dynamic" +msgstr "Dynamisch" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:248 +msgid "Allow Repeat Tracks:" +msgstr "Erlaube Wiederholen von Titeln:" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:265 +msgid "Limit to" +msgstr "Beschränkt auf " + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:287 +msgid "Generate playlist content and save criteria" +msgstr "Playlist-Inhalt erstellen und Kriterien speichern" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:289 +msgid "Generate" +msgstr "Erstellen" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:295 +msgid "Shuffle playlist content" +msgstr "Shuffle Playlist-Inhalt (Durchmischen)" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:297 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:20 +msgid "Shuffle" +msgstr "Shuffle" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:461 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:473 +msgid "Limit cannot be empty or smaller than 0" +msgstr "Beschränkung kann nicht leer oder kleiner als 0 sein." + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:466 +msgid "Limit cannot be more than 24 hrs" +msgstr "Beschränkung kann nicht größer als 24 Stunden sein" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:476 +msgid "The value should be an integer" +msgstr "Der Wert muß eine ganze Zahl sein." + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:479 +msgid "500 is the max item limit value you can set" +msgstr "Die Anzahl der Objekte ist auf 500 beschränkt." + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:490 +msgid "You must select Criteria and Modifier" +msgstr "Sie müssen Kriterium und Modifikator bestimmen" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:497 +msgid "'Length' should be in '00:00:00' format" +msgstr "Die 'Dauer' muß im Format '00:00:00' eingegeben werden" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:502 +#: airtime_mvc/application/forms/SmartBlockCriteria.php:515 +msgid "The value should be in timestamp format(eg. 0000-00-00 or 00-00-00 00:00:00)" +msgstr "Der Wert muß im Timestamp-Format eingegeben werden (zB. 0000-00-00 oder 00-00-00 00:00:00)" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:529 +msgid "The value has to be numeric" +msgstr "Der eingegebene Wert muß aus Ziffern bestehen" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:534 +msgid "The value should be less then 2147483648" +msgstr "Der eingegebene Wert muß kleiner sein als 2147483648" + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:539 +#, php-format +msgid "The value should be less than %s characters" +msgstr "Der eingegebene Wert muß aus weniger als %s Zeichen bestehen." + +#: airtime_mvc/application/forms/SmartBlockCriteria.php:546 +msgid "Value cannot be empty" +msgstr "Wert kann nicht leer sein" + +#: airtime_mvc/application/forms/ShowBuilder.php:72 +msgid "Show:" +msgstr "Sendung:" + +#: airtime_mvc/application/forms/ShowBuilder.php:80 +msgid "All My Shows:" +msgstr "Alle meine Sendungen:" + +#: airtime_mvc/application/forms/AddShowLiveStream.php:10 +msgid "Use Airtime Authentication:" +msgstr "Verwende Airtime Authentifizierung:" + +#: airtime_mvc/application/forms/AddShowLiveStream.php:16 +msgid "Use Custom Authentication:" +msgstr "Verwende benutzerdefinierte Authentifizierung:" + +#: airtime_mvc/application/forms/AddShowLiveStream.php:26 +msgid "Custom Username" +msgstr "Benutzerdefinierter Benutzername" + +#: airtime_mvc/application/forms/AddShowLiveStream.php:39 +msgid "Custom Password" +msgstr "Benutzerdefiniertes Passwort" + +#: airtime_mvc/application/forms/AddShowLiveStream.php:63 +msgid "Username field cannot be empty." +msgstr "Das Feld Benutzername darf nicht leer sein." + +#: airtime_mvc/application/forms/AddShowLiveStream.php:68 +msgid "Password field cannot be empty." +msgstr "Das Feld Passwort darf nicht leer sein." + +#: airtime_mvc/application/forms/GeneralPreferences.php:34 +msgid "Default Fade (s):" +msgstr "Standard-Fade (s):" + +#: airtime_mvc/application/forms/GeneralPreferences.php:39 +msgid "enter a time in seconds 0{.0}" +msgstr "Geben sie eine Zeit in Sekunden ein 0{.0}" + +#: airtime_mvc/application/forms/GeneralPreferences.php:48 +#, php-format +msgid "Allow Remote Websites To Access \"Schedule\" Info?%s (Enable this to make front-end widgets work.)" +msgstr "Erlaube Remote-Webseiten Zugriff auf \"Kalender\" Info?%s (Aktivierung ermöglicht die Verwendung von Front-End Widgets.)" + +#: airtime_mvc/application/forms/GeneralPreferences.php:49 +msgid "Disabled" +msgstr "Deaktiviert" + +#: airtime_mvc/application/forms/GeneralPreferences.php:50 +msgid "Enabled" +msgstr "Aktiviert" + +#: airtime_mvc/application/forms/GeneralPreferences.php:64 +msgid "Timezone" +msgstr "Zeitzone" + +#: airtime_mvc/application/forms/GeneralPreferences.php:72 +msgid "Week Starts On" +msgstr "Woche startet mit " + +#: airtime_mvc/application/forms/GeneralPreferences.php:109 +#: airtime_mvc/application/controllers/LocaleController.php:239 +msgid "Sunday" +msgstr "Sonntag" + +#: airtime_mvc/application/forms/GeneralPreferences.php:110 +#: airtime_mvc/application/controllers/LocaleController.php:240 +msgid "Monday" +msgstr "Montag" + +#: airtime_mvc/application/forms/GeneralPreferences.php:111 +#: airtime_mvc/application/controllers/LocaleController.php:241 +msgid "Tuesday" +msgstr "Dienstag" + +#: airtime_mvc/application/forms/GeneralPreferences.php:112 +#: airtime_mvc/application/controllers/LocaleController.php:242 +msgid "Wednesday" +msgstr "Mittwoch" + +#: airtime_mvc/application/forms/GeneralPreferences.php:113 +#: airtime_mvc/application/controllers/LocaleController.php:243 +msgid "Thursday" +msgstr "Donnerstag" + +#: airtime_mvc/application/forms/GeneralPreferences.php:114 +#: airtime_mvc/application/controllers/LocaleController.php:244 +msgid "Friday" +msgstr "Freitag" + +#: airtime_mvc/application/forms/GeneralPreferences.php:115 +#: airtime_mvc/application/controllers/LocaleController.php:245 +msgid "Saturday" +msgstr "Samstag" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:16 +msgid "Automatically Upload Recorded Shows" +msgstr "Automatisches Hochladen aufgezeichneter Sendungen" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:26 +msgid "Enable SoundCloud Upload" +msgstr "Aktiviere SoundCloud Upload" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:36 +msgid "Automatically Mark Files \"Downloadable\" on SoundCloud" +msgstr "Markiere Dateien auf SoundCloud automatisch als \"herunterladbar\"" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:47 +msgid "SoundCloud Email" +msgstr "SoundCloud E-Mail" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:67 +msgid "SoundCloud Password" +msgstr "SoundCloud Passwort" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:87 +msgid "SoundCloud Tags: (separate tags with spaces)" +msgstr "SoundCloud Tags: (mehrere Tags durch Leertaste trennen)" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:99 +msgid "Default Genre:" +msgstr "Standard Genre:" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:109 +msgid "Default Track Type:" +msgstr "Standard Titel Typ:" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:113 +msgid "Original" +msgstr "Original" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:114 +msgid "Remix" +msgstr "Remix" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:115 +msgid "Live" +msgstr "Live" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:116 +msgid "Recording" +msgstr "Aufzeichnung" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:117 +msgid "Spoken" +msgstr "Talk" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:118 +msgid "Podcast" +msgstr "Podcast" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:119 +msgid "Demo" +msgstr "Demo" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:120 +msgid "Work in progress" +msgstr "In Bearbeitung" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:121 +msgid "Stem" +msgstr "Eindämmen" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:122 +msgid "Loop" +msgstr "Loop" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:123 +msgid "Sound Effect" +msgstr "Sound Effekt" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:124 +msgid "One Shot Sample" +msgstr "One-Shot-Sample" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:125 +msgid "Other" +msgstr "Sonstige" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:133 +msgid "Default License:" +msgstr "Standard Lizenz:" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:137 +msgid "The work is in the public domain" +msgstr "Das Werk ist in der öffentlichen Domäne" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:138 +msgid "All rights are reserved" +msgstr "Alle Rechte vorbehalten" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:139 +msgid "Creative Commons Attribution" +msgstr "Creative Commons Zuordnung" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:140 +msgid "Creative Commons Attribution Noncommercial" +msgstr "Creative Commons Zuordnung Noncommercial" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:141 +msgid "Creative Commons Attribution No Derivative Works" +msgstr "Creative Commons Zuordnung No Derivative Works" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:142 +msgid "Creative Commons Attribution Share Alike" +msgstr "Creative Commons Zuordnung Share Alike" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:143 +msgid "Creative Commons Attribution Noncommercial Non Derivate Works" +msgstr "Creative Commons Zuordnung Noncommercial Non Derivate Works" + +#: airtime_mvc/application/forms/SoundcloudPreferences.php:144 +msgid "Creative Commons Attribution Noncommercial Share Alike" +msgstr "Creative Commons Zuordnung Noncommercial Share Alike" + +#: airtime_mvc/application/controllers/DashboardController.php:36 +#: airtime_mvc/application/controllers/DashboardController.php:85 +msgid "You don't have permission to disconnect source." +msgstr "Sie haben nicht die erforderliche Berechtigung die Quelle zu trennen." + +#: airtime_mvc/application/controllers/DashboardController.php:38 +#: airtime_mvc/application/controllers/DashboardController.php:87 +msgid "There is no source connected to this input." +msgstr "Mit diesem Eingang ist keine Quelle verbunden." + +#: airtime_mvc/application/controllers/DashboardController.php:82 +msgid "You don't have permission to switch source." +msgstr "Sie haben nicht die erforderliche Berechtigung die Quelle zu wechseln." + +#: airtime_mvc/application/controllers/LoginController.php:34 +msgid "Please enter your user name and password" +msgstr "Bitte geben sie Benutzername und Passwort ein" + +#: airtime_mvc/application/controllers/LoginController.php:73 +msgid "Wrong username or password provided. Please try again." +msgstr "Falscher Benutzername oder falsches Passwort eingegeben. Bitte versuchen sie es erneut." + +#: airtime_mvc/application/controllers/LoginController.php:135 +msgid "Email could not be sent. Check your mail server settings and ensure it has been configured properly." +msgstr "E-Mail konnte nicht gesendet werden. Überprüfen sie die Einstellungen des Mail-Servers und versichern sie sich, daß dieser richtig konfiguriert ist." + +#: airtime_mvc/application/controllers/LoginController.php:138 +msgid "Given email not found." +msgstr "Vorgegebene E-Mail-Adresse konnte nicht gefunden werden." + +#: airtime_mvc/application/controllers/PreferenceController.php:70 +msgid "Preferences updated." +msgstr "Einstellungen aktualisiert" + +#: airtime_mvc/application/controllers/PreferenceController.php:122 +msgid "Support setting updated." +msgstr "Support-Einstellungen aktualisiert." + +#: airtime_mvc/application/controllers/PreferenceController.php:305 +msgid "Stream Setting Updated." +msgstr "Stream-Einstellungen aktualisiert." + +#: airtime_mvc/application/controllers/PreferenceController.php:332 +msgid "path should be specified" +msgstr "Pfad muß angegeben werden" + +#: airtime_mvc/application/controllers/PreferenceController.php:427 +msgid "Problem with Liquidsoap..." +msgstr "Problem mit Liquidsoap..." + +#: airtime_mvc/application/controllers/ErrorController.php:17 +msgid "Page not found" +msgstr "Seite nicht gefunden" + +#: airtime_mvc/application/controllers/ErrorController.php:22 +msgid "Application error" +msgstr "Anwendungsfehler" + +#: airtime_mvc/application/controllers/UserController.php:54 +msgid "Specific action is not allowed in demo version!" +msgstr "Gewählte Funktion wird in der Demo Version nicht zugelassen." + +#: airtime_mvc/application/controllers/UserController.php:78 +msgid "User added successfully!" +msgstr "Benutzer erfolgreich hinzugefügt!" + +#: airtime_mvc/application/controllers/UserController.php:80 +msgid "User updated successfully!" +msgstr "Benutzer erfolgreich aktualisiert!" + +#: airtime_mvc/application/controllers/LocaleController.php:36 +msgid "Recording:" +msgstr "Aufzeichnung:" + +#: airtime_mvc/application/controllers/LocaleController.php:37 +msgid "Master Stream" +msgstr "Master Stream" + +#: airtime_mvc/application/controllers/LocaleController.php:38 +msgid "Live Stream" +msgstr "Live Stream" + +#: airtime_mvc/application/controllers/LocaleController.php:39 +msgid "Nothing Scheduled" +msgstr "Nichts geplant" + +#: airtime_mvc/application/controllers/LocaleController.php:40 +msgid "Current Show:" +msgstr "Aktuelle Sendung:" + +#: airtime_mvc/application/controllers/LocaleController.php:41 +msgid "Current" +msgstr "Aktuell" + +#: airtime_mvc/application/controllers/LocaleController.php:43 +msgid "You are running the latest version" +msgstr "Sie betreiben die aktuellste Version" + +#: airtime_mvc/application/controllers/LocaleController.php:44 +msgid "New version available: " +msgstr "Neue Version verfügbar:" + +#: airtime_mvc/application/controllers/LocaleController.php:45 +msgid "This version will soon be obsolete." +msgstr "Diese Version wird in Kürze veraltet sein." + +#: airtime_mvc/application/controllers/LocaleController.php:46 +msgid "This version is no longer supported." +msgstr "Diese Version wird technisch nicht mehr unterstützt." + +#: airtime_mvc/application/controllers/LocaleController.php:47 +msgid "Please upgrade to " +msgstr "Bitte aktualisieren sie auf " + +#: airtime_mvc/application/controllers/LocaleController.php:49 +msgid "Add to current playlist" +msgstr "Zu aktueller Playlist hinzufügen" + +#: airtime_mvc/application/controllers/LocaleController.php:50 +msgid "Add to current smart block" +msgstr "Zu aktuellem Smart Block hinzufügen" + +#: airtime_mvc/application/controllers/LocaleController.php:51 +msgid "Adding 1 Item" +msgstr "Füge 1 Objekt hinzu" + +#: airtime_mvc/application/controllers/LocaleController.php:52 +#, php-format +msgid "Adding %s Items" +msgstr "Füge %s Objekte hinzu" + +#: airtime_mvc/application/controllers/LocaleController.php:53 +msgid "You can only add tracks to smart blocks." +msgstr "Sie können einem Smart Block nur Titel hinzufügen (keine Playlist oa.)" + +#: airtime_mvc/application/controllers/LocaleController.php:54 +#: airtime_mvc/application/controllers/PlaylistController.php:160 +msgid "You can only add tracks, smart blocks, and webstreams to playlists." +msgstr "Sie können einer Playlist nur Titel, Smart Blocks und Webstreams hinzufügen." + +#: airtime_mvc/application/controllers/LocaleController.php:60 +msgid "Add to selected show" +msgstr "Zu gewählter Sendung hinzufügen" + +#: airtime_mvc/application/controllers/LocaleController.php:61 +msgid "Select" +msgstr "Wählen" + +#: airtime_mvc/application/controllers/LocaleController.php:62 +msgid "Select this page" +msgstr "Wählen sie diese Seite" + +#: airtime_mvc/application/controllers/LocaleController.php:63 +msgid "Deselect this page" +msgstr "Wählen sie diese Seite ab" + +#: airtime_mvc/application/controllers/LocaleController.php:64 +msgid "Deselect all" +msgstr "Alle Abwählen" + +#: airtime_mvc/application/controllers/LocaleController.php:65 +msgid "Are you sure you want to delete the selected item(s)?" +msgstr "Wollen sie die gewählten Objekte wirklich löschen?" + +#: airtime_mvc/application/controllers/LocaleController.php:69 +msgid "Bit Rate" +msgstr "Bitrate" + +#: airtime_mvc/application/controllers/LocaleController.php:86 +msgid "Sample Rate" +msgstr "Samplerate" + +#: airtime_mvc/application/controllers/LocaleController.php:91 +msgid "Loading..." +msgstr "wird geladen..." + +#: airtime_mvc/application/controllers/LocaleController.php:92 +#: airtime_mvc/application/controllers/LocaleController.php:156 +msgid "All" +msgstr "Alle" + +#: airtime_mvc/application/controllers/LocaleController.php:93 +msgid "Files" +msgstr "Dateien" + +#: airtime_mvc/application/controllers/LocaleController.php:94 +msgid "Playlists" +msgstr "Playlisten" + +#: airtime_mvc/application/controllers/LocaleController.php:95 +msgid "Smart Blocks" +msgstr "Smart Blöcke" + +#: airtime_mvc/application/controllers/LocaleController.php:96 +msgid "Web Streams" +msgstr "Web Streams" + +#: airtime_mvc/application/controllers/LocaleController.php:97 +msgid "Unknown type: " +msgstr "Unbekannter Typ:" + +#: airtime_mvc/application/controllers/LocaleController.php:98 +msgid "Are you sure you want to delete the selected item?" +msgstr "Wollen sie das gewählte Objekt wirklich löschen?" + +#: airtime_mvc/application/controllers/LocaleController.php:99 +#: airtime_mvc/application/controllers/LocaleController.php:200 +msgid "Uploading in progress..." +msgstr "Hochladen wird durchgeführt..." + +#: airtime_mvc/application/controllers/LocaleController.php:100 +msgid "Retrieving data from the server..." +msgstr "Daten werden vom Server abgerufen..." + +#: airtime_mvc/application/controllers/LocaleController.php:101 +msgid "The soundcloud id for this file is: " +msgstr "Die SoundCloud ID für diese Datei ist:" + +#: airtime_mvc/application/controllers/LocaleController.php:102 +msgid "There was an error while uploading to soundcloud." +msgstr "Während dem Hochladen auf SoundCloud ist ein Fehler aufgetreten." + +#: airtime_mvc/application/controllers/LocaleController.php:103 +msgid "Error code: " +msgstr "Fehler Code:" + +#: airtime_mvc/application/controllers/LocaleController.php:104 +msgid "Error msg: " +msgstr "Fehlermeldung:" + +#: airtime_mvc/application/controllers/LocaleController.php:105 +msgid "Input must be a positive number" +msgstr "Der eingegeben Wert muß eine positive Zahl sein" + +#: airtime_mvc/application/controllers/LocaleController.php:106 +msgid "Input must be a number" +msgstr "Der eingegebene Wert muß eine Zahl sein" + +#: airtime_mvc/application/controllers/LocaleController.php:107 +msgid "Input must be in the format: yyyy-mm-dd" +msgstr "Der Wert muß in folgendem Format eingegeben werden: yyyy-mm-dd" + +#: airtime_mvc/application/controllers/LocaleController.php:108 +msgid "Input must be in the format: hh:mm:ss.t" +msgstr "Der Wert muß in folgendem Format eingegeben werden: hh:mm:ss.t" + +#: airtime_mvc/application/controllers/LocaleController.php:111 +#, php-format +msgid "You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?" +msgstr "Sie laden im Augenblich Datein hoch. %sDas Wechseln der Seite würde diesen Prozess abbrechen. %sSind sie sicher, daß sie die Seite verlassen möchten?" + +#: airtime_mvc/application/controllers/LocaleController.php:113 +msgid "please put in a time '00:00:00 (.0)'" +msgstr "Bitte geben sie eine Zeit an '00:00:00 (.0)'" + +#: airtime_mvc/application/controllers/LocaleController.php:114 +msgid "please put in a time in seconds '00 (.0)'" +msgstr "Bitte geben sie eine Zeit in Sekunden ein '00 (.0)'" + +#: airtime_mvc/application/controllers/LocaleController.php:115 +msgid "Your browser does not support playing this file type: " +msgstr "Das Abspielen des folgenden Dateityps wird von ihrem Browser nicht unterstützt:" + +#: airtime_mvc/application/controllers/LocaleController.php:116 +msgid "Dynamic block is not previewable" +msgstr "Bei einem Dynamischen Block ist keine Vorschau möglich" + +#: airtime_mvc/application/controllers/LocaleController.php:117 +msgid "Limit to: " +msgstr "Beschränkung auf:" + +#: airtime_mvc/application/controllers/LocaleController.php:118 +msgid "Playlist saved" +msgstr "Playlist gespeichert" + +#: airtime_mvc/application/controllers/LocaleController.php:120 +msgid "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore." +msgstr "" +"Airtime kann den Status dieser Datei nicht bestimmen.\n" +"Das kann passieren, wenn die Datei auf einem nicht erreichbaren Netzlaufwerk liegt oder in einem Verzeichnis liegt, das nicht mehr überwacht wird." + +#: airtime_mvc/application/controllers/LocaleController.php:122 +#, php-format +msgid "Listener Count on %s: %s" +msgstr "Hörerzahl %s: %s" + +#: airtime_mvc/application/controllers/LocaleController.php:124 +msgid "Remind me in 1 week" +msgstr "In einer Woche erinnern" + +#: airtime_mvc/application/controllers/LocaleController.php:125 +msgid "Remind me never" +msgstr "Niemals erinnern" + +#: airtime_mvc/application/controllers/LocaleController.php:126 +msgid "Yes, help Airtime" +msgstr "Ja, Airtime helfen" + +#: airtime_mvc/application/controllers/LocaleController.php:127 +#: airtime_mvc/application/controllers/LocaleController.php:182 +msgid "Image must be one of jpg, jpeg, png, or gif" +msgstr "Ein Bild muß jpg, jpeg, png, oder gif sein." + +#: airtime_mvc/application/controllers/LocaleController.php:130 +msgid "A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show." +msgstr "" +"Ein Statischer Smart Block speichert die Kriterien und erstellt den Block sofort.\n" +"Dadurch kann der Inhalt eingesehen und verändert werden bevor der Smart Block einer Sendung hinzugefügt wird." + +#: airtime_mvc/application/controllers/LocaleController.php:132 +msgid "A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library." +msgstr "" +"Ein Dynamischer Smart Block speichert nur die Kriterien.\n" +"Dabei wird der Inhalt erst erstellt, wenn der Smart Block einer Sendung hinzugefügt wird. Der Inhalt des Smart Blocks kann in der Sammlung nicht eingesehen oder editiert werden." + +#: airtime_mvc/application/controllers/LocaleController.php:134 +msgid "The desired block length will not be reached if Airtime cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block." +msgstr "" +"Wenn Airtime nicht genug einzigartige Titel findet, kann die gewünschte Dauer des Smart Blocks nicht erreicht werden.\n" +"Aktivieren sie diese Option um das mehrfache Hinzufügen von Titel zum Smart Block zu erlauben." + +#: airtime_mvc/application/controllers/LocaleController.php:135 +msgid "Smart block shuffled" +msgstr "Smart Block durchgemischt" + +#: airtime_mvc/application/controllers/LocaleController.php:136 +msgid "Smart block generated and criteria saved" +msgstr "Smart Block erstellt und Kriterien gespeichert" + +#: airtime_mvc/application/controllers/LocaleController.php:137 +msgid "Smart block saved" +msgstr "Smart Block gespeichert" + +#: airtime_mvc/application/controllers/LocaleController.php:138 +msgid "Processing..." +msgstr "In Bearbeitung..." + +#: airtime_mvc/application/controllers/LocaleController.php:152 +msgid "Played" +msgstr "Abgespielt" + +#: airtime_mvc/application/controllers/LocaleController.php:158 +msgid "Choose Storage Folder" +msgstr "Wähle Storage-Verzeichnis" + +#: airtime_mvc/application/controllers/LocaleController.php:159 +msgid "Choose Folder to Watch" +msgstr "Wähle zu überwachendes Verzeichnis" + +#: airtime_mvc/application/controllers/LocaleController.php:161 +msgid "" +"Are you sure you want to change the storage folder?\n" +"This will remove the files from your Airtime library!" +msgstr "" +"Wollen sie wirklich das Storage-Verzeichnis ändern?\n" +"Dieser Vorgang entfernt alle Dateien der Airtime-Sammlung!" + +#: airtime_mvc/application/controllers/LocaleController.php:162 +#: airtime_mvc/application/views/scripts/preference/directory-config.phtml:2 +msgid "Manage Media Folders" +msgstr "Verwalte Medienverzeichnisse" + +#: airtime_mvc/application/controllers/LocaleController.php:163 +msgid "Are you sure you want to remove the watched folder?" +msgstr "Wollen sie den überwachten Ordner wirklich entfernen?" + +#: airtime_mvc/application/controllers/LocaleController.php:164 +msgid "This path is currently not accessible." +msgstr "Dieser Pfad ist derzeit nicht erreichbar." + +#: airtime_mvc/application/controllers/LocaleController.php:166 +msgid "Connected to the streaming server" +msgstr "Mit Streaming-Server verbunden" + +#: airtime_mvc/application/controllers/LocaleController.php:167 +msgid "The stream is disabled" +msgstr "Der Stream ist deaktiviert" + +#: airtime_mvc/application/controllers/LocaleController.php:169 +msgid "Can not connect to the streaming server" +msgstr "Verbindung mit Streaming-Server kann nicht hergestellt werden." + +#: airtime_mvc/application/controllers/LocaleController.php:171 +msgid "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151." +msgstr "" +"Falls sich Airtime hinter einem Router oder einer Firewall befindet, müssen sie gegebenenfalls eine Portweiterleitung konfigurieren. \n" +"Der Wert sollte so geändert werden, daß host/port/mount den Zugangsdaten der DJ's entspricht. Der erlaubte Bereich liegt zwischen 1024 und 49151." + +#: airtime_mvc/application/controllers/LocaleController.php:172 +#, php-format +msgid "For more details, please read the %sAirtime Manual%s" +msgstr "Für weitere Information lesen sie bitte das %sAirtime Benutzerhandbuch%s" + +#: airtime_mvc/application/controllers/LocaleController.php:174 +msgid "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option." +msgstr "" +"Diese Option aktiviert Metadaten für Ogg-Streams.\n" +"(Stream-Metadaten wie Titel, Interpret und Sendungsname können von Audioplayern angezeigt werden.)\n" +"VLC und mplayer haben ernsthafte Probleme beim Abspielen von Ogg/Vorbis-Streams mit aktivierten Metadaten: Beide Anwendungen werden die Verbindung zum Stream nach jedem Titel verlieren. Sollten sie einen Ogg-Stream verwenden und ihre Hörer erwarten keinen Support für diese Audioplayer, können sie diese Option gerne aktivieren." + +#: airtime_mvc/application/controllers/LocaleController.php:175 +msgid "Check this box to automatically switch off Master/Show source upon source disconnection." +msgstr "Aktivieren sie dieses Kästchen, um die Master-/Show-Quelle bei Unterbrechung der Leitung automatisch abzuschalten." + +#: airtime_mvc/application/controllers/LocaleController.php:176 +msgid "Check this box to automatically switch on Master/Show source upon source connection." +msgstr "Aktivieren sie dieses Kästchen, um die Master-/Show-Quelle bei Herstellung einer Leitung automatisch anzuschalten." + +#: airtime_mvc/application/controllers/LocaleController.php:177 +msgid "If your Icecast server expects a username of 'source', this field can be left blank." +msgstr "Falls der Icecast-Server den Benutzernamen 'source' erwartet, kann dieses Feld leer gelassen werden." + +#: airtime_mvc/application/controllers/LocaleController.php:178 +#: airtime_mvc/application/controllers/LocaleController.php:187 +msgid "If your live streaming client does not ask for a username, this field should be 'source'." +msgstr "Falls der Live-Streaming-Client keinen Benutzernamen verlangt, sollte in dieses Feld 'source' eingetragen werden." + +#: airtime_mvc/application/controllers/LocaleController.php:180 +msgid "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted." +msgstr "" +"Wenn sie Benutzername oder Passwort eines aktivierten Streams ändern, wird das Playout-System neu gestartet und die Hörer werden für 5-10 Sekunden Stille hören.\n" +"Das Wechseln folgender Werte erfordert KEINEN Neustart: Stream Label (Globale Einstellungen), Master Übergang beim Umschalten (Fade in Sekunden), Master Username und Master Passwort (Input Stream Einstellungen). Falls Airtime während eines Neustart des Dienstes eine Sendung aufzeichnet, wird die Aufzeichnung unterbrochen." + +#: airtime_mvc/application/controllers/LocaleController.php:184 +msgid "No result found" +msgstr "Kein Ergebnis gefunden" + +#: airtime_mvc/application/controllers/LocaleController.php:185 +msgid "This follows the same security pattern for the shows: only users assigned to the show can connect." +msgstr "Diese Einstellung folgt den Sicherheitsvorlagen für Shows: Nur Benutzer denen diese Sendung zugeteilt wurde, können sich verbinden." + +#: airtime_mvc/application/controllers/LocaleController.php:186 +msgid "Specify custom authentication which will work only for this show." +msgstr "Bestimmen einer benutzerdefinierten Authentifizierung, welche nur für diese Sendung funktionieren wird." + +#: airtime_mvc/application/controllers/LocaleController.php:188 +msgid "The show instance doesn't exist anymore!" +msgstr "Die Sendungsinstanz existiert nicht mehr!" + +#: airtime_mvc/application/controllers/LocaleController.php:192 +msgid "Show" +msgstr "Sendung" + +#: airtime_mvc/application/controllers/LocaleController.php:193 +msgid "Show is empty" +msgstr "Sendung ist leer" + +#: airtime_mvc/application/controllers/LocaleController.php:194 +msgid "1m" +msgstr "1m" + +#: airtime_mvc/application/controllers/LocaleController.php:195 +msgid "5m" +msgstr "5m" + +#: airtime_mvc/application/controllers/LocaleController.php:196 +msgid "10m" +msgstr "10m" + +#: airtime_mvc/application/controllers/LocaleController.php:197 +msgid "15m" +msgstr "15m" + +#: airtime_mvc/application/controllers/LocaleController.php:198 +msgid "30m" +msgstr "30m" + +#: airtime_mvc/application/controllers/LocaleController.php:199 +msgid "60m" +msgstr "60m" + +#: airtime_mvc/application/controllers/LocaleController.php:201 +msgid "Retreiving data from the server..." +msgstr "Daten werden vom Server abgerufen..." + +#: airtime_mvc/application/controllers/LocaleController.php:207 +msgid "This show has no scheduled content." +msgstr "Diese Sendung hat keinen festgelegten Inhalt." + +#: airtime_mvc/application/controllers/LocaleController.php:211 +msgid "January" +msgstr "Januar" + +#: airtime_mvc/application/controllers/LocaleController.php:212 +msgid "February" +msgstr "Februar" + +#: airtime_mvc/application/controllers/LocaleController.php:213 +msgid "March" +msgstr "März" + +#: airtime_mvc/application/controllers/LocaleController.php:214 +msgid "April" +msgstr "April" + +#: airtime_mvc/application/controllers/LocaleController.php:215 +#: airtime_mvc/application/controllers/LocaleController.php:227 +msgid "May" +msgstr "Mai" + +#: airtime_mvc/application/controllers/LocaleController.php:216 +msgid "June" +msgstr "Juni" + +#: airtime_mvc/application/controllers/LocaleController.php:217 +msgid "July" +msgstr "Juli" + +#: airtime_mvc/application/controllers/LocaleController.php:218 +msgid "August" +msgstr "August" + +#: airtime_mvc/application/controllers/LocaleController.php:219 +msgid "September" +msgstr "September" + +#: airtime_mvc/application/controllers/LocaleController.php:220 +msgid "October" +msgstr "Oktober" + +#: airtime_mvc/application/controllers/LocaleController.php:221 +msgid "November" +msgstr "November" + +#: airtime_mvc/application/controllers/LocaleController.php:222 +msgid "December" +msgstr "Dezember" + +#: airtime_mvc/application/controllers/LocaleController.php:223 +msgid "Jan" +msgstr "Jan" + +#: airtime_mvc/application/controllers/LocaleController.php:224 +msgid "Feb" +msgstr "Feb" + +#: airtime_mvc/application/controllers/LocaleController.php:225 +msgid "Mar" +msgstr "Mär" + +#: airtime_mvc/application/controllers/LocaleController.php:226 +msgid "Apr" +msgstr "Apr" + +#: airtime_mvc/application/controllers/LocaleController.php:228 +msgid "Jun" +msgstr "Mai" + +#: airtime_mvc/application/controllers/LocaleController.php:229 +msgid "Jul" +msgstr "Jul" + +#: airtime_mvc/application/controllers/LocaleController.php:230 +msgid "Aug" +msgstr "Aug" + +#: airtime_mvc/application/controllers/LocaleController.php:231 +msgid "Sep" +msgstr "Sep" + +#: airtime_mvc/application/controllers/LocaleController.php:232 +msgid "Oct" +msgstr "Okt" + +#: airtime_mvc/application/controllers/LocaleController.php:233 +msgid "Nov" +msgstr "Nov" + +#: airtime_mvc/application/controllers/LocaleController.php:234 +msgid "Dec" +msgstr "Dez" + +#: airtime_mvc/application/controllers/LocaleController.php:235 +msgid "today" +msgstr "Heute" + +#: airtime_mvc/application/controllers/LocaleController.php:236 +msgid "day" +msgstr "Tag" + +#: airtime_mvc/application/controllers/LocaleController.php:237 +msgid "week" +msgstr "Woche" + +#: airtime_mvc/application/controllers/LocaleController.php:238 +msgid "month" +msgstr "Monat" + +#: airtime_mvc/application/controllers/LocaleController.php:253 +msgid "Shows longer than their scheduled time will be cut off by a following show." +msgstr "Wenn der Inhalt einer Sendung länger ist als im Kalender festgelegt ist, wird das Ende durch eine nachfolgende Sendung abgschnitten." + +#: airtime_mvc/application/controllers/LocaleController.php:254 +msgid "Cancel Current Show?" +msgstr "Aktuelle Sendung abbrechen?" + +#: airtime_mvc/application/controllers/LocaleController.php:255 +#: airtime_mvc/application/controllers/LocaleController.php:294 +msgid "Stop recording current show?" +msgstr "Aufzeichnung der aktuellen Sendung stoppen?" + +#: airtime_mvc/application/controllers/LocaleController.php:256 +msgid "Ok" +msgstr "OK" + +#: airtime_mvc/application/controllers/LocaleController.php:257 +msgid "Contents of Show" +msgstr "Sendungsinhalt" + +#: airtime_mvc/application/controllers/LocaleController.php:260 +msgid "Remove all content?" +msgstr "Gesamten Inhalt entfernen?" + +#: airtime_mvc/application/controllers/LocaleController.php:262 +msgid "Delete selected item(s)?" +msgstr "Gewählte Objekte löschen?" + +#: airtime_mvc/application/controllers/LocaleController.php:263 +#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:5 +msgid "Start" +msgstr "Beginn" + +#: airtime_mvc/application/controllers/LocaleController.php:264 +msgid "End" +msgstr "Ende" + +#: airtime_mvc/application/controllers/LocaleController.php:265 +msgid "Duration" +msgstr "Dauer" + +#: airtime_mvc/application/controllers/LocaleController.php:271 +msgid "Cue In" +msgstr "Cue In" + +#: airtime_mvc/application/controllers/LocaleController.php:272 +msgid "Cue Out" +msgstr "Cue Out" + +#: airtime_mvc/application/controllers/LocaleController.php:273 +msgid "Fade In" +msgstr "Fade In" + +#: airtime_mvc/application/controllers/LocaleController.php:274 +msgid "Fade Out" +msgstr "Fade Out" + +#: airtime_mvc/application/controllers/LocaleController.php:275 +msgid "Show Empty" +msgstr "Sendung leer" + +#: airtime_mvc/application/controllers/LocaleController.php:276 +msgid "Recording From Line In" +msgstr "Aufzeichnen von Line-In" + +#: airtime_mvc/application/controllers/LocaleController.php:281 +msgid "Cannot schedule outside a show." +msgstr "Es ist keine Planung außerhalb einer Sendung möglich." + +#: airtime_mvc/application/controllers/LocaleController.php:282 +msgid "Moving 1 Item" +msgstr "Verschiebe 1 Objekt" + +#: airtime_mvc/application/controllers/LocaleController.php:283 +#, php-format +msgid "Moving %s Items" +msgstr "Verschiebe %s Objekte" + +#: airtime_mvc/application/controllers/LocaleController.php:286 +msgid "Select all" +msgstr "Alle markieren" + +#: airtime_mvc/application/controllers/LocaleController.php:287 +msgid "Select none" +msgstr "Nichts Markieren" + +#: airtime_mvc/application/controllers/LocaleController.php:288 +msgid "Remove overbooked tracks" +msgstr "Überbuchte Titel entfernen" + +#: airtime_mvc/application/controllers/LocaleController.php:289 +msgid "Remove selected scheduled items" +msgstr "Gewähltes Element entfernen" + +#: airtime_mvc/application/controllers/LocaleController.php:290 +msgid "Jump to the current playing track" +msgstr "Springe zu aktuellem Titel" + +#: airtime_mvc/application/controllers/LocaleController.php:291 +msgid "Cancel current show" +msgstr "Aktuelle Sendung abbrechen" + +#: airtime_mvc/application/controllers/LocaleController.php:296 +msgid "Open library to add or remove content" +msgstr "Um Inhalte hinzuzufügen oder zu entfernen muß die Sammlung geöffnet werden" + +#: airtime_mvc/application/controllers/LocaleController.php:297 +#: airtime_mvc/application/controllers/ScheduleController.php:262 +#: airtime_mvc/application/views/scripts/showbuilder/index.phtml:15 +msgid "Add / Remove Content" +msgstr "Inhalt Hinzufügen / Entfernen" + +#: airtime_mvc/application/controllers/LocaleController.php:299 +msgid "in use" +msgstr "In Verwendung" + +#: airtime_mvc/application/controllers/LocaleController.php:300 +msgid "Disk" +msgstr "Disk" + +#: airtime_mvc/application/controllers/LocaleController.php:302 +msgid "Look in" +msgstr "Suchen in" + +#: airtime_mvc/application/controllers/LocaleController.php:304 +msgid "Open" +msgstr "Öffnen" + +#: airtime_mvc/application/controllers/LocaleController.php:311 +msgid "Show / hide columns" +msgstr "Spalten zeigen / verbergen" + +#: airtime_mvc/application/controllers/LocaleController.php:313 +msgid "From {from} to {to}" +msgstr "Von {from} bis {to}" + +#: airtime_mvc/application/controllers/LocaleController.php:314 +msgid "kbps" +msgstr "kbps" + +#: airtime_mvc/application/controllers/LocaleController.php:315 +msgid "yyyy-mm-dd" +msgstr "yyyy-mm-dd" + +#: airtime_mvc/application/controllers/LocaleController.php:316 +msgid "hh:mm:ss.t" +msgstr "hh:mm:ss.t" + +#: airtime_mvc/application/controllers/LocaleController.php:317 +msgid "kHz" +msgstr "kHz" + +#: airtime_mvc/application/controllers/LocaleController.php:320 +msgid "Su" +msgstr "So" + +#: airtime_mvc/application/controllers/LocaleController.php:321 +msgid "Mo" +msgstr "Mo" + +#: airtime_mvc/application/controllers/LocaleController.php:322 +msgid "Tu" +msgstr "Di" + +#: airtime_mvc/application/controllers/LocaleController.php:323 +msgid "We" +msgstr "Mi" + +#: airtime_mvc/application/controllers/LocaleController.php:324 +msgid "Th" +msgstr "Do" + +#: airtime_mvc/application/controllers/LocaleController.php:325 +msgid "Fr" +msgstr "Fr" + +#: airtime_mvc/application/controllers/LocaleController.php:326 +msgid "Sa" +msgstr "Sa" + +#: airtime_mvc/application/controllers/LocaleController.php:327 +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:3 +msgid "Close" +msgstr "Schließen" + +#: airtime_mvc/application/controllers/LocaleController.php:329 +msgid "Hour" +msgstr "Stunde" + +#: airtime_mvc/application/controllers/LocaleController.php:330 +msgid "Minute" +msgstr "Minute" + +#: airtime_mvc/application/controllers/LocaleController.php:331 +msgid "Done" +msgstr "Fertig" + +#: airtime_mvc/application/controllers/ShowbuilderController.php:190 +#: airtime_mvc/application/controllers/LibraryController.php:159 +msgid "Preview" +msgstr "Vorschau" + +#: airtime_mvc/application/controllers/ShowbuilderController.php:192 +msgid "Select cursor" +msgstr "Zeiger wählen" + +#: airtime_mvc/application/controllers/ShowbuilderController.php:193 +msgid "Remove cursor" +msgstr "Zeiger entfernen" + +#: airtime_mvc/application/controllers/ShowbuilderController.php:198 +#: airtime_mvc/application/controllers/LibraryController.php:187 +#: airtime_mvc/application/controllers/LibraryController.php:215 +#: airtime_mvc/application/controllers/LibraryController.php:232 +#: airtime_mvc/application/controllers/ScheduleController.php:316 +#: airtime_mvc/application/controllers/ScheduleController.php:323 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:26 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:23 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:18 +msgid "Delete" +msgstr "Löschen" + +#: airtime_mvc/application/controllers/ShowbuilderController.php:212 +msgid "show does not exist" +msgstr "Sendung existiert nicht." + +#: airtime_mvc/application/controllers/ApiController.php:56 +#: airtime_mvc/application/controllers/ApiController.php:83 +msgid "You are not allowed to access this resource." +msgstr "Sie haben nicht die erforderliche Berechtigung sich mit dieser Quelle zu verbinden." + +#: airtime_mvc/application/controllers/ApiController.php:285 +#: airtime_mvc/application/controllers/ApiController.php:324 +msgid "You are not allowed to access this resource. " +msgstr "Sie haben nicht die erforderliche Berechtigung sich mit dieser Quelle zu verbinden." + +#: airtime_mvc/application/controllers/ApiController.php:505 +msgid "File does not exist in Airtime." +msgstr "Datei existiert nicht in Airtime." + +#: airtime_mvc/application/controllers/ApiController.php:518 +msgid "File does not exist in Airtime" +msgstr "Datei existiert nicht in Airtime." + +#: airtime_mvc/application/controllers/ApiController.php:530 +msgid "File doesn't exist in Airtime." +msgstr "Datei existiert nicht in Airtime." + +#: airtime_mvc/application/controllers/ApiController.php:576 +msgid "Bad request. no 'mode' parameter passed." +msgstr "Fehlerhafte Anfrage. Kein passender 'Mode'-Parameter." + +#: airtime_mvc/application/controllers/ApiController.php:586 +msgid "Bad request. 'mode' parameter is invalid" +msgstr "Fehlerhafte Anfrage. 'Mode'-Parameter ist ungültig." + +#: airtime_mvc/application/controllers/LibraryController.php:93 +#: airtime_mvc/application/controllers/PlaylistController.php:127 +#, php-format +msgid "%s not found" +msgstr "%s nicht gefunden" + +#: airtime_mvc/application/controllers/LibraryController.php:102 +#: airtime_mvc/application/controllers/PlaylistController.php:148 +msgid "Something went wrong." +msgstr "Etwas ist falsch gelaufen." + +#: airtime_mvc/application/controllers/LibraryController.php:180 +#: airtime_mvc/application/controllers/LibraryController.php:203 +#: airtime_mvc/application/controllers/LibraryController.php:224 +msgid "Add to Playlist" +msgstr "Hinzufügen zu Playlist" + +#: airtime_mvc/application/controllers/LibraryController.php:182 +msgid "Add to Smart Block" +msgstr "Hinzufügen zu Smart Block" + +#: airtime_mvc/application/controllers/LibraryController.php:188 +#: airtime_mvc/application/views/scripts/library/edit-file-md.phtml:2 +msgid "Edit Metadata" +msgstr "Metadaten ändern" + +#: airtime_mvc/application/controllers/LibraryController.php:192 +#: airtime_mvc/application/controllers/ScheduleController.php:900 +msgid "Download" +msgstr "Herunterladen" + +#: airtime_mvc/application/controllers/LibraryController.php:210 +#: airtime_mvc/application/controllers/LibraryController.php:230 +msgid "Edit" +msgstr "Ändern" + +#: airtime_mvc/application/controllers/LibraryController.php:243 +msgid "Soundcloud" +msgstr "SoundCloud" + +#: airtime_mvc/application/controllers/LibraryController.php:249 +#: airtime_mvc/application/controllers/ScheduleController.php:285 +msgid "View on Soundcloud" +msgstr "Auf SoundCloud ansehen" + +#: airtime_mvc/application/controllers/LibraryController.php:253 +#: airtime_mvc/application/controllers/ScheduleController.php:288 +msgid "Re-upload to SoundCloud" +msgstr "Nochmal auf SoundCloud hochladen." + +#: airtime_mvc/application/controllers/LibraryController.php:255 +#: airtime_mvc/application/controllers/ScheduleController.php:288 +msgid "Upload to SoundCloud" +msgstr "Auf SoundCloud hochladen " + +#: airtime_mvc/application/controllers/LibraryController.php:262 +msgid "No action available" +msgstr "Keine Aktion verfügbar" + +#: airtime_mvc/application/controllers/LibraryController.php:282 +msgid "You don't have permission to delete selected items." +msgstr "Sie haben nicht die erforderliche Berechtigung die gewählten Objekte zu löschen." + +#: airtime_mvc/application/controllers/LibraryController.php:331 +msgid "Could not delete some scheduled files." +msgstr "Manche der festgelegten Dateien konnten nicht gelöscht werden." + +#: airtime_mvc/application/controllers/PlaylistController.php:45 +#, php-format +msgid "You are viewing an older version of %s" +msgstr "Sie betrachten eine ältere Version von %s" + +#: airtime_mvc/application/controllers/PlaylistController.php:120 +msgid "You cannot add tracks to dynamic blocks." +msgstr "Sie können einem Dynamischen Smart Block keine einzelnen Titel hinzufügen." + +#: airtime_mvc/application/controllers/PlaylistController.php:141 +#, php-format +msgid "You don't have permission to delete selected %s(s)." +msgstr "Sie haben zum Löschen der gewählten %s (s) nicht die erforderliche Berechtigung. " + +#: airtime_mvc/application/controllers/PlaylistController.php:154 +msgid "You can only add tracks to smart block." +msgstr "Sie können einem Smart Block nur Titel hinzufügen." + +#: airtime_mvc/application/controllers/PlaylistController.php:172 +msgid "Untitled Playlist" +msgstr "Unbenannte Playlist" + +#: airtime_mvc/application/controllers/PlaylistController.php:174 +msgid "Untitled Smart Block" +msgstr "Unbenannter Smart Block" + +#: airtime_mvc/application/controllers/PlaylistController.php:437 +msgid "Unknown Playlist" +msgstr "Unbenannte Playlist" + +#: airtime_mvc/application/controllers/ScheduleController.php:253 +msgid "View Recorded File Metadata" +msgstr "Metadaten der aufgezeichneten Datei ansehen" + +#: airtime_mvc/application/controllers/ScheduleController.php:265 +msgid "Remove All Content" +msgstr "Gesamten Inhalt entfernen" + +#: airtime_mvc/application/controllers/ScheduleController.php:272 +msgid "Show Content" +msgstr "Sendungsinhalt" + +#: airtime_mvc/application/controllers/ScheduleController.php:296 +#: airtime_mvc/application/controllers/ScheduleController.php:303 +msgid "Cancel Current Show" +msgstr "Aktuelle Sendung abbrechen" + +#: airtime_mvc/application/controllers/ScheduleController.php:300 +#: airtime_mvc/application/controllers/ScheduleController.php:310 +msgid "Edit Show" +msgstr "Sendung ändern" + +#: airtime_mvc/application/controllers/ScheduleController.php:318 +msgid "Delete This Instance" +msgstr "Lösche diese Folge" + +#: airtime_mvc/application/controllers/ScheduleController.php:320 +msgid "Delete This Instance and All Following" +msgstr "Lösche diese Folge und alle Nachfolgenden" + +#: airtime_mvc/application/controllers/ScheduleController.php:446 +#, php-format +msgid "Rebroadcast of show %s from %s at %s" +msgstr "Wiederholung der Sendung % s vom %s um %s" + +#: airtime_mvc/application/controllers/WebstreamController.php:29 +#: airtime_mvc/application/controllers/WebstreamController.php:33 +msgid "Untitled Webstream" +msgstr "Unbenannter Webstream" + +#: airtime_mvc/application/controllers/WebstreamController.php:138 +msgid "Webstream saved." +msgstr "Webstream gespeichert" + +#: airtime_mvc/application/controllers/WebstreamController.php:146 +msgid "Invalid form values." +msgstr "Ungültiger Eingabewert" + +#: airtime_mvc/application/views/scripts/listenerstat/index.phtml:2 +msgid "Listener Count Over Time" +msgstr "Hörerzahl im Zeitablauf" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:3 +msgid "Previous:" +msgstr "Vorher:" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:10 +msgid "Next:" +msgstr "Danach:" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:24 +msgid "Source Streams" +msgstr "Stream-Quellen" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:29 +msgid "Master Source" +msgstr "Master Quelle" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:38 +msgid "Show Source" +msgstr "Show Quelle" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:45 +msgid "Scheduled Play" +msgstr "Planmäßig Abspielen" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:54 +msgid "ON AIR" +msgstr "ON AIR" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:55 +msgid "Listen" +msgstr "Hören" + +#: airtime_mvc/application/views/scripts/partialviews/header.phtml:59 +msgid "Station time" +msgstr "Uhrzeit" + +#: airtime_mvc/application/views/scripts/partialviews/trialBox.phtml:3 +msgid "Your trial expires in" +msgstr "Die Probelaufzeit läuft ab in" + +#: airtime_mvc/application/views/scripts/partialviews/trialBox.phtml:9 +msgid "Purchase your copy of Airtime" +msgstr "Kaufen sie eine Kopie von Airtime" + +#: airtime_mvc/application/views/scripts/partialviews/trialBox.phtml:9 +msgid "My Account" +msgstr "Mein Konto" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:3 +msgid "Manage Users" +msgstr "Benutzer verwalten" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:10 +msgid "New User" +msgstr "Neuer Benutzer" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:17 +msgid "id" +msgstr "ID" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:19 +msgid "First Name" +msgstr "Vorname" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:20 +msgid "Last Name" +msgstr "Nachname" + +#: airtime_mvc/application/views/scripts/user/add-user.phtml:21 +msgid "User Type" +msgstr "Benutzertyp" + +#: airtime_mvc/application/views/scripts/dashboard/about.phtml:5 +#, php-format +msgid "%sAirtime%s %s, , the open radio software for scheduling and remote station management. %s" +msgstr "%sAirtime%s %s, , die offene Radio Software für Planung und Remote-Station-Management. %s" + +#: airtime_mvc/application/views/scripts/dashboard/about.phtml:13 +#, php-format +msgid "%sSourcefabric%s o.p.s. Airtime is distributed under the %sGNU GPL v.3%s" +msgstr "%sSourcefabric%s o.p.s. Airtime wird vertrieben unter %sGNU GPL v.3%s" + +#: airtime_mvc/application/views/scripts/dashboard/stream-player.phtml:50 +msgid "Select stream:" +msgstr "Stream wählen:" + +#: airtime_mvc/application/views/scripts/dashboard/stream-player.phtml:76 +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:50 +msgid "mute" +msgstr "Stumm schalten" + +#: airtime_mvc/application/views/scripts/dashboard/stream-player.phtml:77 +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:53 +msgid "unmute" +msgstr "Laut schalten" + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:3 +msgid "Welcome to Airtime!" +msgstr "Willkommen bei Airtime!" + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:4 +msgid "Here's how you can get started using Airtime to automate your broadcasts: " +msgstr "Starten sie hier, um die ersten Schritte für die Automation ihrer Radio Station zu erfahren." + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:7 +msgid "Begin by adding your files to the library using the 'Add Media' menu button. You can drag and drop your files to this window too." +msgstr "Beginnen sie damit, Dateien ihrer Sammlung hinzuzufügen. Verwenden sie dazu die Schaltfläche 'Medien Hinzufügen'. Dateien können auch via Drag'n'Drop hinzugefügt werden." + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:8 +msgid "Create a show by going to 'Calendar' in the menu bar, and then clicking the '+ Show' icon. This can be either a one-time or repeating show. Only admins and program managers can add shows." +msgstr "Erstellen sie eine Sendung, indem sie in der Menüzeile die Schaltfläche 'Kalender' betätigen und anschließend die Schaltfläche '+ Sendung' wählen. Dies kann eine einmalige oder sich wiederholende Sendung sein. Nur Administratoren und Programm Manager können Sendungen hinzufügen." + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:9 +msgid "Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting 'Add / Remove Content'" +msgstr "" +"Fügen sie Mediendateien einer Show hinzu.\n" +"Öffnen sie dazu die gewünschte Sendung durch einen Links-Klick darauf im Kalender und wählen sie 'Inhalt hinzufügen / entfernen'" + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:10 +msgid "Select your media from the left pane and drag them to your show in the right pane." +msgstr "Wählen sie Medien vom linken Feld und ziehen sie es in ihre Sendung am im rechten Feld." + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:12 +msgid "Then you're good to go!" +msgstr "Dann kann es auch schon los gehen!" + +#: airtime_mvc/application/views/scripts/dashboard/help.phtml:13 +#, php-format +msgid "For more detailed help, read the %suser manual%s." +msgstr "Für weitere Hilfe bitte das %sBenutzerhandbuch%s lesen." + +#: airtime_mvc/application/views/scripts/playlist/update.phtml:40 +msgid "Expand Static Block" +msgstr "Statischen Block erweitern" + +#: airtime_mvc/application/views/scripts/playlist/update.phtml:45 +msgid "Expand Dynamic Block" +msgstr "Dynamischen Block erweitern" + +#: airtime_mvc/application/views/scripts/playlist/update.phtml:98 +msgid "Empty smart block" +msgstr "Smart Block leeren" + +#: airtime_mvc/application/views/scripts/playlist/update.phtml:100 +msgid "Empty playlist" +msgstr "Playlist leeren" + +#: airtime_mvc/application/views/scripts/playlist/set-fade.phtml:3 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:66 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:71 +msgid "Fade out: " +msgstr "Fade Out:" + +#: airtime_mvc/application/views/scripts/playlist/set-fade.phtml:3 +#: airtime_mvc/application/views/scripts/playlist/set-fade.phtml:10 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:68 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:71 +msgid "(ss.t)" +msgstr "(ss.t)" + +#: airtime_mvc/application/views/scripts/playlist/set-fade.phtml:10 +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:63 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:68 +msgid "Fade in: " +msgstr "Fade In:" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:10 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:10 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:4 +msgid "New" +msgstr "Neu" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:13 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:13 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:7 +msgid "New Playlist" +msgstr "Neue Playlist" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:14 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:14 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:8 +msgid "New Smart Block" +msgstr "Neuer Smart Block" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:15 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:15 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:9 +msgid "New Webstream" +msgstr "Neuer Webstream" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:20 +msgid "Shuffle playlist" +msgstr "Shuffle Playlist" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:23 +msgid "Save playlist" +msgstr "Playlist speichern" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:30 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:27 +msgid "Playlist crossfade" +msgstr "Playlist Crossfade" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:49 +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:51 +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:38 +msgid "View / edit description" +msgstr "Beschreibung ansehen / ändern" + +#: airtime_mvc/application/views/scripts/playlist/playlist.phtml:81 +msgid "No open playlist" +msgstr "Keine Playlist geöffnet" + +#: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:86 +msgid "No open smart block" +msgstr "Kein Smart Block geöffnet" + +#: airtime_mvc/application/views/scripts/playlist/set-cue.phtml:2 +msgid "Cue In: " +msgstr "Cue In:" + +#: airtime_mvc/application/views/scripts/playlist/set-cue.phtml:2 +#: airtime_mvc/application/views/scripts/playlist/set-cue.phtml:7 +msgid "(hh:mm:ss.t)" +msgstr "(hh:mm:ss.t)" + +#: airtime_mvc/application/views/scripts/playlist/set-cue.phtml:7 +msgid "Cue Out: " +msgstr "Cue Out:" + +#: airtime_mvc/application/views/scripts/playlist/set-cue.phtml:12 +msgid "Original Length:" +msgstr "Original Dauer:" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:6 +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:40 +msgid "Add this show" +msgstr "Sendung hinzufügen" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:6 +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:40 +msgid "Update show" +msgstr "Sendung aktualisieren" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:10 +msgid "What" +msgstr "Was" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:14 +msgid "When" +msgstr "Wann" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:19 +msgid "Live Stream Input" +msgstr "Live-Stream Eingang" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:23 +msgid "Record & Rebroadcast" +msgstr "Aufzeichnen & Wiederholen" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:29 +msgid "Who" +msgstr "Wer" + +#: airtime_mvc/application/views/scripts/schedule/add-show-form.phtml:33 +msgid "Style" +msgstr "Style" + +#: airtime_mvc/application/views/scripts/login/password-restore-after.phtml:3 +msgid "Email sent" +msgstr "E-Mail gesendet" + +#: airtime_mvc/application/views/scripts/login/password-restore-after.phtml:6 +msgid "An email has been sent" +msgstr "Ein E-Mail wurder gesendet" + +#: airtime_mvc/application/views/scripts/login/password-restore-after.phtml:7 +msgid "Back to login screen" +msgstr "Zurück zum Anmeldungsbildschirm" + +#: airtime_mvc/application/views/scripts/login/index.phtml:7 +msgid "Welcome to the online Airtime demo! You can log in using the username 'admin' and the password 'admin'." +msgstr "" +"Willkommen zur Online Artime Demo!\n" +"Sie können sich mit dem Benutzernamen 'admin' und dem Passwort 'admin' anmelden." + +#: airtime_mvc/application/views/scripts/login/password-restore.phtml:3 +#: airtime_mvc/application/views/scripts/form/login.phtml:25 +msgid "Reset password" +msgstr "Passwort zurücksetzen" + +#: airtime_mvc/application/views/scripts/login/password-restore.phtml:7 +msgid "Please enter your account e-mail address. You will receive a link to create a new password via e-mail." +msgstr "Bitte geben sie die E-Mail-Adresse ein, die in ihrem Benutzerkonto eingetragen ist. Sie erhalten einen Link um ein neues Passwort via E-Mail zu erstellen." + +#: airtime_mvc/application/views/scripts/login/password-change.phtml:3 +msgid "New password" +msgstr "Neues Passwort" + +#: airtime_mvc/application/views/scripts/login/password-change.phtml:6 +msgid "Please enter and confirm your new password in the fields below." +msgstr "Bitte in den nachstehenden Feldern das neue Passwort eingeben und bestätigen." + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:4 +msgid "Service" +msgstr "Dienst" + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:6 +msgid "Uptime" +msgstr "Betriebszeit" + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:7 +msgid "CPU" +msgstr "CPU" + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:8 +msgid "Memory" +msgstr "Speicher" + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:14 +msgid "Airtime Version" +msgstr "Airtime Version" + +#: airtime_mvc/application/views/scripts/systemstatus/index.phtml:30 +msgid "Disk Space" +msgstr "Speicherplatz" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:22 +msgid "previous" +msgstr "Zurück" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:25 +msgid "play" +msgstr "Play" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:28 +msgid "pause" +msgstr "Pause" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:31 +msgid "next" +msgstr "Nächster" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:34 +msgid "stop" +msgstr "Stopp" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:59 +msgid "max volume" +msgstr "Maximale Lautstärke" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:69 +msgid "Update Required" +msgstr "Aktualisierung erforderlich" + +#: airtime_mvc/application/views/scripts/audiopreview/audio-preview.phtml:70 +#, php-format +msgid "To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s." +msgstr "Um diese Datei abspielen zu können muß entweder der Browser oder das %sFlash Plugin%s aktualisiert werden." + +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:51 +msgid "Stream URL:" +msgstr "Stream URL:" + +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:56 +msgid "Default Length:" +msgstr "Standard Dauer:" + +#: airtime_mvc/application/views/scripts/webstream/webstream.phtml:63 +msgid "No webstream" +msgstr "Kein Webstream" + +#: airtime_mvc/application/views/scripts/error/error.phtml:6 +msgid "Zend Framework Default Application" +msgstr "Zend Framework Default Application" + +#: airtime_mvc/application/views/scripts/error/error.phtml:10 +msgid "Page not found!" +msgstr "Seite nicht gefunden!" + +#: airtime_mvc/application/views/scripts/error/error.phtml:11 +msgid "Looks like the page you were looking for doesn't exist!" +msgstr "Scheinbar existiert die Seite die sie suchen nicht!" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:4 +msgid "Stream " +msgstr "Stream" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:33 +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:47 +#: airtime_mvc/application/views/scripts/form/preferences_email_server.phtml:44 +#: airtime_mvc/application/views/scripts/form/preferences_email_server.phtml:74 +#: airtime_mvc/application/views/scripts/form/preferences_email_server.phtml:90 +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:47 +#: airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml:44 +#: airtime_mvc/application/views/scripts/form/preferences_soundcloud.phtml:59 +#: airtime_mvc/application/views/scripts/form/preferences_general.phtml:71 +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:46 +msgid "(Required)" +msgstr "(Erforderlich)" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:76 +msgid "Additional Options" +msgstr "Erweiterte Optionen" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:108 +msgid "The following info will be displayed to listeners in their media player:" +msgstr "Die Hörer werden folgende Information auf dem Display ihres Medien-Players sehen:" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:141 +msgid "(Your radio station website)" +msgstr "(Webseite ihrer Radiostation)" + +#: airtime_mvc/application/views/scripts/form/stream-setting-form.phtml:179 +msgid "Stream URL: " +msgstr "Stream URL:" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:9 +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:27 +msgid "Choose folder" +msgstr "Wähle Verzeichnis" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:10 +msgid "Set" +msgstr "Wählen" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:19 +msgid "Current Import Folder:" +msgstr "Aktuelles Import-Verzeichnis:" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:28 +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast-absolute.phtml:40 +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast.phtml:41 +msgid "Add" +msgstr "Hinzufügen" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:43 +msgid "Rescan watched directory (This is useful if it is network mount and may be out of sync with Airtime)" +msgstr "" +"Überwachte Verzeichnisse nochmals durchsuchen\n" +"(Dies könnte nützlich sein, wenn Airtime beim Synchronisieren mit Netzlaufwerken Schwierigkeiten hat)" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:44 +msgid "Remove watched directory" +msgstr "Überwachten Ordner entfernen" + +#: airtime_mvc/application/views/scripts/form/preferences_watched_dirs.phtml:50 +msgid "You are not watching any media folders." +msgstr "Sie überwachen keine Medienverzeichnisse." + +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast-absolute.phtml:4 +msgid "Choose Days:" +msgstr "Tag wählen:" + +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast-absolute.phtml:18 +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast.phtml:18 +msgid "Remove" +msgstr "Entfernen" + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:1 +msgid "Register Airtime" +msgstr "Airtime registrieren" + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:6 +#, php-format +msgid "Help Airtime improve by letting us know how you are using it. This info will be collected regularly in order to enhance your user experience.%sClick 'Yes, help Airtime' and we'll make sure the features you use are constantly improving." +msgstr "Helfen sie Airtime, indem sie uns erzählen, wie sie damit arbeiten. Diese Informationen werden regelmäßig gesammelt, um die Erfahrungswerte der Benutzer zu fördern.%sDrücken Sie auf 'Ja, Airtime helfen' und wir versichern, die von ihnen verwendeten Features laufend zu verbessern." + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:25 +#, php-format +msgid "Click the box below to advertise your station on %sSourcefabric.org%s. In order to promote your station, 'Send support feedback' must be enabled. This data will be collected in addition to the support feedback." +msgstr "Mit Aktivierung des unteren Kästchens werben sie für ihre Radiostation auf %sSourcefabric.org%s. Dazu muss die Option 'Support Feedback senden' aktiviert sein. Diese Daten werden zusätzlich zum Support Feedback gesammelt." + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:65 +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:79 +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:61 +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:76 +msgid "(for verification purposes only, will not be published)" +msgstr "(Ausschließlich zu Kontrollzwecken, wird nicht veröffentlicht)" + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:150 +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:151 +msgid "Note: Anything larger than 600x600 will be resized." +msgstr "Erinnerung: Sind Dateien größer als 600x600 Pixel, wird die Größe geändert." + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:164 +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:164 +msgid "Show me what I am sending " +msgstr "Zeige mir was ich sende" + +#: airtime_mvc/application/views/scripts/form/register-dialog.phtml:178 +msgid "Terms and Conditions" +msgstr "Geschäftsbedingungen und Rahmenverhältnisse" + +#: airtime_mvc/application/views/scripts/form/showbuilder.phtml:7 +msgid "Find Shows" +msgstr "Suche Sendungen" + +#: airtime_mvc/application/views/scripts/form/showbuilder.phtml:12 +msgid "Filter By Show:" +msgstr "Filter nach Sendung:" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:2 +msgid "Input Stream Settings" +msgstr "Stream-Eingang Einstellungen" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:109 +msgid "Master Source Connection URL:" +msgstr "Master-Quelle Verbindungs-URL:" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:115 +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:159 +msgid "Override" +msgstr "Überordnen" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:120 +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:164 +msgid "OK" +msgstr "OK" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:120 +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:164 +msgid "RESET" +msgstr "RESET" + +#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:153 +msgid "Show Source Connection URL:" +msgstr "Show-Quelle Verbindungs-URL:" + +#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast.phtml:4 +msgid "Repeat Days:" +msgstr "Wiederholtage:" + +#: airtime_mvc/application/views/scripts/form/daterange.phtml:6 +msgid "Filter History" +msgstr "Filter Historie" + +#: airtime_mvc/application/views/scripts/form/preferences.phtml:5 +msgid "Email / Mail Server Settings" +msgstr "E-Mail- / Mail-Server-Einstellungen" + +#: airtime_mvc/application/views/scripts/form/preferences.phtml:10 +msgid "SoundCloud Settings" +msgstr "SoundCloud Einstellungen" + +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:5 +#, php-format +msgid "Help Airtime improve by letting Sourcefabric know how you are using it. This information will be collected regularly in order to enhance your user experience.%sClick the 'Send support feedback' box and we'll make sure the features you use are constantly improving." +msgstr "Helfen sie Airtime, indem sie uns erzählen, wie sie damit arbeiten. Diese Informationen werden regelmäßig gesammelt, um die Erfahrungswerte der Benutzer zu fördern.%sDrücken Sie auf 'Ja, Airtime helfen' und wir versichern, die von ihnen verwendeten Features laufend zu verbessern." + +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:23 +#, php-format +msgid "Click the box below to promote your station on %sSourcefabric.org%s." +msgstr "Mit Aktivierung des unteren Kästchens werben sie für ihre Radiostation auf %sSourcefabric.org%s. Dazu muss die Option 'Support Feedback senden' aktiviert sein. Diese Daten werden zusätzlich zum Support Feedback gesammelt." + +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:41 +msgid "(In order to promote your station, 'Send support feedback' must be enabled)." +msgstr "(Um ihre Radiostation bewerben zu können, muß 'Support Feedback senden' aktiviert sein)" + +#: airtime_mvc/application/views/scripts/form/support-setting.phtml:186 +msgid "Sourcefabric Privacy Policy" +msgstr "Sourcefabric Datenschutzrichtlinie" + +#: airtime_mvc/application/views/scripts/form/add-show-live-stream.phtml:53 +msgid "Connection URL: " +msgstr "Verbindung URL:" + +#: airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml:3 +msgid "Smart Block Options" +msgstr "Smart Block Optionen" + +#: airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml:63 +msgid " to " +msgstr " bis " + +#: airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml:120 +#: airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml:133 +msgid "files meet the criteria" +msgstr "Dateien entsprechen den Kriterien" + +#: airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml:127 +msgid "file meet the criteria" +msgstr "entspricht den Kriterien" + +#: airtime_mvc/application/views/scripts/showbuilder/builderDialog.phtml:3 +#: airtime_mvc/application/views/scripts/library/library.phtml:2 +msgid "File import in progress..." +msgstr "Datei-Import in Bearbeitung..." + +#: airtime_mvc/application/views/scripts/showbuilder/builderDialog.phtml:5 +#: airtime_mvc/application/views/scripts/library/library.phtml:5 +msgid "Advanced Search Options" +msgstr "Erweiterte Suchoptionen" + +#: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:2 +msgid "Stream Settings" +msgstr "Stream Einstellungen" + +#: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:12 +msgid "Global Settings" +msgstr "Globale Einstellungen" + +#: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:72 +msgid "Output Stream Settings" +msgstr "Stream-Ausgabe Einstellungen" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:7 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:30 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:32 +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:128 +msgid "Length:" +msgstr "Dauer:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:8 +msgid "Sample Rate:" +msgstr "Samplerate:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:18 +msgid "Isrc Number:" +msgstr "ISRC Number:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:21 +msgid "File" +msgstr "Datei" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:21 +msgid "Path:" +msgstr "Pfad:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:39 +msgid "Web Stream" +msgstr "Web Stream" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:40 +msgid "Dynamic Smart Block" +msgstr "Dynamischer Smart Block" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:41 +msgid "Static Smart Block" +msgstr "Statischer Smart Block" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:42 +msgid "Audio Track" +msgstr "Titel" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:48 +msgid "Playlist Contents: " +msgstr "Playlist Inhalt:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:50 +msgid "Static Smart Block Contents: " +msgstr "Statischer Smart Block Inhalt:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:89 +msgid "Dynamic Smart Block Criteria: " +msgstr "Dynamische Smart Block Kriterien:" + +#: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:118 +msgid "Limit to " +msgstr "Begrenzt auf " + +#: airtime_mvc/library/propel/contrib/pear/HTML_QuickForm_Propel/Propel.php:512 +msgid "Please selection an option" +msgstr "Bitte eine Option wählen" + +#: airtime_mvc/library/propel/contrib/pear/HTML_QuickForm_Propel/Propel.php:531 +msgid "No Records" +msgstr "Keine Aufzeichnungen" + diff --git a/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql index 5ef1a1612..32dbbbaab 100644 --- a/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql @@ -33,6 +33,7 @@ INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_C INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('cs_CZ', 'Český'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_AT', 'Österreichisches Deutsch'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('es_ES', 'Español'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('fr_FR', 'Français'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('it_IT', 'Italiano'); From 860524a8734805028eeb4640686d85a4cc914f49 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 2 Apr 2013 17:19:48 +0100 Subject: [PATCH 045/128] Added locales for English localizations --- airtime_mvc/build/sql/defaultdata.sql | 4 +++- install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/build/sql/defaultdata.sql b/airtime_mvc/build/sql/defaultdata.sql index 5614ea932..0af91c7fd 100644 --- a/airtime_mvc/build/sql/defaultdata.sql +++ b/airtime_mvc/build/sql/defaultdata.sql @@ -325,7 +325,9 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('locale', 'en_CA'); INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_CA'); -INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English (Canada)'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_GB', 'English (Britain)'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_US', 'English (USA)'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('cs_CZ', 'Český'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_AT', 'Österreichisches Deutsch'); diff --git a/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql index 32dbbbaab..ef768206e 100644 --- a/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql +++ b/install_minimal/upgrades/airtime-2.3.0/data/upgrade.sql @@ -30,7 +30,9 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('locale', 'en_CA'); INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_CA'); -INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English (Canada)'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_GB', 'English (Britain)'); +INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_US', 'English (USA)'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('cs_CZ', 'Český'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_AT', 'Österreichisches Deutsch'); From ffe11465ecf9b7d39436705ee8251486f5a15390 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 2 Apr 2013 17:26:49 +0100 Subject: [PATCH 046/128] Added translators to credits file --- CREDITS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CREDITS b/CREDITS index a9053b04c..66b86316d 100644 --- a/CREDITS +++ b/CREDITS @@ -22,6 +22,18 @@ Mikayel Karapetian (michael.karapetian@sourcefabric.org) Daniel James (daniel.james@sourcefabric.org) Role: Documentor & QA +Localizations: + +Albert (French) +Christoph Rombach, Micz Flor (German) +Claudia Cruz (Spanish) +Katerina Michailidis (Greek) +Hoerich (Austrian) +Luba Sirina (Russian) +Luciano De Fazio (Brazilian Portuguese) +Sebastian Matuszewski (Polish) +Staff Pingu (Italian) + Version 2.2.1 ------------- Martin Konecny (martin.konecny@sourcefabric.org) From 0bb7fa4975abdb394faaeed7ed3eb4893588c2fb Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 1 Apr 2013 19:31:13 -0400 Subject: [PATCH 047/128] don't change monit monitor state on service start/stop --- .../airtime-media-monitor-init-d | 25 +++++--- .../install/media-monitor-initialize.py | 2 +- python_apps/pypo/airtime-liquidsoap-init-d | 60 +++++++++++-------- python_apps/pypo/airtime-playout-init-d | 30 ++++++---- python_apps/pypo/install/pypo-initialize.py | 4 +- 5 files changed, 77 insertions(+), 44 deletions(-) diff --git a/python_apps/media-monitor/airtime-media-monitor-init-d b/python_apps/media-monitor/airtime-media-monitor-init-d index 2f37a49fa..ab8e0131a 100755 --- a/python_apps/media-monitor/airtime-media-monitor-init-d +++ b/python_apps/media-monitor/airtime-media-monitor-init-d @@ -17,19 +17,24 @@ DAEMON=/usr/lib/airtime/media-monitor/airtime-media-monitor PIDFILE=/var/run/airtime-media-monitor.pid start () { - start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON - monit monitor airtime-media-monitor >/dev/null 2>&1 + start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \ + --make-pidfile --pidfile $PIDFILE --startas $DAEMON } stop () { # Send TERM after 5 seconds, wait at most 30 seconds. - monit unmonitor airtime-media-monitor >/dev/null 2>&1 start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE rm -f $PIDFILE } -start_no_monit() { - start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID --make-pidfile --pidfile $PIDFILE --startas $DAEMON +start_with_monit() { + start + monit monitor airtime-media-monitor >/dev/null 2>&1 +} + +stop_with_monit() { + monit unmonitor airtime-media-monitor >/dev/null 2>&1 + stop } @@ -53,10 +58,16 @@ case "${1:-''}" in start echo "Done." ;; - 'start-no-monit') + 'start-with-monit') # restart commands here echo -n "Starting $NAME: " - start_no_monit + start_with_monit + echo "Done." + ;; + 'stop-with-monit') + # restart commands here + echo -n "Stopping $NAME: " + stop_with_monit echo "Done." ;; 'status') diff --git a/python_apps/media-monitor/install/media-monitor-initialize.py b/python_apps/media-monitor/install/media-monitor-initialize.py index be3d39b85..8cc7b6149 100644 --- a/python_apps/media-monitor/install/media-monitor-initialize.py +++ b/python_apps/media-monitor/install/media-monitor-initialize.py @@ -16,6 +16,6 @@ try: #Start media-monitor daemon if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t": print "* Waiting for media-monitor processes to start..." - subprocess.call("invoke-rc.d airtime-media-monitor start-no-monit", shell=True) + subprocess.call("invoke-rc.d airtime-media-monitor start", shell=True) except Exception, e: print e diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 37956a265..fcf3a0742 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -17,22 +17,6 @@ DAEMON=/usr/lib/airtime/pypo/bin/airtime-liquidsoap PIDFILE=/var/run/airtime-liquidsoap.pid start () { - start_no_monit - monit monitor airtime-liquidsoap >/dev/null 2>&1 -} - -stop () { - monit unmonitor airtime-liquidsoap >/dev/null 2>&1 - #send term signal after 10 seconds - timeout -k 5 10 /usr/lib/airtime/airtime_virtualenv/bin/python \ - /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py - # Send TERM after 5 seconds, wait at most 30 seconds. - start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE - rm -f $PIDFILE - sleep 3 -} - -start_no_monit() { chown pypo:pypo /var/log/airtime/pypo chown pypo:pypo /var/log/airtime/pypo-liquidsoap chown pypo:pypo /etc/airtime/liquidsoap.cfg @@ -45,21 +29,43 @@ start_no_monit() { --pidfile $PIDFILE --nicelevel -15 --startas $DAEMON } +stop () { + #send term signal after 10 seconds + timeout -k 5 10 /usr/lib/airtime/airtime_virtualenv/bin/python \ + /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py + # Send TERM after 5 seconds, wait at most 30 seconds. + start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE + rm -f $PIDFILE + sleep 3 +} + +start_with_monit () { + start + monit monitor airtime-liquidsoap >/dev/null 2>&1 +} + +stop_with_monit() { + monit unmonitor airtime-liquidsoap >/dev/null 2>&1 + stop +} + + + case "${1:-''}" in 'stop') - echo -n "Stopping Liquidsoap: " + echo -n "Stopping $NAME: " stop echo "Done." ;; 'start') - echo -n "Starting Liquidsoap: " + echo -n "Starting $NAME: " start echo "Done." ;; 'restart') # restart commands here - echo -n "Restarting Liquidsoap: " + echo -n "Restarting $NAME: " stop start echo "Done." @@ -69,22 +75,28 @@ case "${1:-''}" in if [ -f "$PIDFILE" ]; then pid=`cat $PIDFILE` if [ -d "/proc/$pid" ]; then - echo "Liquidsoap is running" + echo "$NAME is running" exit 0 fi fi - echo "Liquidsoap is not running" + echo "$NAME is not running" exit 1 ;; - 'start-no-monit') + 'start-with-monit') # restart commands here echo -n "Starting $NAME: " - start_no_monit + start_with_monit + echo "Done." + ;; + 'stop-with-monit') + # restart commands here + echo -n "Stopping $NAME: " + stop_with_monit echo "Done." ;; *) # no parameter specified - echo "Usage: $SELF start|stop|restart" + echo "Usage: $SELF start|stop|restart|status" exit 1 ;; diff --git a/python_apps/pypo/airtime-playout-init-d b/python_apps/pypo/airtime-playout-init-d index 499f6e1d7..13b46cf70 100755 --- a/python_apps/pypo/airtime-playout-init-d +++ b/python_apps/pypo/airtime-playout-init-d @@ -10,7 +10,7 @@ ### END INIT INFO USERID=root -NAME="Airtime Scheduler Engine" +NAME="Airtime Scheduler" DAEMON=/usr/lib/airtime/pypo/bin/airtime-playout PIDFILE=/var/run/airtime-playout.pid @@ -18,21 +18,24 @@ PIDFILE=/var/run/airtime-playout.pid start () { chown pypo:pypo /etc/airtime chown pypo:pypo /etc/airtime/liquidsoap.cfg - - start-stop-daemon --start --background --quiet --chuid $USERID:$USERID --make-pidfile --pidfile $PIDFILE --startas $DAEMON - monit monitor airtime-playout >/dev/null 2>&1 + start-stop-daemon --start --background --quiet --chuid $USERID:$USERID \ + --make-pidfile --pidfile $PIDFILE --startas $DAEMON } stop () { # Send TERM after 5 seconds, wait at most 30 seconds. - - monit unmonitor airtime-playout >/dev/null 2>&1 start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --pidfile $PIDFILE rm -f $PIDFILE } -start_no_monit() { - start-stop-daemon --start --background --quiet --chuid $USERID:$USERID --make-pidfile --pidfile $PIDFILE --startas $DAEMON +start_with_monit() { + start + monit monitor airtime-playout >/dev/null 2>&1 +} + +stop_with_monit() { + monit unmonitor airtime-playout >/dev/null 2>&1 + stop } case "${1:-''}" in @@ -55,12 +58,19 @@ case "${1:-''}" in start echo "Done." ;; - 'start-no-monit') + 'start-with-monit') # restart commands here echo -n "Starting $NAME: " - start_no_monit + start_with_monit echo "Done." ;; + 'stop-with-monit') + # restart commands here + echo -n "Stopping $NAME: " + stop_with_monit + echo "Done." + ;; + 'status') # status commands here /usr/bin/airtime-check-system diff --git a/python_apps/pypo/install/pypo-initialize.py b/python_apps/pypo/install/pypo-initialize.py index 6581eef72..18ab708a0 100644 --- a/python_apps/pypo/install/pypo-initialize.py +++ b/python_apps/pypo/install/pypo-initialize.py @@ -88,8 +88,8 @@ try: if "airtime_service_start" in os.environ and os.environ["airtime_service_start"] == "t": print "* Waiting for pypo processes to start..." - subprocess.call("invoke-rc.d airtime-playout start-no-monit > /dev/null 2>&1", shell=True) - subprocess.call("invoke-rc.d airtime-liquidsoap start-no-monit > /dev/null 2>&1", shell=True) + subprocess.call("invoke-rc.d airtime-playout start > /dev/null 2>&1", shell=True) + subprocess.call("invoke-rc.d airtime-liquidsoap start > /dev/null 2>&1", shell=True) except Exception, e: print e From 08a4802300f6216a652a30142efcb7c2a42b0dae Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 2 Apr 2013 17:37:54 +0100 Subject: [PATCH 048/128] Updated credits file --- CREDITS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 66b86316d..8784503f6 100644 --- a/CREDITS +++ b/CREDITS @@ -25,7 +25,7 @@ Daniel James (daniel.james@sourcefabric.org) Localizations: Albert (French) -Christoph Rombach, Micz Flor (German) +Helmut Müller, Christoph Rombach, Micz Flor (German) Claudia Cruz (Spanish) Katerina Michailidis (Greek) Hoerich (Austrian) From d2455fa9c3c6d40bfbf219c5b1c04a822b27eef6 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 3 Apr 2013 10:51:08 +0100 Subject: [PATCH 049/128] Updated translation credits --- CREDITS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 8784503f6..a78be4701 100644 --- a/CREDITS +++ b/CREDITS @@ -28,7 +28,7 @@ Albert (French) Helmut Müller, Christoph Rombach, Micz Flor (German) Claudia Cruz (Spanish) Katerina Michailidis (Greek) -Hoerich (Austrian) +Erich Pöttinger (Austrian) Luba Sirina (Russian) Luciano De Fazio (Brazilian Portuguese) Sebastian Matuszewski (Polish) From bfb252edf5802214cdf122bd80ea3cedb4d58f65 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 3 Apr 2013 11:40:57 -0400 Subject: [PATCH 050/128] CC-4417: Opus codec support --- python_apps/pypo/airtime-liquidsoap | 5 +- .../pypo/liquidsoap_scripts/ls_lib.liq | 46 +++++++++---------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap b/python_apps/pypo/airtime-liquidsoap index 75821b942..a9cceb58d 100755 --- a/python_apps/pypo/airtime-liquidsoap +++ b/python_apps/pypo/airtime-liquidsoap @@ -9,14 +9,11 @@ api_client_path="/usr/lib/airtime/" ls_path="/usr/bin/airtime-liquidsoap --verbose -f -d" ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq" -exec 2>&1 export PYTHONPATH=${api_client_path} rm -f /etc/airtime/liquidsoap.cfg - cd /usr/lib/airtime/pypo/bin/liquidsoap_scripts python generate_liquidsoap_cfg.py -exec ${ls_path} ${ls_param} - +exec ${ls_path} ${ls_param} 2>&1 # EOF diff --git a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq index 8a6d325eb..09f3d3017 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_lib.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_lib.liq @@ -190,7 +190,7 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de ignore(output_mono(%mp3(bitrate = 320, stereo = false), mean(!source))) end end - else + elsif type == "xxx" then if not icecast_vorbis_metadata then source := add(normalize=false, [amplify(0.00001, noise()), !source]) end @@ -253,69 +253,69 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de else if bitrate == 24 then if stereo then - ignore(output_stereo(%opus(bitrate = 24, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 24, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 24, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 24, channels = 1), mean(!source))) end elsif bitrate == 32 then if stereo then - ignore(output_stereo(%opus(bitrate = 32, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 32, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 32, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 32, channels = 1), mean(!source))) end elsif bitrate == 48 then if stereo then - ignore(output_stereo(%opus(bitrate = 48, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 48, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 48, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 48, channels = 1), mean(!source))) end elsif bitrate == 64 then if stereo then - ignore(output_stereo(%opus(bitrate = 64, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 64, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 64, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 64, channels = 1), mean(!source))) end elsif bitrate == 96 then if stereo then - ignore(output_stereo(%opus(bitrate = 96, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 96, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 96, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 96, channels = 1), mean(!source))) end elsif bitrate == 128 then if stereo then - ignore(output_stereo(%opus(bitrate = 128, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 128, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 128, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 128, channels = 1), mean(!source))) end elsif bitrate == 160 then if stereo then - ignore(output_stereo(%opus(bitrate = 160, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 160, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 160, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 160, channels = 1), mean(!source))) end elsif bitrate == 192 then if stereo then - ignore(output_stereo(%opus(bitrate = 192, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 192, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 192, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 192, channels = 1), mean(!source))) end elsif bitrate == 224 then if stereo then - ignore(output_stereo(%opus(bitrate = 224, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 224, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 224, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 224, channels = 1), mean(!source))) end elsif bitrate == 256 then if stereo then - ignore(output_stereo(%opus(bitrate = 256, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 256, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 256, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 256, channels = 1), mean(!source))) end elsif bitrate == 320 then if stereo then - ignore(output_stereo(%opus(bitrate = 320, stereo = true), !source)) + ignore(output_stereo(%opus(bitrate = 320, channels = 2), !source)) else - ignore(output_mono(%opus(bitrate = 320, stereo = false), mean(!source))) + ignore(output_mono(%opus(bitrate = 320, channels = 1), mean(!source))) end end end From 81dbb17922e75526bb367f19bbb64f907d4648e4 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 3 Apr 2013 11:46:46 -0400 Subject: [PATCH 051/128] CC-4961: Show linking -moved show deletion into show service --- .../controllers/ScheduleController.php | 52 +++----- .../application/services/CalendarService.php | 42 +++++- .../application/services/ShowFormService.php | 1 + .../application/services/ShowService.php | 123 +++++++++++++++++- 4 files changed, 179 insertions(+), 39 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 3a30319e7..02ed93dfa 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -16,14 +16,14 @@ class ScheduleController extends Zend_Controller_Action ->addActionContext('edit-show', 'json') ->addActionContext('move-show', 'json') ->addActionContext('resize-show', 'json') - ->addActionContext('delete-show', 'json') + ->addActionContext('delete-show-instance', 'json') ->addActionContext('show-content-dialog', 'json') ->addActionContext('clear-show', 'json') ->addActionContext('get-current-playlist', 'json') ->addActionContext('remove-group', 'json') ->addActionContext('populate-show-form', 'json') ->addActionContext('populate-repeating-show-instance-form', 'json') - ->addActionContext('cancel-show', 'json') + ->addActionContext('delete-show', 'json') ->addActionContext('cancel-current-show', 'json') ->addActionContext('get-form', 'json') ->addActionContext('upload-to-sound-cloud', 'json') @@ -209,28 +209,17 @@ class ScheduleController extends Zend_Controller_Action } } - public function deleteShowAction() + public function deleteShowInstanceAction() { - $showInstanceId = $this->_getParam('id'); + $instanceId = $this->_getParam('id'); - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); + $service_show = new Application_Service_ShowService(); + $showId = $service_show->deleteShow($instanceId, true); - if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - - try { - $showInstance = new Application_Model_ShowInstance($showInstanceId); - } catch (Exception $e) { - Logging::info($e->getMessage()); - $this->view->show_error = true; - - return false; - } - - $showInstance->delete(); - - $this->view->show_id = $showInstance->getShowId(); + if (!$showId) { + $this->view->show_error = true; } + $this->view->show_id = $showId; } public function uploadToSoundCloudAction() @@ -254,7 +243,6 @@ class ScheduleController extends Zend_Controller_Action public function makeContextMenuAction() { $instanceId = $this->_getParam('instanceId'); - $showId = $this->_getParam('showId'); $service_calendar = new Application_Service_CalendarService($instanceId); @@ -598,25 +586,17 @@ class ScheduleController extends Zend_Controller_Action return $forms; } - public function cancelShowAction() + public function deleteShowAction() { - $user = Application_Model_User::getCurrentUser(); + $instanceId = $this->_getParam('id'); - if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - $showInstanceId = $this->_getParam('id'); + $service_show = new Application_Service_ShowService(); + $showId = $service_show->deleteShow($instanceId); - try { - $showInstance = new Application_Model_ShowInstance($showInstanceId); - } catch (Exception $e) { - $this->view->show_error = true; - - return false; - } - $show = new Application_Model_Show($showInstance->getShowId()); - - $show->cancelShow($showInstance->getShowInstanceStart()); - $this->view->show_id = $showInstance->getShowId(); + if (!$showId) { + $this->view->show_error = true; } + $this->view->show_id = $showId; } public function cancelCurrentShowAction() diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 0d60e8a1f..876b3566a 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -147,12 +147,12 @@ class Application_Service_CalendarService $menu["del"]["items"]["single"] = array( "name"=> _("Delete This Instance"), "icon" => "delete", - "url" => $baseUrl."schedule/delete-show"); + "url" => $baseUrl."schedule/delete-show-instance"); $menu["del"]["items"]["following"] = array( "name"=> _("Delete This Instance and All Following"), "icon" => "delete", - "url" => $baseUrl."schedule/cancel-show"); + "url" => $baseUrl."schedule/delete-show"); } else { $menu["del"] = array( "name"=> _("Delete"), @@ -164,4 +164,42 @@ class Application_Service_CalendarService return $menu; } + /* + * @param $dateTime + * php Datetime object to add deltas to + * + * @param $deltaDay + * php int, delta days show moved + * + * @param $deltaMin + * php int, delta mins show moved + * + * @return $newDateTime + * php DateTime, $dateTime with the added time deltas. + */ + public static function addDeltas($dateTime, $deltaDay, $deltaMin) + { + $newDateTime = clone $dateTime; + + $days = abs($deltaDay); + $mins = abs($deltaMin); + + $dayInterval = new DateInterval("P{$days}D"); + $minInterval = new DateInterval("PT{$mins}M"); + + if ($deltaDay > 0) { + $newDateTime->add($dayInterval); + } elseif ($deltaDay < 0) { + $newDateTime->sub($dayInterval); + } + + if ($deltaMin > 0) { + $newDateTime->add($minInterval); + } elseif ($deltaMin < 0) { + $newDateTime->sub($minInterval); + } + + return $newDateTime; + } + } \ No newline at end of file diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index eaaf4da1d..8240c9488 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -342,6 +342,7 @@ class Application_Service_ShowFormService SELECT starts, ends FROM cc_show_instances WHERE ends > now() at time zone 'UTC' AND show_id = :showId +AND modified_instance = FALSE ORDER BY starts LIMIT 1 SQL; diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 614e28d37..0d99854c2 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -73,7 +73,10 @@ class Application_Service_ShowService } //delete the edited instance from the repeating sequence - CcShowInstancesQuery::create()->findPk($showData["add_show_instance_id"])->delete(); + CcShowInstancesQuery::create() + ->findPk($showData["add_show_instance_id"]) + ->setDbModifiedInstance(true) + ->save(); $con->commit(); Application_Model_RabbitMq::PushSchedule(); @@ -484,6 +487,124 @@ SQL; } + public function deleteShow($instanceId, $singleInstance=false) + { + $service_user = new Application_Service_UserService(); + $currentUser = $service_user->getCurrentUser(); + + $con = Propel::getConnection(); + $con->beginTransaction(); + try { + if (!$currentUser->isAdminOrPM()) { + throw new Exception("Permission denied"); + } + + $ccShowInstance = CcShowInstancesQuery::create() + ->findPk($instanceId); + if (!$ccShowInstance) { + throw new Exception("Could not find show instance"); + } + + $showId = $ccShowInstance->getDbShowId(); + if ($singleInstance) { + $ccShowInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL) + ->filterByDbEnds($ccShowInstance->getDbEnds(), Criteria::LESS_EQUAL) + ->find(); + } else { + $ccShowInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL) + ->find(); + } + + if (gmdate("Y-m-d H:i:s") <= $ccShowInstance->getDbEnds()) { + $this->deleteShowInstances($ccShowInstances, $ccShowInstance->getDbShowId()); + } + + Application_Model_RabbitMq::PushSchedule(); + + $con->commit(); + return $showId; + } catch (Exception $e) { + $con->rollback(); + Logging::info("Delete show instance failed"); + Logging::info($e->getMessage()); + return false; + } + } + + public function deleteShowInstances($ccShowInstances, $showId) + { + foreach ($ccShowInstances as $ccShowInstance) { + $instanceId = $ccShowInstance->getDbId(); + + $ccShowInstance + ->setDbModifiedInstance(true) + ->save(); + + //delete the rebroadcasts of the removed recorded show + if ($ccShowInstance->isRecorded()) { + CcShowInstancesQuery::create() + ->filterByDbOriginalShow($instanceId) + ->delete(); + } + + //delete all files scheduled in cc_schedules table + CcScheduleQuery::create() + ->filterByDbInstanceId($instanceId) + ->delete(); + } + + if ($this->checkToDeleteCcShow($showId)) { + CcShowQuery::create() + ->filterByDbId($showId) + ->delete(); + } + } + + private function checkToDeleteCcShow($showId) + { + // check if there are any non deleted show instances remaining. + $ccShowInstances = CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbModifiedInstance(false) + ->filterByDbRebroadcast(0) + ->find(); + + if ($ccShowInstances->isEmpty()) { + return true; + } + //only 1 show instance left of the show, make it non repeating. + else if (count($ccShowInstances) === 1) { + $ccShowInstance = $ccShowInstances[0]; + + $ccShowDay = CcShowDaysQuery::create() + ->filterByDbShowId($showId) + ->findOne(); + $tz = $ccShowDay->getDbTimezone(); + + $startDate = new DateTime($ccShowInstance->getDbStarts(), new DateTimeZone("UTC")); + $startDate->setTimeZone(new DateTimeZone($tz)); + $endDate = Application_Service_CalendarService::addDeltas($startDate, 1, 0); + + $ccShowDay->setDbFirstShow($startDate->format("Y-m-d")); + $ccShowDay->setDbLastShow($endDate->format("Y-m-d")); + $ccShowDay->setDbStartTime($startDate->format("H:i:s")); + $ccShowDay->setDbRepeatType(-1); + $ccShowDay->save(); + + //remove the old repeating deleted instances. + CcShowInstancesQuery::create() + ->filterByDbShowId($showId) + ->filterByDbModifiedInstance(true) + ->delete(); + } + + return false; + } + private function deleteAllInstances($showId) { $sql = << Date: Wed, 3 Apr 2013 16:21:30 -0400 Subject: [PATCH 052/128] Add comment to schema.xml to indicate what the broadcasted column is of cc_schedule --- airtime_mvc/build/schema.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index b9a8a6951..c8c31b8f2 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -322,6 +322,10 @@ + + @@ -472,4 +478,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index cf73470b9..9d9040164 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -156,6 +156,7 @@ CREATE TABLE "cc_show" "live_stream_using_custom_auth" BOOLEAN default 'f', "live_stream_user" VARCHAR(255), "live_stream_pass" VARCHAR(255), + "linked" BOOLEAN default 'f' NOT NULL, PRIMARY KEY ("id") ); @@ -426,6 +427,7 @@ CREATE TABLE "cc_schedule" "instance_id" INTEGER NOT NULL, "playout_status" INT2 default 1 NOT NULL, "broadcasted" INT2 default 0 NOT NULL, + "stamp_id" INTEGER default 0 NOT NULL, PRIMARY KEY ("id") ); @@ -747,6 +749,35 @@ CREATE TABLE "cc_locale" COMMENT ON TABLE "cc_locale" IS ''; +SET search_path TO public; +----------------------------------------------------------------------------- +-- cc_show_stamp +----------------------------------------------------------------------------- + +DROP TABLE "cc_show_stamp" CASCADE; + + +CREATE TABLE "cc_show_stamp" +( + "id" serial NOT NULL, + "show_id" INTEGER NOT NULL, + "instance_id" INTEGER, + "file_id" INTEGER, + "stream_id" INTEGER, + "block_id" INTEGER, + "playlist_id" INTEGER, + "position" INTEGER NOT NULL, + "clip_length" interval default '00:00:00', + "cue_in" interval default '00:00:00', + "cue_out" interval default '00:00:00', + "fade_in" interval default '00:00:00', + "fade_out" interval default '00:00:00', + PRIMARY KEY ("id") +); + +COMMENT ON TABLE "cc_show_stamp" IS ''; + + SET search_path TO public; ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_owner_fkey" FOREIGN KEY ("owner_id") REFERENCES "cc_subjs" ("id"); @@ -803,3 +834,15 @@ ALTER TABLE "cc_webstream_metadata" ADD CONSTRAINT "cc_schedule_inst_fkey" FOREI ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_timestamp_inst_fkey" FOREIGN KEY ("timestamp_id") REFERENCES "cc_timestamp" ("id") ON DELETE CASCADE; ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_mount_name_inst_fkey" FOREIGN KEY ("mount_name_id") REFERENCES "cc_mount_name" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_show_id_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_stream_id_fkey" FOREIGN KEY ("stream_id") REFERENCES "cc_webstream" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE; From f8dbbe71abff8d40887120fd065787a32ac1b75f Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 11:27:45 -0400 Subject: [PATCH 058/128] increase monit timeout after liquidsoap starts to 30 seconds. --- python_apps/pypo/monit-airtime-liquidsoap.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/monit-airtime-liquidsoap.cfg b/python_apps/pypo/monit-airtime-liquidsoap.cfg index 3b674aec2..388f6c72b 100644 --- a/python_apps/pypo/monit-airtime-liquidsoap.cfg +++ b/python_apps/pypo/monit-airtime-liquidsoap.cfg @@ -5,7 +5,7 @@ check process airtime-liquidsoap with pidfile "/var/run/airtime-liquidsoap.pid" - start program = "/etc/init.d/airtime-liquidsoap start" with timeout 5 seconds + start program = "/etc/init.d/airtime-liquidsoap start" with timeout 30 seconds stop program = "/etc/init.d/airtime-liquidsoap stop" if mem > 600 MB for 3 cycles then restart From 62d1b22fcc27d485b7966990042a17f765406e43 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 5 Apr 2013 12:27:54 -0400 Subject: [PATCH 059/128] CC-4961: Show linking created new cc_show_stamp table --- .../models/airtime/CcShowStamp.php | 18 + .../models/airtime/CcShowStampPeer.php | 18 + .../models/airtime/CcShowStampQuery.php | 18 + .../airtime/map/CcShowStampTableMap.php | 70 + .../models/airtime/om/BaseCcShowStamp.php | 1783 ++++++++++ .../models/airtime/om/BaseCcShowStampPeer.php | 3095 +++++++++++++++++ .../airtime/om/BaseCcShowStampQuery.php | 948 +++++ airtime_mvc/build/schema.xml | 3 +- 8 files changed, 5951 insertions(+), 2 deletions(-) create mode 100644 airtime_mvc/application/models/airtime/CcShowStamp.php create mode 100644 airtime_mvc/application/models/airtime/CcShowStampPeer.php create mode 100644 airtime_mvc/application/models/airtime/CcShowStampQuery.php create mode 100644 airtime_mvc/application/models/airtime/map/CcShowStampTableMap.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php diff --git a/airtime_mvc/application/models/airtime/CcShowStamp.php b/airtime_mvc/application/models/airtime/CcShowStamp.php new file mode 100644 index 000000000..19ced4a05 --- /dev/null +++ b/airtime_mvc/application/models/airtime/CcShowStamp.php @@ -0,0 +1,18 @@ +setName('cc_show_stamp'); + $this->setPhpName('CcShowStamp'); + $this->setClassname('CcShowStamp'); + $this->setPackage('airtime'); + $this->setUseIdGenerator(true); + $this->setPrimaryKeyMethodInfo('cc_show_stamp_id_seq'); + // columns + $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); + $this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null); + $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); + $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); + $this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null); + $this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null); + $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); + $this->addColumn('POSITION', 'DbPosition', 'INTEGER', true, null, null); + $this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('FADE_IN', 'DbFadeIn', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('FADE_OUT', 'DbFadeOut', 'VARCHAR', false, null, '00:00:00'); + // validators + } // initialize() + + /** + * Build the RelationMap objects for this table relationships + */ + public function buildRelations() + { + $this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcWebstream', 'CcWebstream', RelationMap::MANY_TO_ONE, array('stream_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null); + } // buildRelations() + +} // CcShowStampTableMap diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php new file mode 100644 index 000000000..c4e55cf59 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php @@ -0,0 +1,1783 @@ +clip_length = '00:00:00'; + $this->cue_in = '00:00:00'; + $this->cue_out = '00:00:00'; + $this->fade_in = '00:00:00'; + $this->fade_out = '00:00:00'; + } + + /** + * Initializes internal state of BaseCcShowStamp object. + * @see applyDefaults() + */ + public function __construct() + { + parent::__construct(); + $this->applyDefaultValues(); + } + + /** + * Get the [id] column value. + * + * @return int + */ + public function getDbId() + { + return $this->id; + } + + /** + * Get the [show_id] column value. + * + * @return int + */ + public function getDbShowId() + { + return $this->show_id; + } + + /** + * Get the [instance_id] column value. + * + * @return int + */ + public function getDbInstanceId() + { + return $this->instance_id; + } + + /** + * Get the [file_id] column value. + * + * @return int + */ + public function getDbFileId() + { + return $this->file_id; + } + + /** + * Get the [stream_id] column value. + * + * @return int + */ + public function getDbStreamId() + { + return $this->stream_id; + } + + /** + * Get the [block_id] column value. + * + * @return int + */ + public function getDbBlockId() + { + return $this->block_id; + } + + /** + * Get the [playlist_id] column value. + * + * @return int + */ + public function getDbPlaylistId() + { + return $this->playlist_id; + } + + /** + * Get the [position] column value. + * + * @return int + */ + public function getDbPosition() + { + return $this->position; + } + + /** + * Get the [clip_length] column value. + * + * @return string + */ + public function getDbClipLength() + { + return $this->clip_length; + } + + /** + * Get the [cue_in] column value. + * + * @return string + */ + public function getDbCueIn() + { + return $this->cue_in; + } + + /** + * Get the [cue_out] column value. + * + * @return string + */ + public function getDbCueOut() + { + return $this->cue_out; + } + + /** + * Get the [fade_in] column value. + * + * @return string + */ + public function getDbFadeIn() + { + return $this->fade_in; + } + + /** + * Get the [fade_out] column value. + * + * @return string + */ + public function getDbFadeOut() + { + return $this->fade_out; + } + + /** + * Set the value of [id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = CcShowStampPeer::ID; + } + + return $this; + } // setDbId() + + /** + * Set the value of [show_id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbShowId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->show_id !== $v) { + $this->show_id = $v; + $this->modifiedColumns[] = CcShowStampPeer::SHOW_ID; + } + + if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { + $this->aCcShow = null; + } + + return $this; + } // setDbShowId() + + /** + * Set the value of [instance_id] column. + * + * @param int $v new value + * @return CcShowStamp 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[] = CcShowStampPeer::INSTANCE_ID; + } + + if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) { + $this->aCcShowInstances = null; + } + + return $this; + } // setDbInstanceId() + + /** + * Set the value of [file_id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbFileId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->file_id !== $v) { + $this->file_id = $v; + $this->modifiedColumns[] = CcShowStampPeer::FILE_ID; + } + + if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { + $this->aCcFiles = null; + } + + return $this; + } // setDbFileId() + + /** + * Set the value of [stream_id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbStreamId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->stream_id !== $v) { + $this->stream_id = $v; + $this->modifiedColumns[] = CcShowStampPeer::STREAM_ID; + } + + if ($this->aCcWebstream !== null && $this->aCcWebstream->getDbId() !== $v) { + $this->aCcWebstream = null; + } + + return $this; + } // setDbStreamId() + + /** + * Set the value of [block_id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbBlockId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->block_id !== $v) { + $this->block_id = $v; + $this->modifiedColumns[] = CcShowStampPeer::BLOCK_ID; + } + + if ($this->aCcBlock !== null && $this->aCcBlock->getDbId() !== $v) { + $this->aCcBlock = null; + } + + return $this; + } // setDbBlockId() + + /** + * Set the value of [playlist_id] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbPlaylistId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->playlist_id !== $v) { + $this->playlist_id = $v; + $this->modifiedColumns[] = CcShowStampPeer::PLAYLIST_ID; + } + + if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { + $this->aCcPlaylist = null; + } + + return $this; + } // setDbPlaylistId() + + /** + * Set the value of [position] column. + * + * @param int $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbPosition($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->position !== $v) { + $this->position = $v; + $this->modifiedColumns[] = CcShowStampPeer::POSITION; + } + + return $this; + } // setDbPosition() + + /** + * Set the value of [clip_length] column. + * + * @param string $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbClipLength($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->clip_length !== $v || $this->isNew()) { + $this->clip_length = $v; + $this->modifiedColumns[] = CcShowStampPeer::CLIP_LENGTH; + } + + return $this; + } // setDbClipLength() + + /** + * Set the value of [cue_in] column. + * + * @param string $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbCueIn($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->cue_in !== $v || $this->isNew()) { + $this->cue_in = $v; + $this->modifiedColumns[] = CcShowStampPeer::CUE_IN; + } + + return $this; + } // setDbCueIn() + + /** + * Set the value of [cue_out] column. + * + * @param string $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbCueOut($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->cue_out !== $v || $this->isNew()) { + $this->cue_out = $v; + $this->modifiedColumns[] = CcShowStampPeer::CUE_OUT; + } + + return $this; + } // setDbCueOut() + + /** + * Set the value of [fade_in] column. + * + * @param string $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbFadeIn($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->fade_in !== $v || $this->isNew()) { + $this->fade_in = $v; + $this->modifiedColumns[] = CcShowStampPeer::FADE_IN; + } + + return $this; + } // setDbFadeIn() + + /** + * Set the value of [fade_out] column. + * + * @param string $v new value + * @return CcShowStamp The current object (for fluent API support) + */ + public function setDbFadeOut($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->fade_out !== $v || $this->isNew()) { + $this->fade_out = $v; + $this->modifiedColumns[] = CcShowStampPeer::FADE_OUT; + } + + return $this; + } // setDbFadeOut() + + /** + * Indicates whether the columns in this object are only set to default values. + * + * This method can be used in conjunction with isModified() to indicate whether an object is both + * modified _and_ has some values set which are non-default. + * + * @return boolean Whether the columns in this object are only been set with default values. + */ + public function hasOnlyDefaultValues() + { + if ($this->clip_length !== '00:00:00') { + return false; + } + + if ($this->cue_in !== '00:00:00') { + return false; + } + + if ($this->cue_out !== '00:00:00') { + return false; + } + + if ($this->fade_in !== '00:00:00') { + return false; + } + + if ($this->fade_out !== '00:00:00') { + return false; + } + + // otherwise, everything was equal, so return TRUE + return true; + } // hasOnlyDefaultValues() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (0-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) + * @param int $startcol 0-based offset column which indicates which restultset column to start with. + * @param boolean $rehydrate Whether this object is being re-hydrated from the database. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate($row, $startcol = 0, $rehydrate = false) + { + try { + + $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 + 2] !== null) ? (int) $row[$startcol + 2] : null; + $this->file_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; + $this->stream_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; + $this->block_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; + $this->playlist_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; + $this->position = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; + $this->clip_length = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; + $this->cue_in = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; + $this->cue_out = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; + $this->fade_in = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; + $this->fade_out = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; + $this->resetModified(); + + $this->setNew(false); + + if ($rehydrate) { + $this->ensureConsistency(); + } + + return $startcol + 13; // 13 = CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating CcShowStamp object", $e); + } + } + + /** + * Checks and repairs the internal consistency of the object. + * + * This method is executed after an already-instantiated object is re-hydrated + * from the database. It exists to check any foreign keys to make sure that + * the objects related to the current object are correct based on foreign key. + * + * You can override this method in the stub class, but you should always invoke + * the base method from the overridden method (i.e. parent::ensureConsistency()), + * in case your model changes. + * + * @throws PropelException + */ + public function ensureConsistency() + { + + if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { + $this->aCcShow = null; + } + if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { + $this->aCcShowInstances = null; + } + if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { + $this->aCcFiles = null; + } + if ($this->aCcWebstream !== null && $this->stream_id !== $this->aCcWebstream->getDbId()) { + $this->aCcWebstream = null; + } + if ($this->aCcBlock !== null && $this->block_id !== $this->aCcBlock->getDbId()) { + $this->aCcBlock = null; + } + if ($this->aCcPlaylist !== null && $this->playlist_id !== $this->aCcPlaylist->getDbId()) { + $this->aCcPlaylist = null; + } + } // ensureConsistency + + /** + * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. + * + * This will only work if the object has been saved and has a valid primary key set. + * + * @param boolean $deep (optional) Whether to also de-associated any related objects. + * @param PropelPDO $con (optional) The PropelPDO connection to use. + * @return void + * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db + */ + public function reload($deep = false, PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("Cannot reload a deleted object."); + } + + if ($this->isNew()) { + throw new PropelException("Cannot reload an unsaved object."); + } + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + // We don't need to alter the object instance pool; we're just modifying this instance + // already in the pool. + + $stmt = CcShowStampPeer::doSelectStmt($this->buildPkeyCriteria(), $con); + $row = $stmt->fetch(PDO::FETCH_NUM); + $stmt->closeCursor(); + if (!$row) { + throw new PropelException('Cannot find matching row in the database to reload object values.'); + } + $this->hydrate($row, 0, true); // rehydrate + + if ($deep) { // also de-associate any related objects? + + $this->aCcShow = null; + $this->aCcShowInstances = null; + $this->aCcFiles = null; + $this->aCcWebstream = null; + $this->aCcBlock = null; + $this->aCcPlaylist = null; + } // if (deep) + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param PropelPDO $con + * @return void + * @throws PropelException + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + try { + $ret = $this->preDelete($con); + if ($ret) { + CcShowStampQuery::create() + ->filterByPrimaryKey($this->getPrimaryKey()) + ->delete($con); + $this->postDelete($con); + $con->commit(); + $this->setDeleted(true); + } else { + $con->commit(); + } + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Persists this object to the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All modified related objects will also be persisted in the doSave() + * method. This method wraps all precipitate database operations in a + * single transaction. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see doSave() + */ + public function save(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + $isInsert = $this->isNew(); + try { + $ret = $this->preSave($con); + if ($isInsert) { + $ret = $ret && $this->preInsert($con); + } else { + $ret = $ret && $this->preUpdate($con); + } + if ($ret) { + $affectedRows = $this->doSave($con); + if ($isInsert) { + $this->postInsert($con); + } else { + $this->postUpdate($con); + } + $this->postSave($con); + CcShowStampPeer::addInstanceToPool($this); + } else { + $affectedRows = 0; + } + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs the work of inserting or updating the row in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see save() + */ + protected function doSave(PropelPDO $con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $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->aCcShow !== null) { + if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { + $affectedRows += $this->aCcShow->save($con); + } + $this->setCcShow($this->aCcShow); + } + + if ($this->aCcShowInstances !== null) { + if ($this->aCcShowInstances->isModified() || $this->aCcShowInstances->isNew()) { + $affectedRows += $this->aCcShowInstances->save($con); + } + $this->setCcShowInstances($this->aCcShowInstances); + } + + if ($this->aCcFiles !== null) { + if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { + $affectedRows += $this->aCcFiles->save($con); + } + $this->setCcFiles($this->aCcFiles); + } + + if ($this->aCcWebstream !== null) { + if ($this->aCcWebstream->isModified() || $this->aCcWebstream->isNew()) { + $affectedRows += $this->aCcWebstream->save($con); + } + $this->setCcWebstream($this->aCcWebstream); + } + + if ($this->aCcBlock !== null) { + if ($this->aCcBlock->isModified() || $this->aCcBlock->isNew()) { + $affectedRows += $this->aCcBlock->save($con); + } + $this->setCcBlock($this->aCcBlock); + } + + if ($this->aCcPlaylist !== null) { + if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { + $affectedRows += $this->aCcPlaylist->save($con); + } + $this->setCcPlaylist($this->aCcPlaylist); + } + + if ($this->isNew() ) { + $this->modifiedColumns[] = CcShowStampPeer::ID; + } + + // If this object has been modified, then save it to the database. + if ($this->isModified()) { + if ($this->isNew()) { + $criteria = $this->buildCriteria(); + if ($criteria->keyContainsValue(CcShowStampPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowStampPeer::ID.')'); + } + + $pk = BasePeer::doInsert($criteria, $con); + $affectedRows += 1; + $this->setDbId($pk); //[IMV] update autoincrement primary key + $this->setNew(false); + } else { + $affectedRows += CcShowStampPeer::doUpdate($this, $con); + } + + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' + } + + $this->alreadyInSave = false; + + } + return $affectedRows; + } // doSave() + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggreagated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $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->aCcShow !== null) { + if (!$this->aCcShow->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); + } + } + + if ($this->aCcShowInstances !== null) { + if (!$this->aCcShowInstances->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcShowInstances->getValidationFailures()); + } + } + + if ($this->aCcFiles !== null) { + if (!$this->aCcFiles->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); + } + } + + if ($this->aCcWebstream !== null) { + if (!$this->aCcWebstream->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcWebstream->getValidationFailures()); + } + } + + if ($this->aCcBlock !== null) { + if (!$this->aCcBlock->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcBlock->getValidationFailures()); + } + } + + if ($this->aCcPlaylist !== null) { + if (!$this->aCcPlaylist->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); + } + } + + + if (($retval = CcShowStampPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcShowStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + $field = $this->getByPosition($pos); + return $field; + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getDbId(); + break; + case 1: + return $this->getDbShowId(); + break; + case 2: + return $this->getDbInstanceId(); + break; + case 3: + return $this->getDbFileId(); + break; + case 4: + return $this->getDbStreamId(); + break; + case 5: + return $this->getDbBlockId(); + break; + case 6: + return $this->getDbPlaylistId(); + break; + case 7: + return $this->getDbPosition(); + break; + case 8: + return $this->getDbClipLength(); + break; + case 9: + return $this->getDbCueIn(); + break; + case 10: + return $this->getDbCueOut(); + break; + case 11: + return $this->getDbFadeIn(); + break; + case 12: + return $this->getDbFadeOut(); + break; + default: + return null; + break; + } // switch() + } + + /** + * Exports the object as an array. + * + * You can specify the key type of the array by passing one of the class + * type constants. + * + * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * Defaults to BasePeer::TYPE_PHPNAME. + * @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 + */ + public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) + { + $keys = CcShowStampPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getDbId(), + $keys[1] => $this->getDbShowId(), + $keys[2] => $this->getDbInstanceId(), + $keys[3] => $this->getDbFileId(), + $keys[4] => $this->getDbStreamId(), + $keys[5] => $this->getDbBlockId(), + $keys[6] => $this->getDbPlaylistId(), + $keys[7] => $this->getDbPosition(), + $keys[8] => $this->getDbClipLength(), + $keys[9] => $this->getDbCueIn(), + $keys[10] => $this->getDbCueOut(), + $keys[11] => $this->getDbFadeIn(), + $keys[12] => $this->getDbFadeOut(), + ); + if ($includeForeignObjects) { + if (null !== $this->aCcShow) { + $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcShowInstances) { + $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcFiles) { + $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcWebstream) { + $result['CcWebstream'] = $this->aCcWebstream->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcBlock) { + $result['CcBlock'] = $this->aCcBlock->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcPlaylist) { + $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true); + } + } + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcShowStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setDbId($value); + break; + case 1: + $this->setDbShowId($value); + break; + case 2: + $this->setDbInstanceId($value); + break; + case 3: + $this->setDbFileId($value); + break; + case 4: + $this->setDbStreamId($value); + break; + case 5: + $this->setDbBlockId($value); + break; + case 6: + $this->setDbPlaylistId($value); + break; + case 7: + $this->setDbPosition($value); + break; + case 8: + $this->setDbClipLength($value); + break; + case 9: + $this->setDbCueIn($value); + break; + case 10: + $this->setDbCueOut($value); + break; + case 11: + $this->setDbFadeIn($value); + break; + case 12: + $this->setDbFadeOut($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * The default key type is the column's phpname (e.g. 'AuthorId') + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = CcShowStampPeer::getFieldNames($keyType); + + 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[2], $arr)) $this->setDbInstanceId($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setDbFileId($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setDbStreamId($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setDbBlockId($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setDbPlaylistId($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setDbPosition($arr[$keys[7]]); + if (array_key_exists($keys[8], $arr)) $this->setDbClipLength($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setDbCueIn($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setDbCueOut($arr[$keys[10]]); + if (array_key_exists($keys[11], $arr)) $this->setDbFadeIn($arr[$keys[11]]); + if (array_key_exists($keys[12], $arr)) $this->setDbFadeOut($arr[$keys[12]]); + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); + + if ($this->isColumnModified(CcShowStampPeer::ID)) $criteria->add(CcShowStampPeer::ID, $this->id); + if ($this->isColumnModified(CcShowStampPeer::SHOW_ID)) $criteria->add(CcShowStampPeer::SHOW_ID, $this->show_id); + if ($this->isColumnModified(CcShowStampPeer::INSTANCE_ID)) $criteria->add(CcShowStampPeer::INSTANCE_ID, $this->instance_id); + if ($this->isColumnModified(CcShowStampPeer::FILE_ID)) $criteria->add(CcShowStampPeer::FILE_ID, $this->file_id); + if ($this->isColumnModified(CcShowStampPeer::STREAM_ID)) $criteria->add(CcShowStampPeer::STREAM_ID, $this->stream_id); + if ($this->isColumnModified(CcShowStampPeer::BLOCK_ID)) $criteria->add(CcShowStampPeer::BLOCK_ID, $this->block_id); + if ($this->isColumnModified(CcShowStampPeer::PLAYLIST_ID)) $criteria->add(CcShowStampPeer::PLAYLIST_ID, $this->playlist_id); + if ($this->isColumnModified(CcShowStampPeer::POSITION)) $criteria->add(CcShowStampPeer::POSITION, $this->position); + if ($this->isColumnModified(CcShowStampPeer::CLIP_LENGTH)) $criteria->add(CcShowStampPeer::CLIP_LENGTH, $this->clip_length); + if ($this->isColumnModified(CcShowStampPeer::CUE_IN)) $criteria->add(CcShowStampPeer::CUE_IN, $this->cue_in); + if ($this->isColumnModified(CcShowStampPeer::CUE_OUT)) $criteria->add(CcShowStampPeer::CUE_OUT, $this->cue_out); + if ($this->isColumnModified(CcShowStampPeer::FADE_IN)) $criteria->add(CcShowStampPeer::FADE_IN, $this->fade_in); + if ($this->isColumnModified(CcShowStampPeer::FADE_OUT)) $criteria->add(CcShowStampPeer::FADE_OUT, $this->fade_out); + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); + $criteria->add(CcShowStampPeer::ID, $this->id); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return int + */ + public function getPrimaryKey() + { + return $this->getDbId(); + } + + /** + * Generic method to set the primary key (id column). + * + * @param int $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setDbId($key); + } + + /** + * Returns true if the primary key for this object is null. + * @return boolean + */ + public function isPrimaryKeyNull() + { + return null === $this->getDbId(); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of CcShowStamp (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false) + { + $copyObj->setDbShowId($this->show_id); + $copyObj->setDbInstanceId($this->instance_id); + $copyObj->setDbFileId($this->file_id); + $copyObj->setDbStreamId($this->stream_id); + $copyObj->setDbBlockId($this->block_id); + $copyObj->setDbPlaylistId($this->playlist_id); + $copyObj->setDbPosition($this->position); + $copyObj->setDbClipLength($this->clip_length); + $copyObj->setDbCueIn($this->cue_in); + $copyObj->setDbCueOut($this->cue_out); + $copyObj->setDbFadeIn($this->fade_in); + $copyObj->setDbFadeOut($this->fade_out); + + $copyObj->setNew(true); + $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return CcShowStamp Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return CcShowStampPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new CcShowStampPeer(); + } + return self::$peer; + } + + /** + * Declares an association between this object and a CcShow object. + * + * @param CcShow $v + * @return CcShowStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcShow(CcShow $v = null) + { + if ($v === null) { + $this->setDbShowId(NULL); + } else { + $this->setDbShowId($v->getDbId()); + } + + $this->aCcShow = $v; + + // 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 ($v !== null) { + $v->addCcShowStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcShow object + * + * @param PropelPDO Optional Connection object. + * @return CcShow The associated CcShow object. + * @throws PropelException + */ + public function getCcShow(PropelPDO $con = null) + { + if ($this->aCcShow === null && ($this->show_id !== null)) { + $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowStamps($this); + */ + } + return $this->aCcShow; + } + + /** + * Declares an association between this object and a CcShowInstances object. + * + * @param CcShowInstances $v + * @return CcShowStamp 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->addCcShowStamp($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->addCcShowStamps($this); + */ + } + return $this->aCcShowInstances; + } + + /** + * Declares an association between this object and a CcFiles object. + * + * @param CcFiles $v + * @return CcShowStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcFiles(CcFiles $v = null) + { + if ($v === null) { + $this->setDbFileId(NULL); + } else { + $this->setDbFileId($v->getDbId()); + } + + $this->aCcFiles = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcFiles object, it will not be re-added. + if ($v !== null) { + $v->addCcShowStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcFiles object + * + * @param PropelPDO Optional Connection object. + * @return CcFiles The associated CcFiles object. + * @throws PropelException + */ + public function getCcFiles(PropelPDO $con = null) + { + if ($this->aCcFiles === null && ($this->file_id !== null)) { + $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcShowStamps($this); + */ + } + return $this->aCcFiles; + } + + /** + * Declares an association between this object and a CcWebstream object. + * + * @param CcWebstream $v + * @return CcShowStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcWebstream(CcWebstream $v = null) + { + if ($v === null) { + $this->setDbStreamId(NULL); + } else { + $this->setDbStreamId($v->getDbId()); + } + + $this->aCcWebstream = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcWebstream object, it will not be re-added. + if ($v !== null) { + $v->addCcShowStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcWebstream object + * + * @param PropelPDO Optional Connection object. + * @return CcWebstream The associated CcWebstream object. + * @throws PropelException + */ + public function getCcWebstream(PropelPDO $con = null) + { + if ($this->aCcWebstream === null && ($this->stream_id !== null)) { + $this->aCcWebstream = CcWebstreamQuery::create()->findPk($this->stream_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->aCcWebstream->addCcShowStamps($this); + */ + } + return $this->aCcWebstream; + } + + /** + * Declares an association between this object and a CcBlock object. + * + * @param CcBlock $v + * @return CcShowStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcBlock(CcBlock $v = null) + { + if ($v === null) { + $this->setDbBlockId(NULL); + } else { + $this->setDbBlockId($v->getDbId()); + } + + $this->aCcBlock = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcBlock object, it will not be re-added. + if ($v !== null) { + $v->addCcShowStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcBlock object + * + * @param PropelPDO Optional Connection object. + * @return CcBlock The associated CcBlock object. + * @throws PropelException + */ + public function getCcBlock(PropelPDO $con = null) + { + if ($this->aCcBlock === null && ($this->block_id !== null)) { + $this->aCcBlock = CcBlockQuery::create()->findPk($this->block_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->aCcBlock->addCcShowStamps($this); + */ + } + return $this->aCcBlock; + } + + /** + * Declares an association between this object and a CcPlaylist object. + * + * @param CcPlaylist $v + * @return CcShowStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcPlaylist(CcPlaylist $v = null) + { + if ($v === null) { + $this->setDbPlaylistId(NULL); + } else { + $this->setDbPlaylistId($v->getDbId()); + } + + $this->aCcPlaylist = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcPlaylist object, it will not be re-added. + if ($v !== null) { + $v->addCcShowStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcPlaylist object + * + * @param PropelPDO Optional Connection object. + * @return CcPlaylist The associated CcPlaylist object. + * @throws PropelException + */ + public function getCcPlaylist(PropelPDO $con = null) + { + if ($this->aCcPlaylist === null && ($this->playlist_id !== null)) { + $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->playlist_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->aCcPlaylist->addCcShowStamps($this); + */ + } + return $this->aCcPlaylist; + } + + /** + * Clears the current object and sets all attributes to their default values + */ + public function clear() + { + $this->id = null; + $this->show_id = null; + $this->instance_id = null; + $this->file_id = null; + $this->stream_id = null; + $this->block_id = null; + $this->playlist_id = null; + $this->position = null; + $this->clip_length = null; + $this->cue_in = null; + $this->cue_out = null; + $this->fade_in = null; + $this->fade_out = null; + $this->alreadyInSave = false; + $this->alreadyInValidation = false; + $this->clearAllReferences(); + $this->applyDefaultValues(); + $this->resetModified(); + $this->setNew(true); + $this->setDeleted(false); + } + + /** + * Resets all collections of referencing foreign keys. + * + * This method is a user-space workaround for PHP's inability to garbage collect objects + * with circular references. This is currently necessary when using Propel in certain + * daemon or large-volumne/high-memory operations. + * + * @param boolean $deep Whether to also clear the references on all associated objects. + */ + public function clearAllReferences($deep = false) + { + if ($deep) { + } // if ($deep) + + $this->aCcShow = null; + $this->aCcShowInstances = null; + $this->aCcFiles = null; + $this->aCcWebstream = null; + $this->aCcBlock = null; + $this->aCcPlaylist = null; + } + + /** + * Catches calls to virtual methods + */ + public function __call($name, $params) + { + if (preg_match('/get(\w+)/', $name, $matches)) { + $virtualColumn = $matches[1]; + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + // no lcfirst in php<5.3... + $virtualColumn[0] = strtolower($virtualColumn[0]); + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + } + throw new PropelException('Call to undefined method: ' . $name); + } + +} // BaseCcShowStamp diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php new file mode 100644 index 000000000..fb96eb0a7 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php @@ -0,0 +1,3095 @@ + array ('DbId', 'DbShowId', 'DbInstanceId', 'DbFileId', 'DbStreamId', 'DbBlockId', 'DbPlaylistId', 'DbPosition', 'DbClipLength', 'DbCueIn', 'DbCueOut', 'DbFadeIn', 'DbFadeOut', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbInstanceId', 'dbFileId', 'dbStreamId', 'dbBlockId', 'dbPlaylistId', 'dbPosition', 'dbClipLength', 'dbCueIn', 'dbCueOut', 'dbFadeIn', 'dbFadeOut', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::INSTANCE_ID, self::FILE_ID, self::STREAM_ID, self::BLOCK_ID, self::PLAYLIST_ID, self::POSITION, self::CLIP_LENGTH, self::CUE_IN, self::CUE_OUT, self::FADE_IN, self::FADE_OUT, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'INSTANCE_ID', 'FILE_ID', 'STREAM_ID', 'BLOCK_ID', 'PLAYLIST_ID', 'POSITION', 'CLIP_LENGTH', 'CUE_IN', 'CUE_OUT', 'FADE_IN', 'FADE_OUT', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'instance_id', 'file_id', 'stream_id', 'block_id', 'playlist_id', 'position', 'clip_length', 'cue_in', 'cue_out', 'fade_in', 'fade_out', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) + ); + + /** + * 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, 'DbShowId' => 1, 'DbInstanceId' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbBlockId' => 5, 'DbPlaylistId' => 6, 'DbPosition' => 7, 'DbClipLength' => 8, 'DbCueIn' => 9, 'DbCueOut' => 10, 'DbFadeIn' => 11, 'DbFadeOut' => 12, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbInstanceId' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbBlockId' => 5, 'dbPlaylistId' => 6, 'dbPosition' => 7, 'dbClipLength' => 8, 'dbCueIn' => 9, 'dbCueOut' => 10, 'dbFadeIn' => 11, 'dbFadeOut' => 12, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::INSTANCE_ID => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::BLOCK_ID => 5, self::PLAYLIST_ID => 6, self::POSITION => 7, self::CLIP_LENGTH => 8, self::CUE_IN => 9, self::CUE_OUT => 10, self::FADE_IN => 11, self::FADE_OUT => 12, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'INSTANCE_ID' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'BLOCK_ID' => 5, 'PLAYLIST_ID' => 6, 'POSITION' => 7, 'CLIP_LENGTH' => 8, 'CUE_IN' => 9, 'CUE_OUT' => 10, 'FADE_IN' => 11, 'FADE_OUT' => 12, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'instance_id' => 2, 'file_id' => 3, 'stream_id' => 4, 'block_id' => 5, 'playlist_id' => 6, 'position' => 7, 'clip_length' => 8, 'cue_in' => 9, 'cue_out' => 10, 'fade_in' => 11, 'fade_out' => 12, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) + ); + + /** + * 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. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. CcShowStampPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(CcShowStampPeer::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(CcShowStampPeer::ID); + $criteria->addSelectColumn(CcShowStampPeer::SHOW_ID); + $criteria->addSelectColumn(CcShowStampPeer::INSTANCE_ID); + $criteria->addSelectColumn(CcShowStampPeer::FILE_ID); + $criteria->addSelectColumn(CcShowStampPeer::STREAM_ID); + $criteria->addSelectColumn(CcShowStampPeer::BLOCK_ID); + $criteria->addSelectColumn(CcShowStampPeer::PLAYLIST_ID); + $criteria->addSelectColumn(CcShowStampPeer::POSITION); + $criteria->addSelectColumn(CcShowStampPeer::CLIP_LENGTH); + $criteria->addSelectColumn(CcShowStampPeer::CUE_IN); + $criteria->addSelectColumn(CcShowStampPeer::CUE_OUT); + $criteria->addSelectColumn(CcShowStampPeer::FADE_IN); + $criteria->addSelectColumn(CcShowStampPeer::FADE_OUT); + } else { + $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.SHOW_ID'); + $criteria->addSelectColumn($alias . '.INSTANCE_ID'); + $criteria->addSelectColumn($alias . '.FILE_ID'); + $criteria->addSelectColumn($alias . '.STREAM_ID'); + $criteria->addSelectColumn($alias . '.BLOCK_ID'); + $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); + $criteria->addSelectColumn($alias . '.POSITION'); + $criteria->addSelectColumn($alias . '.CLIP_LENGTH'); + $criteria->addSelectColumn($alias . '.CUE_IN'); + $criteria->addSelectColumn($alias . '.CUE_OUT'); + $criteria->addSelectColumn($alias . '.FADE_IN'); + $criteria->addSelectColumn($alias . '.FADE_OUT'); + } + } + + /** + * 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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::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 CcShowStamp + * @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 = CcShowStampPeer::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 CcShowStampPeer::populateObjects(CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + if (!$criteria->hasSelectClause()) { + $criteria = clone $criteria; + CcShowStampPeer::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 CcShowStamp $value A CcShowStamp object. + * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). + */ + public static function addInstanceToPool(CcShowStamp $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 CcShowStamp object or a primary key value. + */ + public static function removeInstanceFromPool($value) + { + if (Propel::isInstancePoolingEnabled() && $value !== null) { + if (is_object($value) && $value instanceof CcShowStamp) { + $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 CcShowStamp 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 CcShowStamp 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_stamp + * by a foreign key with ON DELETE CASCADE + */ + public static function clearRelatedInstancePool() + { + } + + /** + * 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 = CcShowStampPeer::getOMClass(false); + // populate the object(s) + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj = CcShowStampPeer::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; + CcShowStampPeer::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 (CcShowStamp object, last column rank) + */ + public static function populateObject($row, $startcol = 0) + { + $key = CcShowStampPeer::getPrimaryKeyHashFromRow($row, $startcol); + if (null !== ($obj = CcShowStampPeer::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 + CcShowStampPeer::NUM_COLUMNS; + } else { + $cls = CcShowStampPeer::OM_CLASS; + $obj = new $cls(); + $col = $obj->hydrate($row, $startcol); + CcShowStampPeer::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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::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; + } + + + /** + * 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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinCcWebstream(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinCcBlock(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinCcPlaylist(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcShowStamp 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 CcShowStamp 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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcShowPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 (CcShowStamp) to $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp 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 CcShowStamp 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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcShowInstancesPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 (CcShowStamp) to $obj2 (CcShowInstances) + $obj2->addCcShowStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with their CcFiles 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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcFiles(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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcFilesPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcFilesPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcFilesPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShowStamp) to $obj2 (CcFiles) + $obj2->addCcShowStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with their CcWebstream 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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcWebstream(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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcWebstreamPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcWebstreamPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcWebstreamPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShowStamp) to $obj2 (CcWebstream) + $obj2->addCcShowStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with their CcBlock 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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcBlock(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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcBlockPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcBlockPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcBlockPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShowStamp) to $obj2 (CcBlock) + $obj2->addCcShowStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with their CcPlaylist 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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcPlaylist(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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcPlaylistPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcPlaylistPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcShowStamp) to $obj2 (CcPlaylist) + $obj2->addCcShowStamp($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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcShowStamp 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 CcShowStamp 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); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol8 = $startcol7 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + } // if joined row not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if obj3 loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcShowStamp($obj1); + } // if joined row not null + + // Add objects for joined CcFiles rows + + $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcFilesPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcFilesPeer::addInstanceToPool($obj4, $key4); + } // if obj4 loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) + $obj4->addCcShowStamp($obj1); + } // if joined row not null + + // Add objects for joined CcWebstream rows + + $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcWebstreamPeer::addInstanceToPool($obj5, $key5); + } // if obj5 loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) + $obj5->addCcShowStamp($obj1); + } // if joined row not null + + // Add objects for joined CcBlock rows + + $key6 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcBlockPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcBlockPeer::addInstanceToPool($obj6, $key6); + } // if obj6 loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcBlock) + $obj6->addCcShowStamp($obj1); + } // if joined row not null + + // Add objects for joined CcPlaylist rows + + $key7 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol7); + if ($key7 !== null) { + $obj7 = CcPlaylistPeer::getInstanceFromPool($key7); + if (!$obj7) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj7 = new $cls(); + $obj7->hydrate($row, $startcol7); + CcPlaylistPeer::addInstanceToPool($obj7, $key7); + } // if obj7 loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj7 (CcPlaylist) + $obj7->addCcShowStamp($obj1); + } // if joined row not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * 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 doCountJoinAllExceptCcShow(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * 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 doCountJoinAllExceptCcShowInstances(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinAllExceptCcWebstream(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinAllExceptCcBlock(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinAllExceptCcPlaylist(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(CcShowStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcShowStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::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 CcShowStamp objects pre-filled with all related objects except CcShow. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShowInstances) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcFiles) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) + $obj6->addCcShowStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcShowInstances. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcFiles) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) + $obj6->addCcShowStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcFiles. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) + $obj6->addCcShowStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcWebstream. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcWebstream(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcFilesPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcFilesPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) + $obj6->addCcShowStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcBlock. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcBlock(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcFilesPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcFilesPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcWebstreamPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) + $obj6->addCcShowStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcPlaylist. + * + * @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 CcShowStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcShowStampPeer::addSelectColumns($criteria); + $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcShowStampPeer::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 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) + $obj2->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcFilesPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcFilesPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) + $obj4->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcWebstreamPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) + $obj5->addCcShowStamp($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key6 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcBlockPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcBlockPeer::addInstanceToPool($obj6, $key6); + } // if $obj6 already loaded + + // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcBlock) + $obj6->addCcShowStamp($obj1); + + } // if joined row is 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(BaseCcShowStampPeer::DATABASE_NAME); + if (!$dbMap->hasTable(BaseCcShowStampPeer::TABLE_NAME)) + { + $dbMap->addTableObject(new CcShowStampTableMap()); + } + } + + /** + * 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 ? CcShowStampPeer::CLASS_DEFAULT : CcShowStampPeer::OM_CLASS; + } + + /** + * Method perform an INSERT on the database, given a CcShowStamp or Criteria object. + * + * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from CcShowStamp object + } + + if ($criteria->containsKey(CcShowStampPeer::ID) && $criteria->keyContainsValue(CcShowStampPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowStampPeer::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 CcShowStamp or Criteria object. + * + * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(CcShowStampPeer::ID); + $value = $criteria->remove(CcShowStampPeer::ID); + if ($value) { + $selectCriteria->add(CcShowStampPeer::ID, $value, $comparison); + } else { + $selectCriteria->setPrimaryTableName(CcShowStampPeer::TABLE_NAME); + } + + } else { // $values is CcShowStamp 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_stamp 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(CcShowStampPeer::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(CcShowStampPeer::TABLE_NAME, $con, CcShowStampPeer::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). + CcShowStampPeer::clearInstancePool(); + CcShowStampPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a CcShowStamp or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::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. + CcShowStampPeer::clearInstancePool(); + // rename for clarity + $criteria = clone $values; + } elseif ($values instanceof CcShowStamp) { // it's a model object + // invalidate the cache for this single object + CcShowStampPeer::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(CcShowStampPeer::ID, (array) $values, Criteria::IN); + // invalidate the cache for this object(s) + foreach ((array) $values as $singleval) { + CcShowStampPeer::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); + CcShowStampPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Validates all modified columns of given CcShowStamp 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 CcShowStamp $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(CcShowStamp $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(CcShowStampPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, CcShowStampPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param int $pk the primary key. + * @param PropelPDO $con the connection to use + * @return CcShowStamp + */ + public static function retrieveByPK($pk, PropelPDO $con = null) + { + + if (null !== ($obj = CcShowStampPeer::getInstanceFromPool((string) $pk))) { + return $obj; + } + + if ($con === null) { + $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); + $criteria->add(CcShowStampPeer::ID, $pk); + + $v = CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); + $criteria->add(CcShowStampPeer::ID, $pks, Criteria::IN); + $objs = CcShowStampPeer::doSelect($criteria, $con); + } + return $objs; + } + +} // BaseCcShowStampPeer + +// This is the static code needed to register the TableMap for this table with the main Propel class. +// +BaseCcShowStampPeer::buildTableMap(); + diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php new file mode 100644 index 000000000..dacdcbffa --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php @@ -0,0 +1,948 @@ +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 + * + * $obj = $c->findPk(12, $con); + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con an optional connection object + * + * @return CcShowStamp|array|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ((null !== ($obj = CcShowStampPeer::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 + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + return $this->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + return $this->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery 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(CcShowStampPeer::ID, $dbId, $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 CcShowStampQuery 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(CcShowStampPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbShowId['max'])) { + $this->addUsingAlias(CcShowStampPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::SHOW_ID, $dbShowId, $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 CcShowStampQuery 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(CcShowStampPeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbInstanceId['max'])) { + $this->addUsingAlias(CcShowStampPeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::INSTANCE_ID, $dbInstanceId, $comparison); + } + + /** + * Filter the query on the file_id column + * + * @param int|array $dbFileId 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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbFileId($dbFileId = null, $comparison = null) + { + if (is_array($dbFileId)) { + $useMinMax = false; + if (isset($dbFileId['min'])) { + $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbFileId['max'])) { + $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId, $comparison); + } + + /** + * Filter the query on the stream_id column + * + * @param int|array $dbStreamId 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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbStreamId($dbStreamId = null, $comparison = null) + { + if (is_array($dbStreamId)) { + $useMinMax = false; + if (isset($dbStreamId['min'])) { + $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbStreamId['max'])) { + $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId, $comparison); + } + + /** + * Filter the query on the block_id column + * + * @param int|array $dbBlockId 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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbBlockId($dbBlockId = null, $comparison = null) + { + if (is_array($dbBlockId)) { + $useMinMax = false; + if (isset($dbBlockId['min'])) { + $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbBlockId['max'])) { + $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId, $comparison); + } + + /** + * Filter the query on the playlist_id column + * + * @param int|array $dbPlaylistId 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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) + { + if (is_array($dbPlaylistId)) { + $useMinMax = false; + if (isset($dbPlaylistId['min'])) { + $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbPlaylistId['max'])) { + $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId, $comparison); + } + + /** + * Filter the query on the position column + * + * @param int|array $dbPosition The value to use as filter. + * Accepts an associative array('min' => $minValue, 'max' => $maxValue) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbPosition($dbPosition = null, $comparison = null) + { + if (is_array($dbPosition)) { + $useMinMax = false; + if (isset($dbPosition['min'])) { + $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbPosition['max'])) { + $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition, $comparison); + } + + /** + * Filter the query on the clip_length column + * + * @param string $dbClipLength The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbClipLength($dbClipLength = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbClipLength)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbClipLength)) { + $dbClipLength = str_replace('*', '%', $dbClipLength); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcShowStampPeer::CLIP_LENGTH, $dbClipLength, $comparison); + } + + /** + * Filter the query on the cue_in column + * + * @param string $dbCueIn The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbCueIn($dbCueIn = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbCueIn)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbCueIn)) { + $dbCueIn = str_replace('*', '%', $dbCueIn); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcShowStampPeer::CUE_IN, $dbCueIn, $comparison); + } + + /** + * Filter the query on the cue_out column + * + * @param string $dbCueOut The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbCueOut($dbCueOut = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbCueOut)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbCueOut)) { + $dbCueOut = str_replace('*', '%', $dbCueOut); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcShowStampPeer::CUE_OUT, $dbCueOut, $comparison); + } + + /** + * Filter the query on the fade_in column + * + * @param string $dbFadeIn The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbFadeIn($dbFadeIn = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbFadeIn)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbFadeIn)) { + $dbFadeIn = str_replace('*', '%', $dbFadeIn); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcShowStampPeer::FADE_IN, $dbFadeIn, $comparison); + } + + /** + * Filter the query on the fade_out column + * + * @param string $dbFadeOut The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByDbFadeOut($dbFadeOut = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbFadeOut)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbFadeOut)) { + $dbFadeOut = str_replace('*', '%', $dbFadeOut); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcShowStampPeer::FADE_OUT, $dbFadeOut, $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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcShow($ccShow, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery 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 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 CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcShowInstances($ccShowInstances, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery The current query, for fluid interface + */ + public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) + { + return $this + ->joinCcShowInstances($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery'); + } + + /** + * Filter the query by a related CcFiles object + * + * @param CcFiles $ccFiles the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcFiles($ccFiles, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::FILE_ID, $ccFiles->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcFiles relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcFiles'); + + // 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, 'CcFiles'); + } + + return $this; + } + + /** + * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query + */ + public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcFiles($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); + } + + /** + * Filter the query by a related CcWebstream object + * + * @param CcWebstream $ccWebstream the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcWebstream($ccWebstream, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::STREAM_ID, $ccWebstream->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcWebstream relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function joinCcWebstream($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcWebstream'); + + // 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, 'CcWebstream'); + } + + return $this; + } + + /** + * Use the CcWebstream relation CcWebstream 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 CcWebstreamQuery A secondary query class using the current class as primary query + */ + public function useCcWebstreamQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcWebstream($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcWebstream', 'CcWebstreamQuery'); + } + + /** + * Filter the query by a related CcBlock object + * + * @param CcBlock $ccBlock the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcBlock($ccBlock, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcBlock relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcBlock'); + + // 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, 'CcBlock'); + } + + return $this; + } + + /** + * Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query + */ + public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcBlock($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery'); + } + + /** + * Filter the query by a related CcPlaylist object + * + * @param CcPlaylist $ccPlaylist the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function filterByCcPlaylist($ccPlaylist, $comparison = null) + { + return $this + ->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcPlaylist relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcPlaylist'); + + // 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, 'CcPlaylist'); + } + + return $this; + } + + /** + * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query + */ + public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcPlaylist($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); + } + + /** + * Exclude object from result + * + * @param CcShowStamp $ccShowStamp Object to remove from the list of results + * + * @return CcShowStampQuery The current query, for fluid interface + */ + public function prune($ccShowStamp = null) + { + if ($ccShowStamp) { + $this->addUsingAlias(CcShowStampPeer::ID, $ccShowStamp->getDbId(), Criteria::NOT_EQUAL); + } + + return $this; + } + +} // BaseCcShowStampQuery diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index c16063ad9..2633c2938 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -341,10 +341,9 @@ - + From 266823b1d9752b0cdc684dc2b4a2305afa5cf7e7 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 12:42:05 -0400 Subject: [PATCH 060/128] use sigkill immediately for unresponsive telnet --- python_apps/pypo/airtime-liquidsoap-init-d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 2710489c1..496dd2e60 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -30,7 +30,7 @@ start () { stop () { #send term signal after 10 seconds - timeout -k 5 10 /usr/lib/airtime/airtime_virtualenv/bin/python \ + timeout 10s -s 9 /usr/lib/airtime/airtime_virtualenv/bin/python \ /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py # Send TERM after 5 seconds, wait at most 30 seconds. start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE From cdb53048c7007ff09c30edb89c8a0831cc5e9578 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 13:56:41 -0400 Subject: [PATCH 061/128] ensure that an empty listener stats dict is not sent to the server --- python_apps/pypo/listenerstat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/listenerstat.py b/python_apps/pypo/listenerstat.py index 1a7bb27b1..0bb06357b 100644 --- a/python_apps/pypo/listenerstat.py +++ b/python_apps/pypo/listenerstat.py @@ -51,7 +51,7 @@ class ListenerStat(Thread): dom = xml.dom.minidom.parseString(document) sources = dom.getElementsByTagName("source") - mount_stats = {} + mount_stats = None for s in sources: #drop the leading '/' character mount_name = s.getAttribute("mount")[1:] @@ -97,7 +97,8 @@ class ListenerStat(Thread): if v["enable"] == 'true': try: if v["output"] == "icecast": - stats.append(self.get_icecast_stats(v)) + mount_stats = self.get_icecast_stats(v) + if mount_stats: stats.append(mount_stats) else: stats.append(self.get_shoutcast_stats(v)) self.update_listener_stat_error(v["mount"], 'OK') From afb55c7b518b1bee61470bfea0dc58ef9d63aeb1 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 14:20:34 -0400 Subject: [PATCH 062/128] CC-5038: Silan error: list index out of range cosmetic bug fix to prevent so much logging --- python_apps/pypo/media/update/silananalyzer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/media/update/silananalyzer.py b/python_apps/pypo/media/update/silananalyzer.py index 4d93deddf..0e8f14027 100644 --- a/python_apps/pypo/media/update/silananalyzer.py +++ b/python_apps/pypo/media/update/silananalyzer.py @@ -47,8 +47,9 @@ class SilanAnalyzer(Thread): proc = subprocess.Popen(command, stdout=subprocess.PIPE) out = proc.communicate()[0].strip('\r\n') info = json.loads(out) - data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) - data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + if len(info['sound']) >= 2: + data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) + data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) except Exception, e: self.logger.error(str(command)) self.logger.error(e) From d1f655d79d0d0e4edb575ea0449e39e622a73b85 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 15:32:44 -0400 Subject: [PATCH 063/128] CC-5038: Silan error: list index out of range -fixed --- .../application/controllers/ApiController.php | 6 +++--- python_apps/pypo/media/update/replaygainupdater.py | 3 ++- python_apps/pypo/media/update/silananalyzer.py | 12 +++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 88aa95e60..f4024c8a0 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -971,14 +971,14 @@ class ApiController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(true); $request = $this->getRequest(); - $data = json_decode($request->getParam('data')); + $data = json_decode($request->getParam('data'), $assoc = true); foreach ($data as $pair) { list($id, $info) = $pair; // TODO : move this code into model -- RG - $cuein = $info->cuein; - $cueout = $info->cueout; $file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm(); + $cuein = isset($info['cuein']) ? $info['cuein'] : 0; + $cueout = isset($info['cueout']) ? $info['cueout'] : $file->getDbLength(); $file->setDbCuein($cuein); $file->setDbCueout($cueout); $file->setDbSilanCheck(true); diff --git a/python_apps/pypo/media/update/replaygainupdater.py b/python_apps/pypo/media/update/replaygainupdater.py index 5466e30ce..daf63d54d 100644 --- a/python_apps/pypo/media/update/replaygainupdater.py +++ b/python_apps/pypo/media/update/replaygainupdater.py @@ -58,7 +58,8 @@ class ReplayGainUpdater(Thread): total += 1 try: - self.api_client.update_replay_gain_values(processed_data) + if len(processed_data): + self.api_client.update_replay_gain_values(processed_data) except Exception as e: self.logger.error(e) self.logger.debug(traceback.format_exc()) diff --git a/python_apps/pypo/media/update/silananalyzer.py b/python_apps/pypo/media/update/silananalyzer.py index 0e8f14027..03441d614 100644 --- a/python_apps/pypo/media/update/silananalyzer.py +++ b/python_apps/pypo/media/update/silananalyzer.py @@ -45,11 +45,13 @@ class SilanAnalyzer(Thread): command = ['nice', '-n', '19', 'silan', '-b', '-f', 'JSON', full_path] try: proc = subprocess.Popen(command, stdout=subprocess.PIPE) - out = proc.communicate()[0].strip('\r\n') - info = json.loads(out) - if len(info['sound']) >= 2: - data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) - data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + comm = proc.communicate() + if len(comm): + out = comm[0].strip('\r\n') + info = json.loads(out) + if len(info['sound']) >= 2: + data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) + data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) except Exception, e: self.logger.error(str(command)) self.logger.error(e) From 5ff7ce857f80111e8105cd9e883458a2bf8e22c1 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 15:57:16 -0400 Subject: [PATCH 064/128] use sigkill immediately for unresponsive telnet -fix order of arguments --- python_apps/pypo/airtime-liquidsoap-init-d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 496dd2e60..26d8e3d2b 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -30,7 +30,7 @@ start () { stop () { #send term signal after 10 seconds - timeout 10s -s 9 /usr/lib/airtime/airtime_virtualenv/bin/python \ + timeout -s9 10s /usr/lib/airtime/airtime_virtualenv/bin/python \ /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py # Send TERM after 5 seconds, wait at most 30 seconds. start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE From 3d135a9f4a475d913e8495e29d14ff78cdfe6906 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 17:31:55 -0400 Subject: [PATCH 065/128] improved logging on why files sometimes aren't removed --- python_apps/pypo/pypofetch.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 535d0fa99..7c50b4e2d 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -9,6 +9,7 @@ import telnetlib import copy from threading import Thread import subprocess +import traceback from Queue import Empty @@ -119,7 +120,6 @@ class PypoFetch(Thread): self.listener_timeout = 0 self.logger.info("New timeout: %s" % self.listener_timeout) except Exception, e: - import traceback top = traceback.format_exc() self.logger.error('Exception: %s', e) self.logger.error("traceback: %s", top) @@ -536,8 +536,12 @@ class PypoFetch(Thread): #being incorrect!) if not self.is_file_opened(path): os.remove(path) + self.logger.info("File '%s' removed" % path) + else: + self.logger.info("File '%s' not removed. Still busy!" % path) except Exception, e: - self.logger.error(e) + self.logger.error("Problem removing file '%s'" % f) + self.logger.error(traceback.format_exc()) def manual_schedule_fetch(self): success, self.schedule_data = self.api_client.get_schedule() @@ -588,7 +592,6 @@ class PypoFetch(Thread): self.logger.info("Queue timeout. Fetching schedule manually") self.persistent_manual_schedule_fetch(max_attempts=5) except Exception, e: - import traceback top = traceback.format_exc() self.logger.error('Exception: %s', e) self.logger.error("traceback: %s", top) From cfee74693b2e5a9bcd0c06f0758b404e1934766b Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 5 Apr 2013 17:44:30 -0400 Subject: [PATCH 066/128] CC-4961: Show linking moved move-show to calendar service --- .../controllers/ScheduleController.php | 20 +-- .../application/services/CalendarService.php | 153 ++++++++++++++++-- .../application/services/SchedulerService.php | 39 +++-- airtime_mvc/build/schema.xml | 4 +- 4 files changed, 168 insertions(+), 48 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 02ed93dfa..e9a97b788 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -163,22 +163,16 @@ class ScheduleController extends Zend_Controller_Action { $deltaDay = $this->_getParam('day'); $deltaMin = $this->_getParam('min'); - $showInstanceId = $this->_getParam('showInstanceId'); - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - - if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - try { - $showInstance = new Application_Model_ShowInstance($showInstanceId); - } catch (Exception $e) { - $this->view->show_error = true; - - return false; - } - $error = $showInstance->moveShow($deltaDay, $deltaMin); + try { + $service_calendar = new Application_Service_CalendarService( + $this->_getParam('showInstanceId')); + } catch (Exception $e) { + $this->view->show_error = true; + return false; } + $error = $service_calendar->moveShow($deltaDay, $deltaMin); if (isset($error)) { $this->view->error = $error; } diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 876b3566a..1c963fc45 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -4,13 +4,16 @@ class Application_Service_CalendarService { private $currentUser; private $ccShowInstance; - private $showId; + private $ccShow; public function __construct($instanceId = null) { if (!is_null($instanceId)) { $this->ccShowInstance = CcShowInstancesQuery::create()->findPk($instanceId); - $this->showId = $this->ccShowInstance->getDbShowId(); + if (is_null($this->ccShowInstance)) { + throw new Exception("Instance does not exist"); + } + $this->ccShow = $this->ccShowInstance->getCcShow(); } $service_user = new Application_Service_UserService(); @@ -27,7 +30,7 @@ class Application_Service_CalendarService $now = time(); $baseUrl = Application_Common_OsPath::getBaseDir(); $isAdminOrPM = $this->currentUser->isAdminOrPM(); - $isHostOfShow = $this->currentUser->isHostOfShow($this->showId); + $isHostOfShow = $this->currentUser->isHostOfShow($this->ccShow->getDbId()); //DateTime objects in UTC $startDT = $this->ccShowInstance->getDbStarts(null); @@ -108,7 +111,7 @@ class Application_Service_CalendarService } } - $isRepeating = $this->ccShowInstance->getCcShow()->getFirstCcShowDay()->isRepeating(); + $isRepeating = $this->ccShow->getFirstCcShowDay()->isRepeating(); if (!$this->ccShowInstance->isRebroadcast()) { if ($isRepeating) { $menu["edit"] = array( @@ -164,18 +167,12 @@ class Application_Service_CalendarService return $menu; } - /* - * @param $dateTime - * php Datetime object to add deltas to - * - * @param $deltaDay - * php int, delta days show moved - * - * @param $deltaMin - * php int, delta mins show moved - * - * @return $newDateTime - * php DateTime, $dateTime with the added time deltas. + /** + * + * Enter description here ... + * @param DateTime $dateTime object to add deltas to + * @param int $deltaDay delta days show moved + * @param int $deltaMin delta minutes show moved */ public static function addDeltas($dateTime, $deltaDay, $deltaMin) { @@ -202,4 +199,128 @@ class Application_Service_CalendarService return $newDateTime; } + private function validateShowMove($deltaDay, $deltaMin) + { + if (!$this->currentUser->isAdminOrPM()) { + throw new Exception(_("Permission denied")); + } + + if ($this->ccShow->getFirstCcShowDay()->isRepeating()) { + throw new Exception(_("Can't drag and drop repeating shows")); + } + + $today_timestamp = time(); + + $startsDateTime = new DateTime($this->ccShowInstance->getDbStarts(), new DateTimeZone("UTC")); + $endsDateTime = new DateTime($this->ccShowInstance->getDbEnds(), new DateTimeZone("UTC")); + + if ($today_timestamp > $startsDateTime->getTimestamp()) { + throw new Exception(_("Can't move a past show")); + } + + //the user is moving the show on the calendar from the perspective of local time. + //incase a show is moved across a time change border offsets should be added to the localtime + //stamp and then converted back to UTC to avoid show time changes! + $localTimezone = Application_Model_Preference::GetTimezone(); + $startsDateTime->setTimezone(new DateTimeZone($localTimezone)); + $endsDateTime->setTimezone(new DateTimeZone($localTimezone)); + + $newStartsDateTime = self::addDeltas($startsDateTime, $deltaDay, $deltaMin); + $newEndsDateTime = self::addDeltas($endsDateTime, $deltaDay, $deltaMin); + + //convert our new starts/ends to UTC. + $newStartsDateTime->setTimezone(new DateTimeZone("UTC")); + $newEndsDateTime->setTimezone(new DateTimeZone("UTC")); + + if ($today_timestamp > $newStartsDateTime->getTimestamp()) { + throw new Exception(_("Can't move show into past")); + } + + //check if show is overlapping + $overlapping = Application_Model_Schedule::checkOverlappingShows( + $newStartsDateTime, $newEndsDateTime, true, $this->ccShowInstance->getDbId()); + if ($overlapping) { + throw new Exception(_("Cannot schedule overlapping shows")); + } + + if ($this->ccShow->isRecorded()) { + //rebroadcasts should start at max 1 hour after a recorded show has ended. + $minRebroadcastStart = self::addDeltas($newEndsDateTime, 0, 60); + //check if we are moving a recorded show less than 1 hour before any of its own rebroadcasts. + $rebroadcasts = CcShowInstancesQuery::create() + ->filterByDbOriginalShow($this->_instanceId) + ->filterByDbStarts($minRebroadcastStart->format('Y-m-d H:i:s'), Criteria::LESS_THAN) + ->find(); + + if (count($rebroadcasts) > 0) { + throw new Exception(_("Can't move a recorded show less than 1 hour before its rebroadcasts.")); + } + } + + if ($this->ccShow->isRebroadcast()) { + $recordedShow = CcShowInstancesQuery::create()->findPk( + $this->ccShowInstance->getDbOriginalShow()); + if (is_null($recordedShow)) { + $this->ccShowInstance->delete(); + throw new Exception(_("Show was deleted because recorded show does not exist!")); + } + + $recordEndDateTime = new DateTime($recordedShow->getDbEnds(), new DateTimeZone("UTC")); + $newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60); + + if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) { + throw new Exception(_("Must wait 1 hour to rebroadcast.")); + } + } + return array($newStartsDateTime, $newEndsDateTime); + } + + public function moveShow($deltaDay, $deltaMin) + { + try { + $con = Propel::getConnection(); + $con->beginTransaction(); + + list($newStartsDateTime, $newEndsDateTime) = $this->validateShowMove( + $deltaDay, $deltaMin); + + $this->ccShowInstance + ->setDbStarts($newStartsDateTime) + ->setDbEnds($newEndsDateTime) + ->save(); + + if (!$this->ccShowInstance->getCcShow()->isRebroadcast()) { + //we can get the first show day because we know the show is + //not repeating, and therefore will only have one show day entry + $ccShowDay = $this->ccShow->getFirstCcShowDay(); + $ccShowDay + ->setDbFirstShow($newStartsDateTime) + ->setDbLastShow($newEndsDateTime) + ->save(); + } + + Application_Service_SchedulerService::updateScheduleStartTime( + array($this->ccShowInstance->getDbId()), null, $newStartsDateTime); + + $con->commit(); + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + $con->rollback(); + return $e->getMessage(); + } + } + + public function resizeShow($deltaDay, $deltaMin) + { + try { + $con = Propel::getConnection(); + $con->beginTransaction(); + + $con->commit(); + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + return $e->getMessage(); + } + } + } \ No newline at end of file diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index 5b3fa995e..635569f55 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -44,27 +44,32 @@ class Application_Service_SchedulerService * Enter description here ... * @param array $instanceIds */ - public static function updateScheduleStartTime($instanceIds, $diff) + public static function updateScheduleStartTime($instanceIds, $diff=null, $newStart=null) { $con = Propel::getConnection(); - if (count($instanceIds) > 0 && $diff != 0) { + if (count($instanceIds) > 0) { $showIdList = implode(",", $instanceIds); - /*$sql = << $diff, ':diff2' => $diff, - ':showIds' => $showIdList), - 'execute');*/ - $sql = "UPDATE cc_schedule " - ."SET starts = starts + INTERVAL '$diff sec', " - ."ends = ends + INTERVAL '$diff sec' " - ."WHERE instance_id IN ($showIdList)"; - $con->exec($sql); + if (is_null($diff)) { + $ccSchedule = CcScheduleQuery::create() + ->filterByDbInstanceId($instanceIds, Criteria::IN) + ->orderByDbStarts() + ->limit(1) + ->findOne(); + + if (!is_null($ccSchedule)) { + $scheduleStartsEpoch = strtotime($ccSchedule->getDbStarts()); + $showStartsEpoch = strtotime($newStart->format("Y-m-d H:i:s")); + + $diff = $showStartsEpoch - $scheduleStartsEpoch; + } + + $sql = "UPDATE cc_schedule " + ."SET starts = starts + INTERVAL '$diff sec', " + ."ends = ends + INTERVAL '$diff sec' " + ."WHERE instance_id IN ($showIdList)"; + $con->exec($sql); + } } } diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 2633c2938..49ff7cffa 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -341,9 +341,9 @@ - + From 0d45d7b8cd8995050110a265400ab8786906d145 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 7 Apr 2013 20:19:51 -0400 Subject: [PATCH 067/128] CC-5042: Do process matching by process name instead of PID file -fixed --- python_apps/pypo/airtime-liquidsoap-init-d | 11 ++++++++--- python_apps/pypo/monit-airtime-liquidsoap.cfg | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 26d8e3d2b..be9761f17 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -15,6 +15,7 @@ NAME="Liquidsoap Playout Engine" DAEMON=/usr/lib/airtime/pypo/bin/airtime-liquidsoap PIDFILE=/var/run/airtime-liquidsoap.pid +EXEC='/usr/bin/airtime-liquidsoap' start () { chown pypo:pypo /var/log/airtime/pypo @@ -24,8 +25,10 @@ start () { touch $PIDFILE chown pypo:pypo $PIDFILE + #start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \ + #--pidfile $PIDFILE --nicelevel -15 --startas $DAEMON start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \ - --pidfile $PIDFILE --nicelevel -15 --startas $DAEMON + --nicelevel -15 --startas $DAEMON --exec $EXEC } stop () { @@ -33,9 +36,11 @@ stop () { timeout -s9 10s /usr/lib/airtime/airtime_virtualenv/bin/python \ /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_prepare_terminate.py # Send TERM after 5 seconds, wait at most 30 seconds. - start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE + #start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --pidfile $PIDFILE + start-stop-daemon --stop --oknodo --retry=TERM/10/KILL/5 --quiet --exec $EXEC + rm -f $PIDFILE - sleep 3 + sleep 2 } start_with_monit () { diff --git a/python_apps/pypo/monit-airtime-liquidsoap.cfg b/python_apps/pypo/monit-airtime-liquidsoap.cfg index 388f6c72b..8688251ea 100644 --- a/python_apps/pypo/monit-airtime-liquidsoap.cfg +++ b/python_apps/pypo/monit-airtime-liquidsoap.cfg @@ -3,8 +3,7 @@ set httpd port 2812 - check process airtime-liquidsoap - with pidfile "/var/run/airtime-liquidsoap.pid" + check process airtime-liquidsoap matching "airtime-liquidsoap.*airtime.*ls_script" start program = "/etc/init.d/airtime-liquidsoap start" with timeout 30 seconds stop program = "/etc/init.d/airtime-liquidsoap stop" From 67cdfd4b091fd981110a69f7b473047ea5f64321 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 7 Apr 2013 20:20:14 -0400 Subject: [PATCH 068/128] when doing reinstall, make sure monit isn't restarting services --- install_minimal/airtime-install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 68005f54b..647db6c8b 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -143,6 +143,11 @@ fi #We don't want any of our python services running if we are doing an upgrade/reinstall. #They will be automatically restarted later on. echo "* Temporarily stopping any previous running services" +set +e +monit unmonitor airtime-media-monitor >/dev/null 2>&1 +monit unmonitor airtime-liquidsoap >/dev/null 2>&1 +monit unmonitor airtime-playout >/dev/null 2>&1 +set -e if [ -e /etc/init.d/airtime-media-monitor ]; then invoke-rc.d airtime-media-monitor stop > /dev/null 2>&1 fi From 670566954905cc663c48f87130b2418557b3ee79 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 7 Apr 2013 20:20:21 -0400 Subject: [PATCH 069/128] code cleanup --- install_minimal/include/airtime-uninitialize.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/install_minimal/include/airtime-uninitialize.sh b/install_minimal/include/airtime-uninitialize.sh index c76bcdfd6..50a4ccf70 100755 --- a/install_minimal/include/airtime-uninitialize.sh +++ b/install_minimal/include/airtime-uninitialize.sh @@ -21,13 +21,9 @@ monit unmonitor airtime-liquidsoap >/dev/null 2>&1 monit unmonitor airtime-playout >/dev/null 2>&1 set -e -#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/" -#. ${virtualenv_bin}activate - #uninitialize Airtime services python $AIRTIMEROOT/python_apps/pypo/install/pypo-uninitialize.py python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-uninitialize.py -#python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-uninitialize.py if [ "$purge" = "t" ]; then #call Airtime uninstall script From 76bfce21b12d353028ebfde59429347972386716 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 8 Apr 2013 14:42:37 -0400 Subject: [PATCH 070/128] CC-4961: Show linking -modified db --- .../configs/classmap-airtime-conf.php | 21 +- .../models/airtime/map/CcBlockTableMap.php | 2 +- .../models/airtime/map/CcFilesTableMap.php | 2 +- .../models/airtime/map/CcPlaylistTableMap.php | 2 +- .../airtime/map/CcShowInstancesTableMap.php | 2 +- .../models/airtime/map/CcShowTableMap.php | 2 +- .../airtime/map/CcWebstreamTableMap.php | 2 +- .../models/airtime/om/BaseCcBlock.php | 159 ++++++-------- .../models/airtime/om/BaseCcBlockPeer.php | 4 +- .../models/airtime/om/BaseCcBlockQuery.php | 32 +-- .../models/airtime/om/BaseCcFiles.php | 159 ++++++-------- .../models/airtime/om/BaseCcFilesPeer.php | 4 +- .../models/airtime/om/BaseCcFilesQuery.php | 32 +-- .../models/airtime/om/BaseCcPlaylist.php | 159 ++++++-------- .../models/airtime/om/BaseCcPlaylistPeer.php | 4 +- .../models/airtime/om/BaseCcPlaylistQuery.php | 32 +-- .../models/airtime/om/BaseCcShow.php | 202 +++++------------- .../models/airtime/om/BaseCcShowInstances.php | 202 +++++------------- .../airtime/om/BaseCcShowInstancesPeer.php | 4 +- .../airtime/om/BaseCcShowInstancesQuery.php | 32 +-- .../models/airtime/om/BaseCcShowPeer.php | 4 +- .../models/airtime/om/BaseCcShowQuery.php | 32 +-- .../models/airtime/om/BaseCcWebstream.php | 159 ++++++-------- .../models/airtime/om/BaseCcWebstreamPeer.php | 4 +- .../airtime/om/BaseCcWebstreamQuery.php | 32 +-- airtime_mvc/build/schema.xml | 33 +-- airtime_mvc/build/sql/schema.sql | 44 ++-- 27 files changed, 550 insertions(+), 816 deletions(-) diff --git a/airtime_mvc/application/configs/classmap-airtime-conf.php b/airtime_mvc/application/configs/classmap-airtime-conf.php index 9eacbf563..7f5e03d42 100644 --- a/airtime_mvc/application/configs/classmap-airtime-conf.php +++ b/airtime_mvc/application/configs/classmap-airtime-conf.php @@ -204,11 +204,18 @@ return array ( 'BaseCcLocalePeer' => 'airtime/om/BaseCcLocalePeer.php', 'BaseCcLocale' => 'airtime/om/BaseCcLocale.php', 'BaseCcLocaleQuery' => 'airtime/om/BaseCcLocaleQuery.php', - 'CcShowStampTableMap' => 'airtime/map/CcShowStampTableMap.php', - 'CcShowStampPeer' => 'airtime/CcShowStampPeer.php', - 'CcShowStamp' => 'airtime/CcShowStamp.php', - 'CcShowStampQuery' => 'airtime/CcShowStampQuery.php', - 'BaseCcShowStampPeer' => 'airtime/om/BaseCcShowStampPeer.php', - 'BaseCcShowStamp' => 'airtime/om/BaseCcShowStamp.php', - 'BaseCcShowStampQuery' => 'airtime/om/BaseCcShowStampQuery.php', + 'CcStampContentsTableMap' => 'airtime/map/CcStampContentsTableMap.php', + 'CcStampContentsPeer' => 'airtime/CcStampContentsPeer.php', + 'CcStampContents' => 'airtime/CcStampContents.php', + 'CcStampContentsQuery' => 'airtime/CcStampContentsQuery.php', + 'BaseCcStampContentsPeer' => 'airtime/om/BaseCcStampContentsPeer.php', + 'BaseCcStampContents' => 'airtime/om/BaseCcStampContents.php', + 'BaseCcStampContentsQuery' => 'airtime/om/BaseCcStampContentsQuery.php', + 'CcStampTableMap' => 'airtime/map/CcStampTableMap.php', + 'CcStampPeer' => 'airtime/CcStampPeer.php', + 'CcStamp' => 'airtime/CcStamp.php', + 'CcStampQuery' => 'airtime/CcStampQuery.php', + 'BaseCcStampPeer' => 'airtime/om/BaseCcStampPeer.php', + 'BaseCcStamp' => 'airtime/om/BaseCcStamp.php', + 'BaseCcStampQuery' => 'airtime/om/BaseCcStampQuery.php', ); \ No newline at end of file diff --git a/airtime_mvc/application/models/airtime/map/CcBlockTableMap.php b/airtime_mvc/application/models/airtime/map/CcBlockTableMap.php index b5d31f72e..558bb9a6e 100644 --- a/airtime_mvc/application/models/airtime/map/CcBlockTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcBlockTableMap.php @@ -58,7 +58,7 @@ class CcBlockTableMap extends TableMap { $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); $this->addRelation('CcBlockcriteria', 'CcBlockcriteria', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); - $this->addRelation('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); + $this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'block_id', ), 'CASCADE', null); } // buildRelations() /** diff --git a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php index 7f0a33679..295372810 100644 --- a/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcFilesTableMap.php @@ -123,7 +123,7 @@ class CcFilesTableMap extends TableMap { $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); $this->addRelation('CcBlockcontents', 'CcBlockcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - $this->addRelation('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); + $this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); } // buildRelations() } // CcFilesTableMap diff --git a/airtime_mvc/application/models/airtime/map/CcPlaylistTableMap.php b/airtime_mvc/application/models/airtime/map/CcPlaylistTableMap.php index 3ba124cb6..ddaa78192 100644 --- a/airtime_mvc/application/models/airtime/map/CcPlaylistTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcPlaylistTableMap.php @@ -55,7 +55,7 @@ class CcPlaylistTableMap extends TableMap { { $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('creator_id' => 'id', ), 'CASCADE', null); $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null); - $this->addRelation('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null); + $this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null); } // buildRelations() /** diff --git a/airtime_mvc/application/models/airtime/map/CcShowInstancesTableMap.php b/airtime_mvc/application/models/airtime/map/CcShowInstancesTableMap.php index f556b1853..2ecb4f1db 100644 --- a/airtime_mvc/application/models/airtime/map/CcShowInstancesTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcShowInstancesTableMap.php @@ -63,7 +63,7 @@ class CcShowInstancesTableMap extends TableMap { $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); $this->addRelation('CcShowInstancesRelatedByDbId', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); - $this->addRelation('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); + $this->addRelation('CcStamp', 'CcStamp', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); } // buildRelations() } // CcShowInstancesTableMap diff --git a/airtime_mvc/application/models/airtime/map/CcShowTableMap.php b/airtime_mvc/application/models/airtime/map/CcShowTableMap.php index 6acde02cd..ba62c1647 100644 --- a/airtime_mvc/application/models/airtime/map/CcShowTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcShowTableMap.php @@ -62,7 +62,7 @@ class CcShowTableMap extends TableMap { $this->addRelation('CcShowDays', 'CcShowDays', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); $this->addRelation('CcShowRebroadcast', 'CcShowRebroadcast', 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('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); + $this->addRelation('CcStamp', 'CcStamp', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); } // buildRelations() } // CcShowTableMap diff --git a/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php b/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php index 979c7034e..5370e7952 100644 --- a/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcWebstreamTableMap.php @@ -57,7 +57,7 @@ class CcWebstreamTableMap extends TableMap { public function buildRelations() { $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'stream_id', ), 'CASCADE', null); - $this->addRelation('CcShowStamp', 'CcShowStamp', RelationMap::ONE_TO_MANY, array('id' => 'stream_id', ), 'CASCADE', null); + $this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'stream_id', ), 'CASCADE', null); } // buildRelations() } // CcWebstreamTableMap diff --git a/airtime_mvc/application/models/airtime/om/BaseCcBlock.php b/airtime_mvc/application/models/airtime/om/BaseCcBlock.php index 4314af05f..89a9cfbf1 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcBlock.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcBlock.php @@ -96,9 +96,9 @@ abstract class BaseCcBlock extends BaseObject implements Persistent protected $collCcBlockcriterias; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStampContents[] Collection to store aggregation of CcStampContents objects. */ - protected $collCcShowStamps; + protected $collCcStampContentss; /** * Flag to prevent endless save loop, if this object is referenced @@ -617,7 +617,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent $this->collCcBlockcriterias = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; } // if (deep) } @@ -788,8 +788,8 @@ abstract class BaseCcBlock extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -903,8 +903,8 @@ abstract class BaseCcBlock extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1203,9 +1203,9 @@ abstract class BaseCcBlock extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStampContentss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStampContents($relObj->copy($deepCopy)); } } @@ -1706,36 +1706,36 @@ abstract class BaseCcBlock extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStampContentss 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 addCcShowStamps() + * @see addCcStampContentss() */ - public function clearCcShowStamps() + public function clearCcStampContentss() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStampContentss = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStampContentss collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStampContentss collection to an empty array (like clearcollCcStampContentss()); * 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 initCcShowStamps() + public function initCcStampContentss() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStampContentss = new PropelObjectCollection(); + $this->collCcStampContentss->setModel('CcStampContents'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStampContents 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. @@ -1745,44 +1745,44 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStampContentss($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStampContentss(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStampContentss = CcStampContentsQuery::create(null, $criteria) ->filterByCcBlock($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStampContentss; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStampContentss = $collCcStampContentss; } } - return $this->collCcShowStamps; + return $this->collCcStampContentss; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStampContents objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStampContents objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStampContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -1791,25 +1791,25 @@ abstract class BaseCcBlock extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStampContentss); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStampContents object to this object + * through the CcStampContents foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStampContents $l CcStampContents * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStampContents(CcStampContents $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStampContentss === null) { + $this->initCcStampContentss(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStampContentss->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStampContentss[]= $l; $l->setCcBlock($this); } } @@ -1820,7 +1820,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcBlock is new, it will return * an empty collection; or if this CcBlock has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1829,14 +1829,14 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcStamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcStamp', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1845,7 +1845,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcBlock is new, it will return * an empty collection; or if this CcBlock has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1854,39 +1854,14 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcBlock is new, it will return - * an empty collection; or if this CcBlock has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcBlock. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcFiles', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1895,7 +1870,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcBlock is new, it will return * an empty collection; or if this CcBlock has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1904,14 +1879,14 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcWebstream', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1920,7 +1895,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcBlock is new, it will return * an empty collection; or if this CcBlock has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1929,14 +1904,14 @@ abstract class BaseCcBlock extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcPlaylist', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } /** @@ -1988,8 +1963,8 @@ abstract class BaseCcBlock extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStampContentss) { + foreach ((array) $this->collCcStampContentss as $o) { $o->clearAllReferences($deep); } } @@ -1998,7 +1973,7 @@ abstract class BaseCcBlock extends BaseObject implements Persistent $this->collCcPlaylistcontentss = null; $this->collCcBlockcontentss = null; $this->collCcBlockcriterias = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; $this->aCcSubjs = null; } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcBlockPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcBlockPeer.php index a5063dd8b..965069d3b 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcBlockPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcBlockPeer.php @@ -382,9 +382,9 @@ abstract class BaseCcBlockPeer { // Invalidate objects in CcBlockcriteriaPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcBlockcriteriaPeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampContentsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampContentsPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcBlockQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcBlockQuery.php index ac160a1d2..eeecf413f 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcBlockQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcBlockQuery.php @@ -44,9 +44,9 @@ * @method CcBlockQuery rightJoinCcBlockcriteria($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcBlockcriteria relation * @method CcBlockQuery innerJoinCcBlockcriteria($relationAlias = '') Adds a INNER JOIN clause to the query using the CcBlockcriteria relation * - * @method CcBlockQuery leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcBlockQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcBlockQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcBlockQuery leftJoinCcStampContents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStampContents relation + * @method CcBlockQuery rightJoinCcStampContents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStampContents relation + * @method CcBlockQuery innerJoinCcStampContents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStampContents relation * * @method CcBlock findOne(PropelPDO $con = null) Return the first CcBlock matching the query * @method CcBlock findOneOrCreate(PropelPDO $con = null) Return the first CcBlock matching the query, or a new CcBlock object populated from the query conditions when no match is found @@ -632,31 +632,31 @@ abstract class BaseCcBlockQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStampContents object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStampContents $ccStampContents the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcBlockQuery The current query, for fluid interface */ - public function filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStampContents($ccStampContents, $comparison = null) { return $this - ->addUsingAlias(CcBlockPeer::ID, $ccShowStamp->getDbBlockId(), $comparison); + ->addUsingAlias(CcBlockPeer::ID, $ccStampContents->getDbBlockId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStampContents relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcBlockQuery The current query, for fluid interface */ - public function joinCcShowStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function joinCcStampContents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStampContents'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -671,14 +671,14 @@ abstract class BaseCcBlockQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStampContents'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStampContents relation CcStampContents object * * @see useQuery() * @@ -686,13 +686,13 @@ abstract class BaseCcBlockQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampContentsQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function useCcStampContentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStampContents($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStampContents', 'CcStampContentsQuery'); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php index 6d995eaac..a8bed0eaa 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFiles.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFiles.php @@ -494,9 +494,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent protected $collCcSchedules; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStampContents[] Collection to store aggregation of CcStampContents objects. */ - protected $collCcShowStamps; + protected $collCcStampContentss; /** * Flag to prevent endless save loop, if this object is referenced @@ -3114,7 +3114,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; } // if (deep) } @@ -3307,8 +3307,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -3442,8 +3442,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -4374,9 +4374,9 @@ abstract class BaseCcFiles extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStampContentss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStampContents($relObj->copy($deepCopy)); } } @@ -5184,36 +5184,36 @@ abstract class BaseCcFiles extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStampContentss 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 addCcShowStamps() + * @see addCcStampContentss() */ - public function clearCcShowStamps() + public function clearCcStampContentss() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStampContentss = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStampContentss collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStampContentss collection to an empty array (like clearcollCcStampContentss()); * 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 initCcShowStamps() + public function initCcStampContentss() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStampContentss = new PropelObjectCollection(); + $this->collCcStampContentss->setModel('CcStampContents'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStampContents 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. @@ -5223,44 +5223,44 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStampContentss($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStampContentss(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStampContentss = CcStampContentsQuery::create(null, $criteria) ->filterByCcFiles($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStampContentss; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStampContentss = $collCcStampContentss; } } - return $this->collCcShowStamps; + return $this->collCcStampContentss; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStampContents objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStampContents objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStampContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -5269,25 +5269,25 @@ abstract class BaseCcFiles extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStampContentss); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStampContents object to this object + * through the CcStampContents foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStampContents $l CcStampContents * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStampContents(CcStampContents $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStampContentss === null) { + $this->initCcStampContentss(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStampContentss->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStampContentss[]= $l; $l->setCcFiles($this); } } @@ -5298,7 +5298,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcFiles is new, it will return * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -5307,14 +5307,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcStamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcStamp', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -5323,7 +5323,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcFiles is new, it will return * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -5332,39 +5332,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcWebstream', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -5373,7 +5348,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcFiles is new, it will return * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -5382,14 +5357,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcBlock', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -5398,7 +5373,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcFiles is new, it will return * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -5407,14 +5382,14 @@ abstract class BaseCcFiles extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcPlaylist', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } /** @@ -5533,8 +5508,8 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStampContentss) { + foreach ((array) $this->collCcStampContentss as $o) { $o->clearAllReferences($deep); } } @@ -5544,7 +5519,7 @@ abstract class BaseCcFiles extends BaseObject implements Persistent $this->collCcPlaylistcontentss = null; $this->collCcBlockcontentss = null; $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; $this->aFkOwner = null; $this->aCcSubjsRelatedByDbEditedby = null; $this->aCcMusicDirs = null; diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php index 331dc1bfd..0f5ecc02f 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesPeer.php @@ -695,9 +695,9 @@ abstract class BaseCcFilesPeer { // Invalidate objects in CcSchedulePeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcSchedulePeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampContentsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampContentsPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php index ae5c46c28..5a9113904 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcFilesQuery.php @@ -180,9 +180,9 @@ * @method CcFilesQuery rightJoinCcSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSchedule relation * @method CcFilesQuery innerJoinCcSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSchedule relation * - * @method CcFilesQuery leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcFilesQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcFilesQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcFilesQuery leftJoinCcStampContents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStampContents relation + * @method CcFilesQuery rightJoinCcStampContents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStampContents relation + * @method CcFilesQuery innerJoinCcStampContents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStampContents relation * * @method CcFiles findOne(PropelPDO $con = null) Return the first CcFiles matching the query * @method CcFiles findOneOrCreate(PropelPDO $con = null) Return the first CcFiles matching the query, or a new CcFiles object populated from the query conditions when no match is found @@ -2540,31 +2540,31 @@ abstract class BaseCcFilesQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStampContents object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStampContents $ccStampContents the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcFilesQuery The current query, for fluid interface */ - public function filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStampContents($ccStampContents, $comparison = null) { return $this - ->addUsingAlias(CcFilesPeer::ID, $ccShowStamp->getDbFileId(), $comparison); + ->addUsingAlias(CcFilesPeer::ID, $ccStampContents->getDbFileId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStampContents relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcFilesQuery The current query, for fluid interface */ - public function joinCcShowStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function joinCcStampContents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStampContents'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -2579,14 +2579,14 @@ abstract class BaseCcFilesQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStampContents'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStampContents relation CcStampContents object * * @see useQuery() * @@ -2594,13 +2594,13 @@ abstract class BaseCcFilesQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampContentsQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function useCcStampContentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStampContents($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStampContents', 'CcStampContentsQuery'); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylist.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylist.php index fb822e999..e41337be9 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylist.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylist.php @@ -79,9 +79,9 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent protected $collCcPlaylistcontentss; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStampContents[] Collection to store aggregation of CcStampContents objects. */ - protected $collCcShowStamps; + protected $collCcStampContentss; /** * Flag to prevent endless save loop, if this object is referenced @@ -560,7 +560,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent $this->aCcSubjs = null; $this->collCcPlaylistcontentss = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; } // if (deep) } @@ -715,8 +715,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -814,8 +814,8 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1092,9 +1092,9 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStampContentss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStampContents($relObj->copy($deepCopy)); } } @@ -1352,36 +1352,36 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStampContentss 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 addCcShowStamps() + * @see addCcStampContentss() */ - public function clearCcShowStamps() + public function clearCcStampContentss() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStampContentss = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStampContentss collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStampContentss collection to an empty array (like clearcollCcStampContentss()); * 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 initCcShowStamps() + public function initCcStampContentss() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStampContentss = new PropelObjectCollection(); + $this->collCcStampContentss->setModel('CcStampContents'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStampContents 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. @@ -1391,44 +1391,44 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStampContentss($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStampContentss(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStampContentss = CcStampContentsQuery::create(null, $criteria) ->filterByCcPlaylist($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStampContentss; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStampContentss = $collCcStampContentss; } } - return $this->collCcShowStamps; + return $this->collCcStampContentss; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStampContents objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStampContents objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStampContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -1437,25 +1437,25 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStampContentss); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStampContents object to this object + * through the CcStampContents foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStampContents $l CcStampContents * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStampContents(CcStampContents $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStampContentss === null) { + $this->initCcStampContentss(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStampContentss->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStampContentss[]= $l; $l->setCcPlaylist($this); } } @@ -1466,7 +1466,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcPlaylist is new, it will return * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1475,14 +1475,14 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcStamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcStamp', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1491,7 +1491,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcPlaylist is new, it will return * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1500,39 +1500,14 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcPlaylist is new, it will return - * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcPlaylist. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcFiles', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1541,7 +1516,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcPlaylist is new, it will return * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1550,14 +1525,14 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcWebstream', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1566,7 +1541,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcPlaylist is new, it will return * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1575,14 +1550,14 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcBlock', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } /** @@ -1623,15 +1598,15 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStampContentss) { + foreach ((array) $this->collCcStampContentss as $o) { $o->clearAllReferences($deep); } } } // if ($deep) $this->collCcPlaylistcontentss = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; $this->aCcSubjs = null; } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistPeer.php index b8f2ce721..36c810648 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistPeer.php @@ -371,9 +371,9 @@ abstract class BaseCcPlaylistPeer { // Invalidate objects in CcPlaylistcontentsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcPlaylistcontentsPeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampContentsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampContentsPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistQuery.php index 6b365ed5a..3ca7d19a7 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcPlaylistQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcPlaylistQuery.php @@ -34,9 +34,9 @@ * @method CcPlaylistQuery rightJoinCcPlaylistcontents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcPlaylistcontents relation * @method CcPlaylistQuery innerJoinCcPlaylistcontents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcPlaylistcontents relation * - * @method CcPlaylistQuery leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcPlaylistQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcPlaylistQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcPlaylistQuery leftJoinCcStampContents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStampContents relation + * @method CcPlaylistQuery rightJoinCcStampContents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStampContents relation + * @method CcPlaylistQuery innerJoinCcStampContents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStampContents relation * * @method CcPlaylist findOne(PropelPDO $con = null) Return the first CcPlaylist matching the query * @method CcPlaylist findOneOrCreate(PropelPDO $con = null) Return the first CcPlaylist matching the query, or a new CcPlaylist object populated from the query conditions when no match is found @@ -470,31 +470,31 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStampContents object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStampContents $ccStampContents the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcPlaylistQuery The current query, for fluid interface */ - public function filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStampContents($ccStampContents, $comparison = null) { return $this - ->addUsingAlias(CcPlaylistPeer::ID, $ccShowStamp->getDbPlaylistId(), $comparison); + ->addUsingAlias(CcPlaylistPeer::ID, $ccStampContents->getDbPlaylistId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStampContents relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcPlaylistQuery The current query, for fluid interface */ - public function joinCcShowStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function joinCcStampContents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStampContents'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -509,14 +509,14 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStampContents'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStampContents relation CcStampContents object * * @see useQuery() * @@ -524,13 +524,13 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampContentsQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function useCcStampContentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStampContents($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStampContents', 'CcStampContentsQuery'); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShow.php b/airtime_mvc/application/models/airtime/om/BaseCcShow.php index 662ce9cff..311b33969 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShow.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShow.php @@ -123,9 +123,9 @@ abstract class BaseCcShow extends BaseObject implements Persistent protected $collCcShowHostss; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStamp[] Collection to store aggregation of CcStamp objects. */ - protected $collCcShowStamps; + protected $collCcStamps; /** * Flag to prevent endless save loop, if this object is referenced @@ -673,7 +673,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent $this->collCcShowHostss = null; - $this->collCcShowStamps = null; + $this->collCcStamps = null; } // if (deep) } @@ -840,8 +840,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStamps !== null) { + foreach ($this->collCcStamps as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -951,8 +951,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStamps !== null) { + foreach ($this->collCcStamps as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1291,9 +1291,9 @@ abstract class BaseCcShow extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStamps() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStamp($relObj->copy($deepCopy)); } } @@ -1854,36 +1854,36 @@ abstract class BaseCcShow extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStamps 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 addCcShowStamps() + * @see addCcStamps() */ - public function clearCcShowStamps() + public function clearCcStamps() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStamps = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStamps collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStamps collection to an empty array (like clearcollCcStamps()); * 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 initCcShowStamps() + public function initCcStamps() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStamps = new PropelObjectCollection(); + $this->collCcStamps->setModel('CcStamp'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStamp 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. @@ -1893,44 +1893,44 @@ abstract class BaseCcShow extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStamp[] List of CcStamp objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStamps($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStamps || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStamps) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStamps(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStamps = CcStampQuery::create(null, $criteria) ->filterByCcShow($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStamps; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStamps = $collCcStamps; } } - return $this->collCcShowStamps; + return $this->collCcStamps; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStamp objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStamp objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStamps || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStamps) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -1939,25 +1939,25 @@ abstract class BaseCcShow extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStamps); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStamp object to this object + * through the CcStamp foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStamp $l CcStamp * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStamp(CcStamp $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStamps === null) { + $this->initCcStamps(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStamps->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStamps[]= $l; $l->setCcShow($this); } } @@ -1968,7 +1968,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcShow is new, it will return * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStamps from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1977,114 +1977,14 @@ abstract class BaseCcShow extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStamp[] List of CcStamp objects */ - public function getCcShowStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampQuery::create(null, $criteria); $query->joinWith('CcShowInstances', $join_behavior); - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcWebstream', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcBlock', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcPlaylist', $join_behavior); - - return $this->getCcShowStamps($query, $con); + return $this->getCcStamps($query, $con); } /** @@ -2145,8 +2045,8 @@ abstract class BaseCcShow extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStamps) { + foreach ((array) $this->collCcStamps as $o) { $o->clearAllReferences($deep); } } @@ -2156,7 +2056,7 @@ abstract class BaseCcShow extends BaseObject implements Persistent $this->collCcShowDayss = null; $this->collCcShowRebroadcasts = null; $this->collCcShowHostss = null; - $this->collCcShowStamps = null; + $this->collCcStamps = null; } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowInstances.php b/airtime_mvc/application/models/airtime/om/BaseCcShowInstances.php index 674929694..8ea2a9dd1 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowInstances.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowInstances.php @@ -126,9 +126,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent protected $collCcSchedules; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStamp[] Collection to store aggregation of CcStamp objects. */ - protected $collCcShowStamps; + protected $collCcStamps; /** * Flag to prevent endless save loop, if this object is referenced @@ -894,7 +894,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStamps = null; } // if (deep) } @@ -1071,8 +1071,8 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStamps !== null) { + foreach ($this->collCcStamps as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -1190,8 +1190,8 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStamps !== null) { + foreach ($this->collCcStamps as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1530,9 +1530,9 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStamps() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStamp($relObj->copy($deepCopy)); } } @@ -2047,36 +2047,36 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStamps 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 addCcShowStamps() + * @see addCcStamps() */ - public function clearCcShowStamps() + public function clearCcStamps() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStamps = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStamps collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStamps collection to an empty array (like clearcollCcStamps()); * 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 initCcShowStamps() + public function initCcStamps() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStamps = new PropelObjectCollection(); + $this->collCcStamps->setModel('CcStamp'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStamp 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. @@ -2086,44 +2086,44 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStamp[] List of CcStamp objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStamps($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStamps || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStamps) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStamps(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStamps = CcStampQuery::create(null, $criteria) ->filterByCcShowInstances($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStamps; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStamps = $collCcStamps; } } - return $this->collCcShowStamps; + return $this->collCcStamps; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStamp objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStamp objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStamps || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStamps) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -2132,25 +2132,25 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStamps); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStamp object to this object + * through the CcStamp foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStamp $l CcStamp * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStamp(CcStamp $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStamps === null) { + $this->initCcStamps(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStamps->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStamps[]= $l; $l->setCcShowInstances($this); } } @@ -2161,7 +2161,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcShowInstances is new, it will return * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStamps from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -2170,114 +2170,14 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStamp[] List of CcStamp objects */ - public function getCcShowStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampQuery::create(null, $criteria); $query->joinWith('CcShow', $join_behavior); - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcWebstream', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcBlock', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcPlaylist', $join_behavior); - - return $this->getCcShowStamps($query, $con); + return $this->getCcStamps($query, $con); } /** @@ -2328,8 +2228,8 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStamps) { + foreach ((array) $this->collCcStamps as $o) { $o->clearAllReferences($deep); } } @@ -2337,7 +2237,7 @@ abstract class BaseCcShowInstances extends BaseObject implements Persistent $this->collCcShowInstancessRelatedByDbId = null; $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStamps = null; $this->aCcShow = null; $this->aCcShowInstancesRelatedByDbOriginalShow = null; $this->aCcFiles = null; diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesPeer.php index 0223926b2..9a371d34e 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesPeer.php @@ -399,9 +399,9 @@ abstract class BaseCcShowInstancesPeer { // Invalidate objects in CcSchedulePeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcSchedulePeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesQuery.php index 30ffdd523..b550cd2b5 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowInstancesQuery.php @@ -56,9 +56,9 @@ * @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 CcShowInstancesQuery leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcShowInstancesQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcShowInstancesQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcShowInstancesQuery leftJoinCcStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStamp relation + * @method CcShowInstancesQuery rightJoinCcStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStamp relation + * @method CcShowInstancesQuery innerJoinCcStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStamp 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 @@ -853,31 +853,31 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStamp object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStamp $ccStamp 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 filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStamp($ccStamp, $comparison = null) { return $this - ->addUsingAlias(CcShowInstancesPeer::ID, $ccShowStamp->getDbInstanceId(), $comparison); + ->addUsingAlias(CcShowInstancesPeer::ID, $ccStamp->getDbInstanceId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStamp 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 joinCcShowStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function joinCcStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStamp'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -892,14 +892,14 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStamp'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStamp relation CcStamp object * * @see useQuery() * @@ -907,13 +907,13 @@ abstract class BaseCcShowInstancesQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function useCcStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStamp($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStamp', 'CcStampQuery'); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcShowPeer.php index f19fa875d..02c2800cf 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowPeer.php @@ -405,9 +405,9 @@ abstract class BaseCcShowPeer { // Invalidate objects in CcShowHostsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcShowHostsPeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcShowQuery.php index d7a849308..c7d9c2788 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcShowQuery.php @@ -52,9 +52,9 @@ * @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 leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcShowQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcShowQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcShowQuery leftJoinCcStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStamp relation + * @method CcShowQuery rightJoinCcStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStamp relation + * @method CcShowQuery innerJoinCcStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStamp relation * * @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 @@ -694,31 +694,31 @@ abstract class BaseCcShowQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStamp object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStamp $ccStamp 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 filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStamp($ccStamp, $comparison = null) { return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowStamp->getDbShowId(), $comparison); + ->addUsingAlias(CcShowPeer::ID, $ccStamp->getDbShowId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStamp 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 joinCcShowStamp($relationAlias = '', $joinType = Criteria::INNER_JOIN) + public function joinCcStamp($relationAlias = '', $joinType = Criteria::INNER_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStamp'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -733,14 +733,14 @@ abstract class BaseCcShowQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStamp'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStamp relation CcStamp object * * @see useQuery() * @@ -748,13 +748,13 @@ abstract class BaseCcShowQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) + public function useCcStampQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStamp($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStamp', 'CcStampQuery'); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php index 2b6587984..5b6a66111 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstream.php @@ -91,9 +91,9 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent protected $collCcSchedules; /** - * @var array CcShowStamp[] Collection to store aggregation of CcShowStamp objects. + * @var array CcStampContents[] Collection to store aggregation of CcStampContents objects. */ - protected $collCcShowStamps; + protected $collCcStampContentss; /** * Flag to prevent endless save loop, if this object is referenced @@ -704,7 +704,7 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; } // if (deep) } @@ -847,8 +847,8 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } @@ -934,8 +934,8 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent } } - if ($this->collCcShowStamps !== null) { - foreach ($this->collCcShowStamps as $referrerFK) { + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { if (!$referrerFK->validate($columns)) { $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); } @@ -1236,9 +1236,9 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent } } - foreach ($this->getCcShowStamps() as $relObj) { + foreach ($this->getCcStampContentss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowStamp($relObj->copy($deepCopy)); + $copyObj->addCcStampContents($relObj->copy($deepCopy)); } } @@ -1447,36 +1447,36 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent } /** - * Clears out the collCcShowStamps collection + * Clears out the collCcStampContentss 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 addCcShowStamps() + * @see addCcStampContentss() */ - public function clearCcShowStamps() + public function clearCcStampContentss() { - $this->collCcShowStamps = null; // important to set this to NULL since that means it is uninitialized + $this->collCcStampContentss = null; // important to set this to NULL since that means it is uninitialized } /** - * Initializes the collCcShowStamps collection. + * Initializes the collCcStampContentss collection. * - * By default this just sets the collCcShowStamps collection to an empty array (like clearcollCcShowStamps()); + * By default this just sets the collCcStampContentss collection to an empty array (like clearcollCcStampContentss()); * 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 initCcShowStamps() + public function initCcStampContentss() { - $this->collCcShowStamps = new PropelObjectCollection(); - $this->collCcShowStamps->setModel('CcShowStamp'); + $this->collCcStampContentss = new PropelObjectCollection(); + $this->collCcStampContentss->setModel('CcStampContents'); } /** - * Gets an array of CcShowStamp objects which contain a foreign key that references this object. + * Gets an array of CcStampContents 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. @@ -1486,44 +1486,44 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects * @throws PropelException */ - public function getCcShowStamps($criteria = null, PropelPDO $con = null) + public function getCcStampContentss($criteria = null, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { // return empty collection - $this->initCcShowStamps(); + $this->initCcStampContentss(); } else { - $collCcShowStamps = CcShowStampQuery::create(null, $criteria) + $collCcStampContentss = CcStampContentsQuery::create(null, $criteria) ->filterByCcWebstream($this) ->find($con); if (null !== $criteria) { - return $collCcShowStamps; + return $collCcStampContentss; } - $this->collCcShowStamps = $collCcShowStamps; + $this->collCcStampContentss = $collCcStampContentss; } } - return $this->collCcShowStamps; + return $this->collCcStampContentss; } /** - * Returns the number of related CcShowStamp objects. + * Returns the number of related CcStampContents objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con - * @return int Count of related CcShowStamp objects. + * @return int Count of related CcStampContents objects. * @throws PropelException */ - public function countCcShowStamps(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + public function countCcStampContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { - if(null === $this->collCcShowStamps || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowStamps) { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { return 0; } else { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); if($distinct) { $query->distinct(); } @@ -1532,25 +1532,25 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent ->count($con); } } else { - return count($this->collCcShowStamps); + return count($this->collCcStampContentss); } } /** - * Method called to associate a CcShowStamp object to this object - * through the CcShowStamp foreign key attribute. + * Method called to associate a CcStampContents object to this object + * through the CcStampContents foreign key attribute. * - * @param CcShowStamp $l CcShowStamp + * @param CcStampContents $l CcStampContents * @return void * @throws PropelException */ - public function addCcShowStamp(CcShowStamp $l) + public function addCcStampContents(CcStampContents $l) { - if ($this->collCcShowStamps === null) { - $this->initCcShowStamps(); + if ($this->collCcStampContentss === null) { + $this->initCcStampContentss(); } - if (!$this->collCcShowStamps->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowStamps[]= $l; + if (!$this->collCcStampContentss->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStampContentss[]= $l; $l->setCcWebstream($this); } } @@ -1561,7 +1561,7 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcWebstream is new, it will return * an empty collection; or if this CcWebstream has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1570,14 +1570,14 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcStamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcStamp', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1586,7 +1586,7 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcWebstream is new, it will return * an empty collection; or if this CcWebstream has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1595,39 +1595,14 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcShowStamps($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcWebstream is new, it will return - * an empty collection; or if this CcWebstream has previously - * been saved, it will retrieve related CcShowStamps from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcWebstream. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects - */ - public function getCcShowStampsJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcFiles', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1636,7 +1611,7 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcWebstream is new, it will return * an empty collection; or if this CcWebstream has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1645,14 +1620,14 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcBlock', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } @@ -1661,7 +1636,7 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * an identical criteria, it returns the collection. * Otherwise if this CcWebstream is new, it will return * an empty collection; or if this CcWebstream has previously - * been saved, it will retrieve related CcShowStamps from storage. + * been saved, it will retrieve related CcStampContentss from storage. * * This method is protected by default in order to keep the public * api reasonable. You can provide public methods for those you @@ -1670,14 +1645,14 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent * @param Criteria $criteria optional Criteria object to narrow the query * @param PropelPDO $con optional connection object * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowStamp[] List of CcShowStamp objects + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects */ - public function getCcShowStampsJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + public function getCcStampContentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { - $query = CcShowStampQuery::create(null, $criteria); + $query = CcStampContentsQuery::create(null, $criteria); $query->joinWith('CcPlaylist', $join_behavior); - return $this->getCcShowStamps($query, $con); + return $this->getCcStampContentss($query, $con); } /** @@ -1721,15 +1696,15 @@ abstract class BaseCcWebstream extends BaseObject implements Persistent $o->clearAllReferences($deep); } } - if ($this->collCcShowStamps) { - foreach ((array) $this->collCcShowStamps as $o) { + if ($this->collCcStampContentss) { + foreach ((array) $this->collCcStampContentss as $o) { $o->clearAllReferences($deep); } } } // if ($deep) $this->collCcSchedules = null; - $this->collCcShowStamps = null; + $this->collCcStampContentss = null; } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php index 1965b1bf2..81bcb2b27 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamPeer.php @@ -386,9 +386,9 @@ abstract class BaseCcWebstreamPeer { // Invalidate objects in CcSchedulePeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. CcSchedulePeer::clearInstancePool(); - // Invalidate objects in CcShowStampPeer instance pool, + // Invalidate objects in CcStampContentsPeer instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowStampPeer::clearInstancePool(); + CcStampContentsPeer::clearInstancePool(); } /** diff --git a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php index 1f62828e7..6ad062e18 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcWebstreamQuery.php @@ -36,9 +36,9 @@ * @method CcWebstreamQuery rightJoinCcSchedule($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcSchedule relation * @method CcWebstreamQuery innerJoinCcSchedule($relationAlias = '') Adds a INNER JOIN clause to the query using the CcSchedule relation * - * @method CcWebstreamQuery leftJoinCcShowStamp($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcShowStamp relation - * @method CcWebstreamQuery rightJoinCcShowStamp($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcShowStamp relation - * @method CcWebstreamQuery innerJoinCcShowStamp($relationAlias = '') Adds a INNER JOIN clause to the query using the CcShowStamp relation + * @method CcWebstreamQuery leftJoinCcStampContents($relationAlias = '') Adds a LEFT JOIN clause to the query using the CcStampContents relation + * @method CcWebstreamQuery rightJoinCcStampContents($relationAlias = '') Adds a RIGHT JOIN clause to the query using the CcStampContents relation + * @method CcWebstreamQuery innerJoinCcStampContents($relationAlias = '') Adds a INNER JOIN clause to the query using the CcStampContents relation * * @method CcWebstream findOne(PropelPDO $con = null) Return the first CcWebstream matching the query * @method CcWebstream findOneOrCreate(PropelPDO $con = null) Return the first CcWebstream matching the query, or a new CcWebstream object populated from the query conditions when no match is found @@ -489,31 +489,31 @@ abstract class BaseCcWebstreamQuery extends ModelCriteria } /** - * Filter the query by a related CcShowStamp object + * Filter the query by a related CcStampContents object * - * @param CcShowStamp $ccShowStamp the related object to use as filter + * @param CcStampContents $ccStampContents the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcWebstreamQuery The current query, for fluid interface */ - public function filterByCcShowStamp($ccShowStamp, $comparison = null) + public function filterByCcStampContents($ccStampContents, $comparison = null) { return $this - ->addUsingAlias(CcWebstreamPeer::ID, $ccShowStamp->getDbStreamId(), $comparison); + ->addUsingAlias(CcWebstreamPeer::ID, $ccStampContents->getDbStreamId(), $comparison); } /** - * Adds a JOIN clause to the query using the CcShowStamp relation + * Adds a JOIN clause to the query using the CcStampContents relation * * @param string $relationAlias optional alias for the relation * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * * @return CcWebstreamQuery The current query, for fluid interface */ - public function joinCcShowStamp($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function joinCcStampContents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowStamp'); + $relationMap = $tableMap->getRelation('CcStampContents'); // create a ModelJoin object for this join $join = new ModelJoin(); @@ -528,14 +528,14 @@ abstract class BaseCcWebstreamQuery extends ModelCriteria $this->addAlias($relationAlias, $relationMap->getRightTable()->getName()); $this->addJoinObject($join, $relationAlias); } else { - $this->addJoinObject($join, 'CcShowStamp'); + $this->addJoinObject($join, 'CcStampContents'); } return $this; } /** - * Use the CcShowStamp relation CcShowStamp object + * Use the CcStampContents relation CcStampContents object * * @see useQuery() * @@ -543,13 +543,13 @@ abstract class BaseCcWebstreamQuery extends ModelCriteria * to be used as main alias in the secondary query * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' * - * @return CcShowStampQuery A secondary query class using the current class as primary query + * @return CcStampContentsQuery A secondary query class using the current class as primary query */ - public function useCcShowStampQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + public function useCcStampContentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) { return $this - ->joinCcShowStamp($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowStamp', 'CcShowStampQuery'); + ->joinCcStampContents($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStampContents', 'CcStampContentsQuery'); } /** diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 49ff7cffa..bbcd7f0fe 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -341,7 +341,7 @@ - @@ -477,10 +477,9 @@ - +
- - + @@ -491,23 +490,31 @@ - - + + - - - - + - + - + - +
+ + + + + + + + + + +
diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index 9d9040164..5e8af4018 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -751,17 +751,16 @@ COMMENT ON TABLE "cc_locale" IS ''; SET search_path TO public; ----------------------------------------------------------------------------- --- cc_show_stamp +-- cc_stamp_contents ----------------------------------------------------------------------------- -DROP TABLE "cc_show_stamp" CASCADE; +DROP TABLE "cc_stamp_contents" CASCADE; -CREATE TABLE "cc_show_stamp" +CREATE TABLE "cc_stamp_contents" ( "id" serial NOT NULL, - "show_id" INTEGER NOT NULL, - "instance_id" INTEGER, + "stamp_id" INTEGER NOT NULL, "file_id" INTEGER, "stream_id" INTEGER, "block_id" INTEGER, @@ -775,7 +774,26 @@ CREATE TABLE "cc_show_stamp" PRIMARY KEY ("id") ); -COMMENT ON TABLE "cc_show_stamp" IS ''; +COMMENT ON TABLE "cc_stamp_contents" IS ''; + + +SET search_path TO public; +----------------------------------------------------------------------------- +-- cc_stamp +----------------------------------------------------------------------------- + +DROP TABLE "cc_stamp" CASCADE; + + +CREATE TABLE "cc_stamp" +( + "id" serial NOT NULL, + "show_id" INTEGER NOT NULL, + "instance_id" INTEGER, + PRIMARY KEY ("id") +); + +COMMENT ON TABLE "cc_stamp" IS ''; SET search_path TO public; @@ -835,14 +853,16 @@ ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_timestamp_inst_fkey" FOREIGN ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_mount_name_inst_fkey" FOREIGN KEY ("mount_name_id") REFERENCES "cc_mount_name" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_show_id_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_stamp_id_fkey" FOREIGN KEY ("stamp_id") REFERENCES "cc_stamp" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_stream_id_fkey" FOREIGN KEY ("stream_id") REFERENCES "cc_webstream" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_stream_id_fkey" FOREIGN KEY ("stream_id") REFERENCES "cc_webstream" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE; -ALTER TABLE "cc_show_stamp" ADD CONSTRAINT "cc_show_stamp_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE; +ALTER TABLE "cc_stamp" ADD CONSTRAINT "cc_stamp_show_id_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; + +ALTER TABLE "cc_stamp" ADD CONSTRAINT "cc_stamp_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE; From e64f6fb3fd37c63f3290b2a1625fa866a7cc62db Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 8 Apr 2013 14:43:27 -0400 Subject: [PATCH 071/128] CC-4961: Show linking -modified db --- .../application/models/airtime/CcStamp.php | 18 + .../models/airtime/CcStampContents.php | 18 + .../models/airtime/CcStampContentsPeer.php | 18 + .../models/airtime/CcStampContentsQuery.php | 18 + .../models/airtime/CcStampPeer.php | 18 + .../models/airtime/CcStampQuery.php | 18 + .../airtime/map/CcStampContentsTableMap.php | 68 + .../models/airtime/map/CcStampTableMap.php | 57 + .../models/airtime/om/BaseCcStamp.php | 1188 ++++++++ .../models/airtime/om/BaseCcStampContents.php | 1656 +++++++++++ .../airtime/om/BaseCcStampContentsPeer.php | 2592 +++++++++++++++++ .../airtime/om/BaseCcStampContentsQuery.php | 845 ++++++ .../models/airtime/om/BaseCcStampPeer.php | 1368 +++++++++ .../models/airtime/om/BaseCcStampQuery.php | 439 +++ 14 files changed, 8321 insertions(+) create mode 100644 airtime_mvc/application/models/airtime/CcStamp.php create mode 100644 airtime_mvc/application/models/airtime/CcStampContents.php create mode 100644 airtime_mvc/application/models/airtime/CcStampContentsPeer.php create mode 100644 airtime_mvc/application/models/airtime/CcStampContentsQuery.php create mode 100644 airtime_mvc/application/models/airtime/CcStampPeer.php create mode 100644 airtime_mvc/application/models/airtime/CcStampQuery.php create mode 100644 airtime_mvc/application/models/airtime/map/CcStampContentsTableMap.php create mode 100644 airtime_mvc/application/models/airtime/map/CcStampTableMap.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStamp.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStampContents.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStampContentsPeer.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStampContentsQuery.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php create mode 100644 airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php diff --git a/airtime_mvc/application/models/airtime/CcStamp.php b/airtime_mvc/application/models/airtime/CcStamp.php new file mode 100644 index 000000000..7881e7173 --- /dev/null +++ b/airtime_mvc/application/models/airtime/CcStamp.php @@ -0,0 +1,18 @@ +setName('cc_stamp_contents'); + $this->setPhpName('CcStampContents'); + $this->setClassname('CcStampContents'); + $this->setPackage('airtime'); + $this->setUseIdGenerator(true); + $this->setPrimaryKeyMethodInfo('cc_stamp_contents_id_seq'); + // columns + $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); + $this->addForeignKey('STAMP_ID', 'DbStampId', 'INTEGER', 'cc_stamp', 'ID', true, null, null); + $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); + $this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null); + $this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null); + $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); + $this->addColumn('POSITION', 'DbPosition', 'INTEGER', true, null, null); + $this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('FADE_IN', 'DbFadeIn', 'VARCHAR', false, null, '00:00:00'); + $this->addColumn('FADE_OUT', 'DbFadeOut', 'VARCHAR', false, null, '00:00:00'); + // validators + } // initialize() + + /** + * Build the RelationMap objects for this table relationships + */ + public function buildRelations() + { + $this->addRelation('CcStamp', 'CcStamp', RelationMap::MANY_TO_ONE, array('stamp_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcWebstream', 'CcWebstream', RelationMap::MANY_TO_ONE, array('stream_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcBlock', 'CcBlock', RelationMap::MANY_TO_ONE, array('block_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null); + } // buildRelations() + +} // CcStampContentsTableMap diff --git a/airtime_mvc/application/models/airtime/map/CcStampTableMap.php b/airtime_mvc/application/models/airtime/map/CcStampTableMap.php new file mode 100644 index 000000000..6574cb410 --- /dev/null +++ b/airtime_mvc/application/models/airtime/map/CcStampTableMap.php @@ -0,0 +1,57 @@ +setName('cc_stamp'); + $this->setPhpName('CcStamp'); + $this->setClassname('CcStamp'); + $this->setPackage('airtime'); + $this->setUseIdGenerator(true); + $this->setPrimaryKeyMethodInfo('cc_stamp_id_seq'); + // columns + $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); + $this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null); + $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); + // validators + } // initialize() + + /** + * Build the RelationMap objects for this table relationships + */ + public function buildRelations() + { + $this->addRelation('CcShow', 'CcShow', RelationMap::MANY_TO_ONE, array('show_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); + $this->addRelation('CcStampContents', 'CcStampContents', RelationMap::ONE_TO_MANY, array('id' => 'stamp_id', ), 'CASCADE', null); + } // buildRelations() + +} // CcStampTableMap diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStamp.php b/airtime_mvc/application/models/airtime/om/BaseCcStamp.php new file mode 100644 index 000000000..dcb488d02 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStamp.php @@ -0,0 +1,1188 @@ +id; + } + + /** + * Get the [show_id] column value. + * + * @return int + */ + public function getDbShowId() + { + return $this->show_id; + } + + /** + * Get the [instance_id] column value. + * + * @return int + */ + public function getDbInstanceId() + { + return $this->instance_id; + } + + /** + * Set the value of [id] column. + * + * @param int $v new value + * @return CcStamp The current object (for fluent API support) + */ + public function setDbId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = CcStampPeer::ID; + } + + return $this; + } // setDbId() + + /** + * Set the value of [show_id] column. + * + * @param int $v new value + * @return CcStamp The current object (for fluent API support) + */ + public function setDbShowId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->show_id !== $v) { + $this->show_id = $v; + $this->modifiedColumns[] = CcStampPeer::SHOW_ID; + } + + if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { + $this->aCcShow = null; + } + + return $this; + } // setDbShowId() + + /** + * Set the value of [instance_id] column. + * + * @param int $v new value + * @return CcStamp 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[] = CcStampPeer::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. + * + * This method can be used in conjunction with isModified() to indicate whether an object is both + * modified _and_ has some values set which are non-default. + * + * @return boolean Whether the columns in this object are only been set with default values. + */ + public function hasOnlyDefaultValues() + { + // otherwise, everything was equal, so return TRUE + return true; + } // hasOnlyDefaultValues() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (0-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) + * @param int $startcol 0-based offset column which indicates which restultset column to start with. + * @param boolean $rehydrate Whether this object is being re-hydrated from the database. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate($row, $startcol = 0, $rehydrate = false) + { + try { + + $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 + 2] !== null) ? (int) $row[$startcol + 2] : null; + $this->resetModified(); + + $this->setNew(false); + + if ($rehydrate) { + $this->ensureConsistency(); + } + + return $startcol + 3; // 3 = CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating CcStamp object", $e); + } + } + + /** + * Checks and repairs the internal consistency of the object. + * + * This method is executed after an already-instantiated object is re-hydrated + * from the database. It exists to check any foreign keys to make sure that + * the objects related to the current object are correct based on foreign key. + * + * You can override this method in the stub class, but you should always invoke + * the base method from the overridden method (i.e. parent::ensureConsistency()), + * in case your model changes. + * + * @throws PropelException + */ + public function ensureConsistency() + { + + if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { + $this->aCcShow = null; + } + if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { + $this->aCcShowInstances = null; + } + } // ensureConsistency + + /** + * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. + * + * This will only work if the object has been saved and has a valid primary key set. + * + * @param boolean $deep (optional) Whether to also de-associated any related objects. + * @param PropelPDO $con (optional) The PropelPDO connection to use. + * @return void + * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db + */ + public function reload($deep = false, PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("Cannot reload a deleted object."); + } + + if ($this->isNew()) { + throw new PropelException("Cannot reload an unsaved object."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + // We don't need to alter the object instance pool; we're just modifying this instance + // already in the pool. + + $stmt = CcStampPeer::doSelectStmt($this->buildPkeyCriteria(), $con); + $row = $stmt->fetch(PDO::FETCH_NUM); + $stmt->closeCursor(); + if (!$row) { + throw new PropelException('Cannot find matching row in the database to reload object values.'); + } + $this->hydrate($row, 0, true); // rehydrate + + if ($deep) { // also de-associate any related objects? + + $this->aCcShow = null; + $this->aCcShowInstances = null; + $this->collCcStampContentss = null; + + } // if (deep) + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param PropelPDO $con + * @return void + * @throws PropelException + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + try { + $ret = $this->preDelete($con); + if ($ret) { + CcStampQuery::create() + ->filterByPrimaryKey($this->getPrimaryKey()) + ->delete($con); + $this->postDelete($con); + $con->commit(); + $this->setDeleted(true); + } else { + $con->commit(); + } + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Persists this object to the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All modified related objects will also be persisted in the doSave() + * method. This method wraps all precipitate database operations in a + * single transaction. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see doSave() + */ + public function save(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + $isInsert = $this->isNew(); + try { + $ret = $this->preSave($con); + if ($isInsert) { + $ret = $ret && $this->preInsert($con); + } else { + $ret = $ret && $this->preUpdate($con); + } + if ($ret) { + $affectedRows = $this->doSave($con); + if ($isInsert) { + $this->postInsert($con); + } else { + $this->postUpdate($con); + } + $this->postSave($con); + CcStampPeer::addInstanceToPool($this); + } else { + $affectedRows = 0; + } + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs the work of inserting or updating the row in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see save() + */ + protected function doSave(PropelPDO $con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $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->aCcShow !== null) { + if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { + $affectedRows += $this->aCcShow->save($con); + } + $this->setCcShow($this->aCcShow); + } + + 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[] = CcStampPeer::ID; + } + + // If this object has been modified, then save it to the database. + if ($this->isModified()) { + if ($this->isNew()) { + $criteria = $this->buildCriteria(); + if ($criteria->keyContainsValue(CcStampPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcStampPeer::ID.')'); + } + + $pk = BasePeer::doInsert($criteria, $con); + $affectedRows += 1; + $this->setDbId($pk); //[IMV] update autoincrement primary key + $this->setNew(false); + } else { + $affectedRows += CcStampPeer::doUpdate($this, $con); + } + + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' + } + + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { + if (!$referrerFK->isDeleted()) { + $affectedRows += $referrerFK->save($con); + } + } + } + + $this->alreadyInSave = false; + + } + return $affectedRows; + } // doSave() + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggreagated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $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->aCcShow !== null) { + if (!$this->aCcShow->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); + } + } + + if ($this->aCcShowInstances !== null) { + if (!$this->aCcShowInstances->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcShowInstances->getValidationFailures()); + } + } + + + if (($retval = CcStampPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + if ($this->collCcStampContentss !== null) { + foreach ($this->collCcStampContentss as $referrerFK) { + if (!$referrerFK->validate($columns)) { + $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); + } + } + } + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + $field = $this->getByPosition($pos); + return $field; + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getDbId(); + break; + case 1: + return $this->getDbShowId(); + break; + case 2: + return $this->getDbInstanceId(); + break; + default: + return null; + break; + } // switch() + } + + /** + * Exports the object as an array. + * + * You can specify the key type of the array by passing one of the class + * type constants. + * + * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * Defaults to BasePeer::TYPE_PHPNAME. + * @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 + */ + public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) + { + $keys = CcStampPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getDbId(), + $keys[1] => $this->getDbShowId(), + $keys[2] => $this->getDbInstanceId(), + ); + if ($includeForeignObjects) { + if (null !== $this->aCcShow) { + $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcShowInstances) { + $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); + } + } + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setDbId($value); + break; + case 1: + $this->setDbShowId($value); + break; + case 2: + $this->setDbInstanceId($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * The default key type is the column's phpname (e.g. 'AuthorId') + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = CcStampPeer::getFieldNames($keyType); + + 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[2], $arr)) $this->setDbInstanceId($arr[$keys[2]]); + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(CcStampPeer::DATABASE_NAME); + + if ($this->isColumnModified(CcStampPeer::ID)) $criteria->add(CcStampPeer::ID, $this->id); + if ($this->isColumnModified(CcStampPeer::SHOW_ID)) $criteria->add(CcStampPeer::SHOW_ID, $this->show_id); + if ($this->isColumnModified(CcStampPeer::INSTANCE_ID)) $criteria->add(CcStampPeer::INSTANCE_ID, $this->instance_id); + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(CcStampPeer::DATABASE_NAME); + $criteria->add(CcStampPeer::ID, $this->id); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return int + */ + public function getPrimaryKey() + { + return $this->getDbId(); + } + + /** + * Generic method to set the primary key (id column). + * + * @param int $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setDbId($key); + } + + /** + * Returns true if the primary key for this object is null. + * @return boolean + */ + public function isPrimaryKeyNull() + { + return null === $this->getDbId(); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of CcStamp (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false) + { + $copyObj->setDbShowId($this->show_id); + $copyObj->setDbInstanceId($this->instance_id); + + if ($deepCopy) { + // important: temporarily setNew(false) because this affects the behavior of + // the getter/setter methods for fkey referrer objects. + $copyObj->setNew(false); + + foreach ($this->getCcStampContentss() as $relObj) { + if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves + $copyObj->addCcStampContents($relObj->copy($deepCopy)); + } + } + + } // if ($deepCopy) + + + $copyObj->setNew(true); + $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return CcStamp Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return CcStampPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new CcStampPeer(); + } + return self::$peer; + } + + /** + * Declares an association between this object and a CcShow object. + * + * @param CcShow $v + * @return CcStamp The current object (for fluent API support) + * @throws PropelException + */ + public function setCcShow(CcShow $v = null) + { + if ($v === null) { + $this->setDbShowId(NULL); + } else { + $this->setDbShowId($v->getDbId()); + } + + $this->aCcShow = $v; + + // 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 ($v !== null) { + $v->addCcStamp($this); + } + + return $this; + } + + + /** + * Get the associated CcShow object + * + * @param PropelPDO Optional Connection object. + * @return CcShow The associated CcShow object. + * @throws PropelException + */ + public function getCcShow(PropelPDO $con = null) + { + if ($this->aCcShow === null && ($this->show_id !== null)) { + $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcStamps($this); + */ + } + return $this->aCcShow; + } + + /** + * Declares an association between this object and a CcShowInstances object. + * + * @param CcShowInstances $v + * @return CcStamp 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->addCcStamp($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->addCcStamps($this); + */ + } + return $this->aCcShowInstances; + } + + /** + * Clears out the collCcStampContentss 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 addCcStampContentss() + */ + public function clearCcStampContentss() + { + $this->collCcStampContentss = null; // important to set this to NULL since that means it is uninitialized + } + + /** + * Initializes the collCcStampContentss collection. + * + * By default this just sets the collCcStampContentss collection to an empty array (like clearcollCcStampContentss()); + * 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 initCcStampContentss() + { + $this->collCcStampContentss = new PropelObjectCollection(); + $this->collCcStampContentss->setModel('CcStampContents'); + } + + /** + * Gets an array of CcStampContents 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 CcStamp 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 CcStampContents[] List of CcStampContents objects + * @throws PropelException + */ + public function getCcStampContentss($criteria = null, PropelPDO $con = null) + { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { + // return empty collection + $this->initCcStampContentss(); + } else { + $collCcStampContentss = CcStampContentsQuery::create(null, $criteria) + ->filterByCcStamp($this) + ->find($con); + if (null !== $criteria) { + return $collCcStampContentss; + } + $this->collCcStampContentss = $collCcStampContentss; + } + } + return $this->collCcStampContentss; + } + + /** + * Returns the number of related CcStampContents objects. + * + * @param Criteria $criteria + * @param boolean $distinct + * @param PropelPDO $con + * @return int Count of related CcStampContents objects. + * @throws PropelException + */ + public function countCcStampContentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) + { + if(null === $this->collCcStampContentss || null !== $criteria) { + if ($this->isNew() && null === $this->collCcStampContentss) { + return 0; + } else { + $query = CcStampContentsQuery::create(null, $criteria); + if($distinct) { + $query->distinct(); + } + return $query + ->filterByCcStamp($this) + ->count($con); + } + } else { + return count($this->collCcStampContentss); + } + } + + /** + * Method called to associate a CcStampContents object to this object + * through the CcStampContents foreign key attribute. + * + * @param CcStampContents $l CcStampContents + * @return void + * @throws PropelException + */ + public function addCcStampContents(CcStampContents $l) + { + if ($this->collCcStampContentss === null) { + $this->initCcStampContentss(); + } + if (!$this->collCcStampContentss->contains($l)) { // only add it if the **same** object is not already associated + $this->collCcStampContentss[]= $l; + $l->setCcStamp($this); + } + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this CcStamp is new, it will return + * an empty collection; or if this CcStamp has previously + * been saved, it will retrieve related CcStampContentss from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in CcStamp. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects + */ + public function getCcStampContentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcFiles', $join_behavior); + + return $this->getCcStampContentss($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this CcStamp is new, it will return + * an empty collection; or if this CcStamp has previously + * been saved, it will retrieve related CcStampContentss from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in CcStamp. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects + */ + public function getCcStampContentssJoinCcWebstream($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcWebstream', $join_behavior); + + return $this->getCcStampContentss($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this CcStamp is new, it will return + * an empty collection; or if this CcStamp has previously + * been saved, it will retrieve related CcStampContentss from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in CcStamp. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects + */ + public function getCcStampContentssJoinCcBlock($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcBlock', $join_behavior); + + return $this->getCcStampContentss($query, $con); + } + + + /** + * If this collection has already been initialized with + * an identical criteria, it returns the collection. + * Otherwise if this CcStamp is new, it will return + * an empty collection; or if this CcStamp has previously + * been saved, it will retrieve related CcStampContentss from storage. + * + * This method is protected by default in order to keep the public + * api reasonable. You can provide public methods for those you + * actually need in CcStamp. + * + * @param Criteria $criteria optional Criteria object to narrow the query + * @param PropelPDO $con optional connection object + * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) + * @return PropelCollection|array CcStampContents[] List of CcStampContents objects + */ + public function getCcStampContentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $query = CcStampContentsQuery::create(null, $criteria); + $query->joinWith('CcPlaylist', $join_behavior); + + return $this->getCcStampContentss($query, $con); + } + + /** + * Clears the current object and sets all attributes to their default values + */ + public function clear() + { + $this->id = null; + $this->show_id = null; + $this->instance_id = null; + $this->alreadyInSave = false; + $this->alreadyInValidation = false; + $this->clearAllReferences(); + $this->resetModified(); + $this->setNew(true); + $this->setDeleted(false); + } + + /** + * Resets all collections of referencing foreign keys. + * + * This method is a user-space workaround for PHP's inability to garbage collect objects + * with circular references. This is currently necessary when using Propel in certain + * daemon or large-volumne/high-memory operations. + * + * @param boolean $deep Whether to also clear the references on all associated objects. + */ + public function clearAllReferences($deep = false) + { + if ($deep) { + if ($this->collCcStampContentss) { + foreach ((array) $this->collCcStampContentss as $o) { + $o->clearAllReferences($deep); + } + } + } // if ($deep) + + $this->collCcStampContentss = null; + $this->aCcShow = null; + $this->aCcShowInstances = null; + } + + /** + * Catches calls to virtual methods + */ + public function __call($name, $params) + { + if (preg_match('/get(\w+)/', $name, $matches)) { + $virtualColumn = $matches[1]; + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + // no lcfirst in php<5.3... + $virtualColumn[0] = strtolower($virtualColumn[0]); + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + } + throw new PropelException('Call to undefined method: ' . $name); + } + +} // BaseCcStamp diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampContents.php b/airtime_mvc/application/models/airtime/om/BaseCcStampContents.php new file mode 100644 index 000000000..10442dbe1 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampContents.php @@ -0,0 +1,1656 @@ +clip_length = '00:00:00'; + $this->cue_in = '00:00:00'; + $this->cue_out = '00:00:00'; + $this->fade_in = '00:00:00'; + $this->fade_out = '00:00:00'; + } + + /** + * Initializes internal state of BaseCcStampContents object. + * @see applyDefaults() + */ + public function __construct() + { + parent::__construct(); + $this->applyDefaultValues(); + } + + /** + * Get the [id] column value. + * + * @return int + */ + public function getDbId() + { + return $this->id; + } + + /** + * Get the [stamp_id] column value. + * + * @return int + */ + public function getDbStampId() + { + return $this->stamp_id; + } + + /** + * Get the [file_id] column value. + * + * @return int + */ + public function getDbFileId() + { + return $this->file_id; + } + + /** + * Get the [stream_id] column value. + * + * @return int + */ + public function getDbStreamId() + { + return $this->stream_id; + } + + /** + * Get the [block_id] column value. + * + * @return int + */ + public function getDbBlockId() + { + return $this->block_id; + } + + /** + * Get the [playlist_id] column value. + * + * @return int + */ + public function getDbPlaylistId() + { + return $this->playlist_id; + } + + /** + * Get the [position] column value. + * + * @return int + */ + public function getDbPosition() + { + return $this->position; + } + + /** + * Get the [clip_length] column value. + * + * @return string + */ + public function getDbClipLength() + { + return $this->clip_length; + } + + /** + * Get the [cue_in] column value. + * + * @return string + */ + public function getDbCueIn() + { + return $this->cue_in; + } + + /** + * Get the [cue_out] column value. + * + * @return string + */ + public function getDbCueOut() + { + return $this->cue_out; + } + + /** + * Get the [fade_in] column value. + * + * @return string + */ + public function getDbFadeIn() + { + return $this->fade_in; + } + + /** + * Get the [fade_out] column value. + * + * @return string + */ + public function getDbFadeOut() + { + return $this->fade_out; + } + + /** + * Set the value of [id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->id !== $v) { + $this->id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::ID; + } + + return $this; + } // setDbId() + + /** + * Set the value of [stamp_id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbStampId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->stamp_id !== $v) { + $this->stamp_id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::STAMP_ID; + } + + if ($this->aCcStamp !== null && $this->aCcStamp->getDbId() !== $v) { + $this->aCcStamp = null; + } + + return $this; + } // setDbStampId() + + /** + * Set the value of [file_id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbFileId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->file_id !== $v) { + $this->file_id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::FILE_ID; + } + + if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { + $this->aCcFiles = null; + } + + return $this; + } // setDbFileId() + + /** + * Set the value of [stream_id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbStreamId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->stream_id !== $v) { + $this->stream_id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::STREAM_ID; + } + + if ($this->aCcWebstream !== null && $this->aCcWebstream->getDbId() !== $v) { + $this->aCcWebstream = null; + } + + return $this; + } // setDbStreamId() + + /** + * Set the value of [block_id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbBlockId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->block_id !== $v) { + $this->block_id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::BLOCK_ID; + } + + if ($this->aCcBlock !== null && $this->aCcBlock->getDbId() !== $v) { + $this->aCcBlock = null; + } + + return $this; + } // setDbBlockId() + + /** + * Set the value of [playlist_id] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbPlaylistId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->playlist_id !== $v) { + $this->playlist_id = $v; + $this->modifiedColumns[] = CcStampContentsPeer::PLAYLIST_ID; + } + + if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { + $this->aCcPlaylist = null; + } + + return $this; + } // setDbPlaylistId() + + /** + * Set the value of [position] column. + * + * @param int $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbPosition($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->position !== $v) { + $this->position = $v; + $this->modifiedColumns[] = CcStampContentsPeer::POSITION; + } + + return $this; + } // setDbPosition() + + /** + * Set the value of [clip_length] column. + * + * @param string $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbClipLength($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->clip_length !== $v || $this->isNew()) { + $this->clip_length = $v; + $this->modifiedColumns[] = CcStampContentsPeer::CLIP_LENGTH; + } + + return $this; + } // setDbClipLength() + + /** + * Set the value of [cue_in] column. + * + * @param string $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbCueIn($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->cue_in !== $v || $this->isNew()) { + $this->cue_in = $v; + $this->modifiedColumns[] = CcStampContentsPeer::CUE_IN; + } + + return $this; + } // setDbCueIn() + + /** + * Set the value of [cue_out] column. + * + * @param string $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbCueOut($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->cue_out !== $v || $this->isNew()) { + $this->cue_out = $v; + $this->modifiedColumns[] = CcStampContentsPeer::CUE_OUT; + } + + return $this; + } // setDbCueOut() + + /** + * Set the value of [fade_in] column. + * + * @param string $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbFadeIn($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->fade_in !== $v || $this->isNew()) { + $this->fade_in = $v; + $this->modifiedColumns[] = CcStampContentsPeer::FADE_IN; + } + + return $this; + } // setDbFadeIn() + + /** + * Set the value of [fade_out] column. + * + * @param string $v new value + * @return CcStampContents The current object (for fluent API support) + */ + public function setDbFadeOut($v) + { + if ($v !== null) { + $v = (string) $v; + } + + if ($this->fade_out !== $v || $this->isNew()) { + $this->fade_out = $v; + $this->modifiedColumns[] = CcStampContentsPeer::FADE_OUT; + } + + return $this; + } // setDbFadeOut() + + /** + * Indicates whether the columns in this object are only set to default values. + * + * This method can be used in conjunction with isModified() to indicate whether an object is both + * modified _and_ has some values set which are non-default. + * + * @return boolean Whether the columns in this object are only been set with default values. + */ + public function hasOnlyDefaultValues() + { + if ($this->clip_length !== '00:00:00') { + return false; + } + + if ($this->cue_in !== '00:00:00') { + return false; + } + + if ($this->cue_out !== '00:00:00') { + return false; + } + + if ($this->fade_in !== '00:00:00') { + return false; + } + + if ($this->fade_out !== '00:00:00') { + return false; + } + + // otherwise, everything was equal, so return TRUE + return true; + } // hasOnlyDefaultValues() + + /** + * Hydrates (populates) the object variables with values from the database resultset. + * + * An offset (0-based "start column") is specified so that objects can be hydrated + * with a subset of the columns in the resultset rows. This is needed, for example, + * for results of JOIN queries where the resultset row includes columns from two or + * more tables. + * + * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) + * @param int $startcol 0-based offset column which indicates which restultset column to start with. + * @param boolean $rehydrate Whether this object is being re-hydrated from the database. + * @return int next starting column + * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. + */ + public function hydrate($row, $startcol = 0, $rehydrate = false) + { + try { + + $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; + $this->stamp_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; + $this->file_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; + $this->stream_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; + $this->block_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; + $this->playlist_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; + $this->position = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; + $this->clip_length = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; + $this->cue_in = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; + $this->cue_out = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; + $this->fade_in = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; + $this->fade_out = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; + $this->resetModified(); + + $this->setNew(false); + + if ($rehydrate) { + $this->ensureConsistency(); + } + + return $startcol + 12; // 12 = CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS). + + } catch (Exception $e) { + throw new PropelException("Error populating CcStampContents object", $e); + } + } + + /** + * Checks and repairs the internal consistency of the object. + * + * This method is executed after an already-instantiated object is re-hydrated + * from the database. It exists to check any foreign keys to make sure that + * the objects related to the current object are correct based on foreign key. + * + * You can override this method in the stub class, but you should always invoke + * the base method from the overridden method (i.e. parent::ensureConsistency()), + * in case your model changes. + * + * @throws PropelException + */ + public function ensureConsistency() + { + + if ($this->aCcStamp !== null && $this->stamp_id !== $this->aCcStamp->getDbId()) { + $this->aCcStamp = null; + } + if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { + $this->aCcFiles = null; + } + if ($this->aCcWebstream !== null && $this->stream_id !== $this->aCcWebstream->getDbId()) { + $this->aCcWebstream = null; + } + if ($this->aCcBlock !== null && $this->block_id !== $this->aCcBlock->getDbId()) { + $this->aCcBlock = null; + } + if ($this->aCcPlaylist !== null && $this->playlist_id !== $this->aCcPlaylist->getDbId()) { + $this->aCcPlaylist = null; + } + } // ensureConsistency + + /** + * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. + * + * This will only work if the object has been saved and has a valid primary key set. + * + * @param boolean $deep (optional) Whether to also de-associated any related objects. + * @param PropelPDO $con (optional) The PropelPDO connection to use. + * @return void + * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db + */ + public function reload($deep = false, PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("Cannot reload a deleted object."); + } + + if ($this->isNew()) { + throw new PropelException("Cannot reload an unsaved object."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + // We don't need to alter the object instance pool; we're just modifying this instance + // already in the pool. + + $stmt = CcStampContentsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); + $row = $stmt->fetch(PDO::FETCH_NUM); + $stmt->closeCursor(); + if (!$row) { + throw new PropelException('Cannot find matching row in the database to reload object values.'); + } + $this->hydrate($row, 0, true); // rehydrate + + if ($deep) { // also de-associate any related objects? + + $this->aCcStamp = null; + $this->aCcFiles = null; + $this->aCcWebstream = null; + $this->aCcBlock = null; + $this->aCcPlaylist = null; + } // if (deep) + } + + /** + * Removes this object from datastore and sets delete attribute. + * + * @param PropelPDO $con + * @return void + * @throws PropelException + * @see BaseObject::setDeleted() + * @see BaseObject::isDeleted() + */ + public function delete(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("This object has already been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + try { + $ret = $this->preDelete($con); + if ($ret) { + CcStampContentsQuery::create() + ->filterByPrimaryKey($this->getPrimaryKey()) + ->delete($con); + $this->postDelete($con); + $con->commit(); + $this->setDeleted(true); + } else { + $con->commit(); + } + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Persists this object to the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All modified related objects will also be persisted in the doSave() + * method. This method wraps all precipitate database operations in a + * single transaction. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see doSave() + */ + public function save(PropelPDO $con = null) + { + if ($this->isDeleted()) { + throw new PropelException("You cannot save an object that has been deleted."); + } + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $con->beginTransaction(); + $isInsert = $this->isNew(); + try { + $ret = $this->preSave($con); + if ($isInsert) { + $ret = $ret && $this->preInsert($con); + } else { + $ret = $ret && $this->preUpdate($con); + } + if ($ret) { + $affectedRows = $this->doSave($con); + if ($isInsert) { + $this->postInsert($con); + } else { + $this->postUpdate($con); + } + $this->postSave($con); + CcStampContentsPeer::addInstanceToPool($this); + } else { + $affectedRows = 0; + } + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Performs the work of inserting or updating the row in the database. + * + * If the object is new, it inserts it; otherwise an update is performed. + * All related objects are also updated in this method. + * + * @param PropelPDO $con + * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. + * @throws PropelException + * @see save() + */ + protected function doSave(PropelPDO $con) + { + $affectedRows = 0; // initialize var to track total num of affected rows + if (!$this->alreadyInSave) { + $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->aCcStamp !== null) { + if ($this->aCcStamp->isModified() || $this->aCcStamp->isNew()) { + $affectedRows += $this->aCcStamp->save($con); + } + $this->setCcStamp($this->aCcStamp); + } + + if ($this->aCcFiles !== null) { + if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { + $affectedRows += $this->aCcFiles->save($con); + } + $this->setCcFiles($this->aCcFiles); + } + + if ($this->aCcWebstream !== null) { + if ($this->aCcWebstream->isModified() || $this->aCcWebstream->isNew()) { + $affectedRows += $this->aCcWebstream->save($con); + } + $this->setCcWebstream($this->aCcWebstream); + } + + if ($this->aCcBlock !== null) { + if ($this->aCcBlock->isModified() || $this->aCcBlock->isNew()) { + $affectedRows += $this->aCcBlock->save($con); + } + $this->setCcBlock($this->aCcBlock); + } + + if ($this->aCcPlaylist !== null) { + if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { + $affectedRows += $this->aCcPlaylist->save($con); + } + $this->setCcPlaylist($this->aCcPlaylist); + } + + if ($this->isNew() ) { + $this->modifiedColumns[] = CcStampContentsPeer::ID; + } + + // If this object has been modified, then save it to the database. + if ($this->isModified()) { + if ($this->isNew()) { + $criteria = $this->buildCriteria(); + if ($criteria->keyContainsValue(CcStampContentsPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcStampContentsPeer::ID.')'); + } + + $pk = BasePeer::doInsert($criteria, $con); + $affectedRows += 1; + $this->setDbId($pk); //[IMV] update autoincrement primary key + $this->setNew(false); + } else { + $affectedRows += CcStampContentsPeer::doUpdate($this, $con); + } + + $this->resetModified(); // [HL] After being saved an object is no longer 'modified' + } + + $this->alreadyInSave = false; + + } + return $affectedRows; + } // doSave() + + /** + * Array of ValidationFailed objects. + * @var array ValidationFailed[] + */ + protected $validationFailures = array(); + + /** + * Gets any ValidationFailed objects that resulted from last call to validate(). + * + * + * @return array ValidationFailed[] + * @see validate() + */ + public function getValidationFailures() + { + return $this->validationFailures; + } + + /** + * Validates the objects modified field values and all objects related to this table. + * + * If $columns is either a column name or an array of column names + * only those columns are validated. + * + * @param mixed $columns Column name or an array of column names. + * @return boolean Whether all columns pass validation. + * @see doValidate() + * @see getValidationFailures() + */ + public function validate($columns = null) + { + $res = $this->doValidate($columns); + if ($res === true) { + $this->validationFailures = array(); + return true; + } else { + $this->validationFailures = $res; + return false; + } + } + + /** + * This function performs the validation work for complex object models. + * + * In addition to checking the current object, all related objects will + * also be validated. If all pass then true is returned; otherwise + * an aggreagated array of ValidationFailed objects will be returned. + * + * @param array $columns Array of column names to validate. + * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. + */ + protected function doValidate($columns = null) + { + if (!$this->alreadyInValidation) { + $this->alreadyInValidation = true; + $retval = null; + + $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->aCcStamp !== null) { + if (!$this->aCcStamp->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcStamp->getValidationFailures()); + } + } + + if ($this->aCcFiles !== null) { + if (!$this->aCcFiles->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); + } + } + + if ($this->aCcWebstream !== null) { + if (!$this->aCcWebstream->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcWebstream->getValidationFailures()); + } + } + + if ($this->aCcBlock !== null) { + if (!$this->aCcBlock->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcBlock->getValidationFailures()); + } + } + + if ($this->aCcPlaylist !== null) { + if (!$this->aCcPlaylist->validate($columns)) { + $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); + } + } + + + if (($retval = CcStampContentsPeer::doValidate($this, $columns)) !== true) { + $failureMap = array_merge($failureMap, $retval); + } + + + + $this->alreadyInValidation = false; + } + + return (!empty($failureMap) ? $failureMap : true); + } + + /** + * Retrieves a field from the object by name passed in as a string. + * + * @param string $name name + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return mixed Value of field. + */ + public function getByName($name, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcStampContentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + $field = $this->getByPosition($pos); + return $field; + } + + /** + * Retrieves a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @return mixed Value of field at $pos + */ + public function getByPosition($pos) + { + switch($pos) { + case 0: + return $this->getDbId(); + break; + case 1: + return $this->getDbStampId(); + break; + case 2: + return $this->getDbFileId(); + break; + case 3: + return $this->getDbStreamId(); + break; + case 4: + return $this->getDbBlockId(); + break; + case 5: + return $this->getDbPlaylistId(); + break; + case 6: + return $this->getDbPosition(); + break; + case 7: + return $this->getDbClipLength(); + break; + case 8: + return $this->getDbCueIn(); + break; + case 9: + return $this->getDbCueOut(); + break; + case 10: + return $this->getDbFadeIn(); + break; + case 11: + return $this->getDbFadeOut(); + break; + default: + return null; + break; + } // switch() + } + + /** + * Exports the object as an array. + * + * You can specify the key type of the array by passing one of the class + * type constants. + * + * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * Defaults to BasePeer::TYPE_PHPNAME. + * @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 + */ + public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) + { + $keys = CcStampContentsPeer::getFieldNames($keyType); + $result = array( + $keys[0] => $this->getDbId(), + $keys[1] => $this->getDbStampId(), + $keys[2] => $this->getDbFileId(), + $keys[3] => $this->getDbStreamId(), + $keys[4] => $this->getDbBlockId(), + $keys[5] => $this->getDbPlaylistId(), + $keys[6] => $this->getDbPosition(), + $keys[7] => $this->getDbClipLength(), + $keys[8] => $this->getDbCueIn(), + $keys[9] => $this->getDbCueOut(), + $keys[10] => $this->getDbFadeIn(), + $keys[11] => $this->getDbFadeOut(), + ); + if ($includeForeignObjects) { + if (null !== $this->aCcStamp) { + $result['CcStamp'] = $this->aCcStamp->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcFiles) { + $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcWebstream) { + $result['CcWebstream'] = $this->aCcWebstream->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcBlock) { + $result['CcBlock'] = $this->aCcBlock->toArray($keyType, $includeLazyLoadColumns, true); + } + if (null !== $this->aCcPlaylist) { + $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true); + } + } + return $result; + } + + /** + * Sets a field from the object by name passed in as a string. + * + * @param string $name peer name + * @param mixed $value field value + * @param string $type The type of fieldname the $name is of: + * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM + * @return void + */ + public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) + { + $pos = CcStampContentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); + return $this->setByPosition($pos, $value); + } + + /** + * Sets a field from the object by Position as specified in the xml schema. + * Zero-based. + * + * @param int $pos position in xml schema + * @param mixed $value field value + * @return void + */ + public function setByPosition($pos, $value) + { + switch($pos) { + case 0: + $this->setDbId($value); + break; + case 1: + $this->setDbStampId($value); + break; + case 2: + $this->setDbFileId($value); + break; + case 3: + $this->setDbStreamId($value); + break; + case 4: + $this->setDbBlockId($value); + break; + case 5: + $this->setDbPlaylistId($value); + break; + case 6: + $this->setDbPosition($value); + break; + case 7: + $this->setDbClipLength($value); + break; + case 8: + $this->setDbCueIn($value); + break; + case 9: + $this->setDbCueOut($value); + break; + case 10: + $this->setDbFadeIn($value); + break; + case 11: + $this->setDbFadeOut($value); + break; + } // switch() + } + + /** + * Populates the object using an array. + * + * This is particularly useful when populating an object from one of the + * request arrays (e.g. $_POST). This method goes through the column + * names, checking to see whether a matching key exists in populated + * array. If so the setByName() method is called for that column. + * + * You can specify the key type of the array by additionally passing one + * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, + * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. + * The default key type is the column's phpname (e.g. 'AuthorId') + * + * @param array $arr An array to populate the object from. + * @param string $keyType The type of keys the array uses. + * @return void + */ + public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) + { + $keys = CcStampContentsPeer::getFieldNames($keyType); + + if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); + if (array_key_exists($keys[1], $arr)) $this->setDbStampId($arr[$keys[1]]); + if (array_key_exists($keys[2], $arr)) $this->setDbFileId($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setDbStreamId($arr[$keys[3]]); + if (array_key_exists($keys[4], $arr)) $this->setDbBlockId($arr[$keys[4]]); + if (array_key_exists($keys[5], $arr)) $this->setDbPlaylistId($arr[$keys[5]]); + if (array_key_exists($keys[6], $arr)) $this->setDbPosition($arr[$keys[6]]); + if (array_key_exists($keys[7], $arr)) $this->setDbClipLength($arr[$keys[7]]); + if (array_key_exists($keys[8], $arr)) $this->setDbCueIn($arr[$keys[8]]); + if (array_key_exists($keys[9], $arr)) $this->setDbCueOut($arr[$keys[9]]); + if (array_key_exists($keys[10], $arr)) $this->setDbFadeIn($arr[$keys[10]]); + if (array_key_exists($keys[11], $arr)) $this->setDbFadeOut($arr[$keys[11]]); + } + + /** + * Build a Criteria object containing the values of all modified columns in this object. + * + * @return Criteria The Criteria object containing all modified values. + */ + public function buildCriteria() + { + $criteria = new Criteria(CcStampContentsPeer::DATABASE_NAME); + + if ($this->isColumnModified(CcStampContentsPeer::ID)) $criteria->add(CcStampContentsPeer::ID, $this->id); + if ($this->isColumnModified(CcStampContentsPeer::STAMP_ID)) $criteria->add(CcStampContentsPeer::STAMP_ID, $this->stamp_id); + if ($this->isColumnModified(CcStampContentsPeer::FILE_ID)) $criteria->add(CcStampContentsPeer::FILE_ID, $this->file_id); + if ($this->isColumnModified(CcStampContentsPeer::STREAM_ID)) $criteria->add(CcStampContentsPeer::STREAM_ID, $this->stream_id); + if ($this->isColumnModified(CcStampContentsPeer::BLOCK_ID)) $criteria->add(CcStampContentsPeer::BLOCK_ID, $this->block_id); + if ($this->isColumnModified(CcStampContentsPeer::PLAYLIST_ID)) $criteria->add(CcStampContentsPeer::PLAYLIST_ID, $this->playlist_id); + if ($this->isColumnModified(CcStampContentsPeer::POSITION)) $criteria->add(CcStampContentsPeer::POSITION, $this->position); + if ($this->isColumnModified(CcStampContentsPeer::CLIP_LENGTH)) $criteria->add(CcStampContentsPeer::CLIP_LENGTH, $this->clip_length); + if ($this->isColumnModified(CcStampContentsPeer::CUE_IN)) $criteria->add(CcStampContentsPeer::CUE_IN, $this->cue_in); + if ($this->isColumnModified(CcStampContentsPeer::CUE_OUT)) $criteria->add(CcStampContentsPeer::CUE_OUT, $this->cue_out); + if ($this->isColumnModified(CcStampContentsPeer::FADE_IN)) $criteria->add(CcStampContentsPeer::FADE_IN, $this->fade_in); + if ($this->isColumnModified(CcStampContentsPeer::FADE_OUT)) $criteria->add(CcStampContentsPeer::FADE_OUT, $this->fade_out); + + return $criteria; + } + + /** + * Builds a Criteria object containing the primary key for this object. + * + * Unlike buildCriteria() this method includes the primary key values regardless + * of whether or not they have been modified. + * + * @return Criteria The Criteria object containing value(s) for primary key(s). + */ + public function buildPkeyCriteria() + { + $criteria = new Criteria(CcStampContentsPeer::DATABASE_NAME); + $criteria->add(CcStampContentsPeer::ID, $this->id); + + return $criteria; + } + + /** + * Returns the primary key for this object (row). + * @return int + */ + public function getPrimaryKey() + { + return $this->getDbId(); + } + + /** + * Generic method to set the primary key (id column). + * + * @param int $key Primary key. + * @return void + */ + public function setPrimaryKey($key) + { + $this->setDbId($key); + } + + /** + * Returns true if the primary key for this object is null. + * @return boolean + */ + public function isPrimaryKeyNull() + { + return null === $this->getDbId(); + } + + /** + * Sets contents of passed object to values from current object. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param object $copyObj An object of CcStampContents (or compatible) type. + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @throws PropelException + */ + public function copyInto($copyObj, $deepCopy = false) + { + $copyObj->setDbStampId($this->stamp_id); + $copyObj->setDbFileId($this->file_id); + $copyObj->setDbStreamId($this->stream_id); + $copyObj->setDbBlockId($this->block_id); + $copyObj->setDbPlaylistId($this->playlist_id); + $copyObj->setDbPosition($this->position); + $copyObj->setDbClipLength($this->clip_length); + $copyObj->setDbCueIn($this->cue_in); + $copyObj->setDbCueOut($this->cue_out); + $copyObj->setDbFadeIn($this->fade_in); + $copyObj->setDbFadeOut($this->fade_out); + + $copyObj->setNew(true); + $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value + } + + /** + * Makes a copy of this object that will be inserted as a new row in table when saved. + * It creates a new object filling in the simple attributes, but skipping any primary + * keys that are defined for the table. + * + * If desired, this method can also make copies of all associated (fkey referrers) + * objects. + * + * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. + * @return CcStampContents Clone of current object. + * @throws PropelException + */ + public function copy($deepCopy = false) + { + // we use get_class(), because this might be a subclass + $clazz = get_class($this); + $copyObj = new $clazz(); + $this->copyInto($copyObj, $deepCopy); + return $copyObj; + } + + /** + * Returns a peer instance associated with this om. + * + * Since Peer classes are not to have any instance attributes, this method returns the + * same instance for all member of this class. The method could therefore + * be static, but this would prevent one from overriding the behavior. + * + * @return CcStampContentsPeer + */ + public function getPeer() + { + if (self::$peer === null) { + self::$peer = new CcStampContentsPeer(); + } + return self::$peer; + } + + /** + * Declares an association between this object and a CcStamp object. + * + * @param CcStamp $v + * @return CcStampContents The current object (for fluent API support) + * @throws PropelException + */ + public function setCcStamp(CcStamp $v = null) + { + if ($v === null) { + $this->setDbStampId(NULL); + } else { + $this->setDbStampId($v->getDbId()); + } + + $this->aCcStamp = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcStamp object, it will not be re-added. + if ($v !== null) { + $v->addCcStampContents($this); + } + + return $this; + } + + + /** + * Get the associated CcStamp object + * + * @param PropelPDO Optional Connection object. + * @return CcStamp The associated CcStamp object. + * @throws PropelException + */ + public function getCcStamp(PropelPDO $con = null) + { + if ($this->aCcStamp === null && ($this->stamp_id !== null)) { + $this->aCcStamp = CcStampQuery::create()->findPk($this->stamp_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->aCcStamp->addCcStampContentss($this); + */ + } + return $this->aCcStamp; + } + + /** + * Declares an association between this object and a CcFiles object. + * + * @param CcFiles $v + * @return CcStampContents The current object (for fluent API support) + * @throws PropelException + */ + public function setCcFiles(CcFiles $v = null) + { + if ($v === null) { + $this->setDbFileId(NULL); + } else { + $this->setDbFileId($v->getDbId()); + } + + $this->aCcFiles = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcFiles object, it will not be re-added. + if ($v !== null) { + $v->addCcStampContents($this); + } + + return $this; + } + + + /** + * Get the associated CcFiles object + * + * @param PropelPDO Optional Connection object. + * @return CcFiles The associated CcFiles object. + * @throws PropelException + */ + public function getCcFiles(PropelPDO $con = null) + { + if ($this->aCcFiles === null && ($this->file_id !== null)) { + $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcStampContentss($this); + */ + } + return $this->aCcFiles; + } + + /** + * Declares an association between this object and a CcWebstream object. + * + * @param CcWebstream $v + * @return CcStampContents The current object (for fluent API support) + * @throws PropelException + */ + public function setCcWebstream(CcWebstream $v = null) + { + if ($v === null) { + $this->setDbStreamId(NULL); + } else { + $this->setDbStreamId($v->getDbId()); + } + + $this->aCcWebstream = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcWebstream object, it will not be re-added. + if ($v !== null) { + $v->addCcStampContents($this); + } + + return $this; + } + + + /** + * Get the associated CcWebstream object + * + * @param PropelPDO Optional Connection object. + * @return CcWebstream The associated CcWebstream object. + * @throws PropelException + */ + public function getCcWebstream(PropelPDO $con = null) + { + if ($this->aCcWebstream === null && ($this->stream_id !== null)) { + $this->aCcWebstream = CcWebstreamQuery::create()->findPk($this->stream_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->aCcWebstream->addCcStampContentss($this); + */ + } + return $this->aCcWebstream; + } + + /** + * Declares an association between this object and a CcBlock object. + * + * @param CcBlock $v + * @return CcStampContents The current object (for fluent API support) + * @throws PropelException + */ + public function setCcBlock(CcBlock $v = null) + { + if ($v === null) { + $this->setDbBlockId(NULL); + } else { + $this->setDbBlockId($v->getDbId()); + } + + $this->aCcBlock = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcBlock object, it will not be re-added. + if ($v !== null) { + $v->addCcStampContents($this); + } + + return $this; + } + + + /** + * Get the associated CcBlock object + * + * @param PropelPDO Optional Connection object. + * @return CcBlock The associated CcBlock object. + * @throws PropelException + */ + public function getCcBlock(PropelPDO $con = null) + { + if ($this->aCcBlock === null && ($this->block_id !== null)) { + $this->aCcBlock = CcBlockQuery::create()->findPk($this->block_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->aCcBlock->addCcStampContentss($this); + */ + } + return $this->aCcBlock; + } + + /** + * Declares an association between this object and a CcPlaylist object. + * + * @param CcPlaylist $v + * @return CcStampContents The current object (for fluent API support) + * @throws PropelException + */ + public function setCcPlaylist(CcPlaylist $v = null) + { + if ($v === null) { + $this->setDbPlaylistId(NULL); + } else { + $this->setDbPlaylistId($v->getDbId()); + } + + $this->aCcPlaylist = $v; + + // Add binding for other direction of this n:n relationship. + // If this object has already been added to the CcPlaylist object, it will not be re-added. + if ($v !== null) { + $v->addCcStampContents($this); + } + + return $this; + } + + + /** + * Get the associated CcPlaylist object + * + * @param PropelPDO Optional Connection object. + * @return CcPlaylist The associated CcPlaylist object. + * @throws PropelException + */ + public function getCcPlaylist(PropelPDO $con = null) + { + if ($this->aCcPlaylist === null && ($this->playlist_id !== null)) { + $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->playlist_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->aCcPlaylist->addCcStampContentss($this); + */ + } + return $this->aCcPlaylist; + } + + /** + * Clears the current object and sets all attributes to their default values + */ + public function clear() + { + $this->id = null; + $this->stamp_id = null; + $this->file_id = null; + $this->stream_id = null; + $this->block_id = null; + $this->playlist_id = null; + $this->position = null; + $this->clip_length = null; + $this->cue_in = null; + $this->cue_out = null; + $this->fade_in = null; + $this->fade_out = null; + $this->alreadyInSave = false; + $this->alreadyInValidation = false; + $this->clearAllReferences(); + $this->applyDefaultValues(); + $this->resetModified(); + $this->setNew(true); + $this->setDeleted(false); + } + + /** + * Resets all collections of referencing foreign keys. + * + * This method is a user-space workaround for PHP's inability to garbage collect objects + * with circular references. This is currently necessary when using Propel in certain + * daemon or large-volumne/high-memory operations. + * + * @param boolean $deep Whether to also clear the references on all associated objects. + */ + public function clearAllReferences($deep = false) + { + if ($deep) { + } // if ($deep) + + $this->aCcStamp = null; + $this->aCcFiles = null; + $this->aCcWebstream = null; + $this->aCcBlock = null; + $this->aCcPlaylist = null; + } + + /** + * Catches calls to virtual methods + */ + public function __call($name, $params) + { + if (preg_match('/get(\w+)/', $name, $matches)) { + $virtualColumn = $matches[1]; + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + // no lcfirst in php<5.3... + $virtualColumn[0] = strtolower($virtualColumn[0]); + if ($this->hasVirtualColumn($virtualColumn)) { + return $this->getVirtualColumn($virtualColumn); + } + } + throw new PropelException('Call to undefined method: ' . $name); + } + +} // BaseCcStampContents diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampContentsPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcStampContentsPeer.php new file mode 100644 index 000000000..490941207 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampContentsPeer.php @@ -0,0 +1,2592 @@ + array ('DbId', 'DbStampId', 'DbFileId', 'DbStreamId', 'DbBlockId', 'DbPlaylistId', 'DbPosition', 'DbClipLength', 'DbCueIn', 'DbCueOut', 'DbFadeIn', 'DbFadeOut', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStampId', 'dbFileId', 'dbStreamId', 'dbBlockId', 'dbPlaylistId', 'dbPosition', 'dbClipLength', 'dbCueIn', 'dbCueOut', 'dbFadeIn', 'dbFadeOut', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::STAMP_ID, self::FILE_ID, self::STREAM_ID, self::BLOCK_ID, self::PLAYLIST_ID, self::POSITION, self::CLIP_LENGTH, self::CUE_IN, self::CUE_OUT, self::FADE_IN, self::FADE_OUT, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STAMP_ID', 'FILE_ID', 'STREAM_ID', 'BLOCK_ID', 'PLAYLIST_ID', 'POSITION', 'CLIP_LENGTH', 'CUE_IN', 'CUE_OUT', 'FADE_IN', 'FADE_OUT', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'stamp_id', 'file_id', 'stream_id', 'block_id', 'playlist_id', 'position', 'clip_length', 'cue_in', 'cue_out', 'fade_in', 'fade_out', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) + ); + + /** + * 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, 'DbStampId' => 1, 'DbFileId' => 2, 'DbStreamId' => 3, 'DbBlockId' => 4, 'DbPlaylistId' => 5, 'DbPosition' => 6, 'DbClipLength' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbFadeIn' => 10, 'DbFadeOut' => 11, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStampId' => 1, 'dbFileId' => 2, 'dbStreamId' => 3, 'dbBlockId' => 4, 'dbPlaylistId' => 5, 'dbPosition' => 6, 'dbClipLength' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbFadeIn' => 10, 'dbFadeOut' => 11, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STAMP_ID => 1, self::FILE_ID => 2, self::STREAM_ID => 3, self::BLOCK_ID => 4, self::PLAYLIST_ID => 5, self::POSITION => 6, self::CLIP_LENGTH => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::FADE_IN => 10, self::FADE_OUT => 11, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STAMP_ID' => 1, 'FILE_ID' => 2, 'STREAM_ID' => 3, 'BLOCK_ID' => 4, 'PLAYLIST_ID' => 5, 'POSITION' => 6, 'CLIP_LENGTH' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'FADE_IN' => 10, 'FADE_OUT' => 11, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'stamp_id' => 1, 'file_id' => 2, 'stream_id' => 3, 'block_id' => 4, 'playlist_id' => 5, 'position' => 6, 'clip_length' => 7, 'cue_in' => 8, 'cue_out' => 9, 'fade_in' => 10, 'fade_out' => 11, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) + ); + + /** + * 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. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. CcStampContentsPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(CcStampContentsPeer::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(CcStampContentsPeer::ID); + $criteria->addSelectColumn(CcStampContentsPeer::STAMP_ID); + $criteria->addSelectColumn(CcStampContentsPeer::FILE_ID); + $criteria->addSelectColumn(CcStampContentsPeer::STREAM_ID); + $criteria->addSelectColumn(CcStampContentsPeer::BLOCK_ID); + $criteria->addSelectColumn(CcStampContentsPeer::PLAYLIST_ID); + $criteria->addSelectColumn(CcStampContentsPeer::POSITION); + $criteria->addSelectColumn(CcStampContentsPeer::CLIP_LENGTH); + $criteria->addSelectColumn(CcStampContentsPeer::CUE_IN); + $criteria->addSelectColumn(CcStampContentsPeer::CUE_OUT); + $criteria->addSelectColumn(CcStampContentsPeer::FADE_IN); + $criteria->addSelectColumn(CcStampContentsPeer::FADE_OUT); + } else { + $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.STAMP_ID'); + $criteria->addSelectColumn($alias . '.FILE_ID'); + $criteria->addSelectColumn($alias . '.STREAM_ID'); + $criteria->addSelectColumn($alias . '.BLOCK_ID'); + $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); + $criteria->addSelectColumn($alias . '.POSITION'); + $criteria->addSelectColumn($alias . '.CLIP_LENGTH'); + $criteria->addSelectColumn($alias . '.CUE_IN'); + $criteria->addSelectColumn($alias . '.CUE_OUT'); + $criteria->addSelectColumn($alias . '.FADE_IN'); + $criteria->addSelectColumn($alias . '.FADE_OUT'); + } + } + + /** + * 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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::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 CcStampContents + * @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 = CcStampContentsPeer::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 CcStampContentsPeer::populateObjects(CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + if (!$criteria->hasSelectClause()) { + $criteria = clone $criteria; + CcStampContentsPeer::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 CcStampContents $value A CcStampContents object. + * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). + */ + public static function addInstanceToPool(CcStampContents $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 CcStampContents object or a primary key value. + */ + public static function removeInstanceFromPool($value) + { + if (Propel::isInstancePoolingEnabled() && $value !== null) { + if (is_object($value) && $value instanceof CcStampContents) { + $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 CcStampContents 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 CcStampContents 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_stamp_contents + * by a foreign key with ON DELETE CASCADE + */ + public static function clearRelatedInstancePool() + { + } + + /** + * 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 = CcStampContentsPeer::getOMClass(false); + // populate the object(s) + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj = CcStampContentsPeer::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; + CcStampContentsPeer::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 (CcStampContents object, last column rank) + */ + public static function populateObject($row, $startcol = 0) + { + $key = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, $startcol); + if (null !== ($obj = CcStampContentsPeer::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 + CcStampContentsPeer::NUM_COLUMNS; + } else { + $cls = CcStampContentsPeer::OM_CLASS; + $obj = new $cls(); + $col = $obj->hydrate($row, $startcol); + CcStampContentsPeer::addInstanceToPool($obj, $key); + } + return array($obj, $col); + } + + /** + * Returns the number of rows matching criteria, joining the related CcStamp 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 doCountJoinCcStamp(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinCcWebstream(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinCcBlock(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinCcPlaylist(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcStampContents objects pre-filled with their CcStamp 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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcStamp(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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + CcStampPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcStampContents) to $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with their CcFiles 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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcFiles(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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + CcFilesPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcFilesPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcFilesPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcStampContents) to $obj2 (CcFiles) + $obj2->addCcStampContents($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with their CcWebstream 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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcWebstream(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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + CcWebstreamPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcWebstreamPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcWebstreamPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcStampContents) to $obj2 (CcWebstream) + $obj2->addCcStampContents($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with their CcBlock 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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcBlock(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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + CcBlockPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcBlockPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcBlockPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcStampContents) to $obj2 (CcBlock) + $obj2->addCcStampContents($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with their CcPlaylist 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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinCcPlaylist(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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + CcPlaylistPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if $obj1 already loaded + + $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); + if ($key2 !== null) { + $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol); + CcPlaylistPeer::addInstanceToPool($obj2, $key2); + } // if obj2 already loaded + + // Add the $obj1 (CcStampContents) to $obj2 (CcPlaylist) + $obj2->addCcStampContents($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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcStampContents 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 CcStampContents 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); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcStampPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcStamp rows + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if obj2 loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + } // if joined row not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if obj3 loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcFiles) + $obj3->addCcStampContents($obj1); + } // if joined row not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if obj4 loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcWebstream) + $obj4->addCcStampContents($obj1); + } // if joined row not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if obj5 loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcBlock) + $obj5->addCcStampContents($obj1); + } // if joined row not null + + // Add objects for joined CcPlaylist rows + + $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); + if ($key6 !== null) { + $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); + if (!$obj6) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj6 = new $cls(); + $obj6->hydrate($row, $startcol6); + CcPlaylistPeer::addInstanceToPool($obj6, $key6); + } // if obj6 loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj6 (CcPlaylist) + $obj6->addCcStampContents($obj1); + } // if joined row not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcStamp 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 doCountJoinAllExceptCcStamp(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinAllExceptCcWebstream(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinAllExceptCcBlock(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; + } + + + /** + * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinAllExceptCcPlaylist(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(CcStampContentsPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampContentsPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::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 CcStampContents objects pre-filled with all related objects except CcStamp. + * + * @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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcStamp(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcFiles rows + + $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcFilesPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcFilesPeer::addInstanceToPool($obj2, $key2); + } // if $obj2 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcFiles) + $obj2->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key3 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcWebstreamPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcWebstreamPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcWebstream) + $obj3->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key4 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcBlockPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcBlockPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcBlock) + $obj4->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key5 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcPlaylistPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcPlaylistPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcPlaylist) + $obj5->addCcStampContents($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with all related objects except CcFiles. + * + * @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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcStampPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcStamp rows + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if $obj2 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key3 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcWebstreamPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcWebstreamPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcWebstream) + $obj3->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key4 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcBlockPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcBlockPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcBlock) + $obj4->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key5 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcPlaylistPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcPlaylistPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcPlaylist) + $obj5->addCcStampContents($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with all related objects except CcWebstream. + * + * @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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcWebstream(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcStampPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcStamp rows + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if $obj2 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcFiles) + $obj3->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key4 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcBlockPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcBlockPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcBlock) + $obj4->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key5 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcPlaylistPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcPlaylistPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcPlaylist) + $obj5->addCcStampContents($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with all related objects except CcBlock. + * + * @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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcBlock(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcStampPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcPlaylistPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcStamp rows + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if $obj2 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcFiles) + $obj3->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcWebstream) + $obj4->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcPlaylist rows + + $key5 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcPlaylistPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcPlaylistPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcPlaylistPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcPlaylist) + $obj5->addCcStampContents($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStampContents objects pre-filled with all related objects except CcPlaylist. + * + * @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 CcStampContents objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampContentsPeer::addSelectColumns($criteria); + $startcol2 = (CcStampContentsPeer::NUM_COLUMNS - CcStampContentsPeer::NUM_LAZY_LOAD_COLUMNS); + + CcStampPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcFilesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); + + CcWebstreamPeer::addSelectColumns($criteria); + $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); + + CcBlockPeer::addSelectColumns($criteria); + $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampContentsPeer::STAMP_ID, CcStampPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampContentsPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampContentsPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampContentsPeer::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 = CcStampContentsPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampContentsPeer::addInstanceToPool($obj1, $key1); + } // if obj1 already loaded + + // Add objects for joined CcStamp rows + + $key2 = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol2); + if ($key2 !== null) { + $obj2 = CcStampPeer::getInstanceFromPool($key2); + if (!$obj2) { + + $cls = CcStampPeer::getOMClass(false); + + $obj2 = new $cls(); + $obj2->hydrate($row, $startcol2); + CcStampPeer::addInstanceToPool($obj2, $key2); + } // if $obj2 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj2 (CcStamp) + $obj2->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcFiles rows + + $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcFilesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcFilesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcFilesPeer::addInstanceToPool($obj3, $key3); + } // if $obj3 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj3 (CcFiles) + $obj3->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcWebstream rows + + $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); + if ($key4 !== null) { + $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); + if (!$obj4) { + + $cls = CcWebstreamPeer::getOMClass(false); + + $obj4 = new $cls(); + $obj4->hydrate($row, $startcol4); + CcWebstreamPeer::addInstanceToPool($obj4, $key4); + } // if $obj4 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj4 (CcWebstream) + $obj4->addCcStampContents($obj1); + + } // if joined row is not null + + // Add objects for joined CcBlock rows + + $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); + if ($key5 !== null) { + $obj5 = CcBlockPeer::getInstanceFromPool($key5); + if (!$obj5) { + + $cls = CcBlockPeer::getOMClass(false); + + $obj5 = new $cls(); + $obj5->hydrate($row, $startcol5); + CcBlockPeer::addInstanceToPool($obj5, $key5); + } // if $obj5 already loaded + + // Add the $obj1 (CcStampContents) to the collection in $obj5 (CcBlock) + $obj5->addCcStampContents($obj1); + + } // if joined row is 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(BaseCcStampContentsPeer::DATABASE_NAME); + if (!$dbMap->hasTable(BaseCcStampContentsPeer::TABLE_NAME)) + { + $dbMap->addTableObject(new CcStampContentsTableMap()); + } + } + + /** + * 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 ? CcStampContentsPeer::CLASS_DEFAULT : CcStampContentsPeer::OM_CLASS; + } + + /** + * Method perform an INSERT on the database, given a CcStampContents or Criteria object. + * + * @param mixed $values Criteria or CcStampContents 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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from CcStampContents object + } + + if ($criteria->containsKey(CcStampContentsPeer::ID) && $criteria->keyContainsValue(CcStampContentsPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcStampContentsPeer::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 CcStampContents or Criteria object. + * + * @param mixed $values Criteria or CcStampContents 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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(CcStampContentsPeer::ID); + $value = $criteria->remove(CcStampContentsPeer::ID); + if ($value) { + $selectCriteria->add(CcStampContentsPeer::ID, $value, $comparison); + } else { + $selectCriteria->setPrimaryTableName(CcStampContentsPeer::TABLE_NAME); + } + + } else { // $values is CcStampContents 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_stamp_contents 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(CcStampContentsPeer::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(CcStampContentsPeer::TABLE_NAME, $con, CcStampContentsPeer::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). + CcStampContentsPeer::clearInstancePool(); + CcStampContentsPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a CcStampContents or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or CcStampContents 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(CcStampContentsPeer::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. + CcStampContentsPeer::clearInstancePool(); + // rename for clarity + $criteria = clone $values; + } elseif ($values instanceof CcStampContents) { // it's a model object + // invalidate the cache for this single object + CcStampContentsPeer::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(CcStampContentsPeer::ID, (array) $values, Criteria::IN); + // invalidate the cache for this object(s) + foreach ((array) $values as $singleval) { + CcStampContentsPeer::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); + CcStampContentsPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Validates all modified columns of given CcStampContents 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 CcStampContents $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(CcStampContents $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(CcStampContentsPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, CcStampContentsPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param int $pk the primary key. + * @param PropelPDO $con the connection to use + * @return CcStampContents + */ + public static function retrieveByPK($pk, PropelPDO $con = null) + { + + if (null !== ($obj = CcStampContentsPeer::getInstanceFromPool((string) $pk))) { + return $obj; + } + + if ($con === null) { + $con = Propel::getConnection(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria = new Criteria(CcStampContentsPeer::DATABASE_NAME); + $criteria->add(CcStampContentsPeer::ID, $pk); + + $v = CcStampContentsPeer::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(CcStampContentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(CcStampContentsPeer::DATABASE_NAME); + $criteria->add(CcStampContentsPeer::ID, $pks, Criteria::IN); + $objs = CcStampContentsPeer::doSelect($criteria, $con); + } + return $objs; + } + +} // BaseCcStampContentsPeer + +// This is the static code needed to register the TableMap for this table with the main Propel class. +// +BaseCcStampContentsPeer::buildTableMap(); + diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampContentsQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcStampContentsQuery.php new file mode 100644 index 000000000..fbbcd3601 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampContentsQuery.php @@ -0,0 +1,845 @@ +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 + * + * $obj = $c->findPk(12, $con); + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con an optional connection object + * + * @return CcStampContents|array|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ((null !== ($obj = CcStampContentsPeer::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 + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + return $this->addUsingAlias(CcStampContentsPeer::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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + return $this->addUsingAlias(CcStampContentsPeer::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 CcStampContentsQuery 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(CcStampContentsPeer::ID, $dbId, $comparison); + } + + /** + * Filter the query on the stamp_id column + * + * @param int|array $dbStampId 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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbStampId($dbStampId = null, $comparison = null) + { + if (is_array($dbStampId)) { + $useMinMax = false; + if (isset($dbStampId['min'])) { + $this->addUsingAlias(CcStampContentsPeer::STAMP_ID, $dbStampId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbStampId['max'])) { + $this->addUsingAlias(CcStampContentsPeer::STAMP_ID, $dbStampId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::STAMP_ID, $dbStampId, $comparison); + } + + /** + * Filter the query on the file_id column + * + * @param int|array $dbFileId 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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbFileId($dbFileId = null, $comparison = null) + { + if (is_array($dbFileId)) { + $useMinMax = false; + if (isset($dbFileId['min'])) { + $this->addUsingAlias(CcStampContentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbFileId['max'])) { + $this->addUsingAlias(CcStampContentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::FILE_ID, $dbFileId, $comparison); + } + + /** + * Filter the query on the stream_id column + * + * @param int|array $dbStreamId 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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbStreamId($dbStreamId = null, $comparison = null) + { + if (is_array($dbStreamId)) { + $useMinMax = false; + if (isset($dbStreamId['min'])) { + $this->addUsingAlias(CcStampContentsPeer::STREAM_ID, $dbStreamId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbStreamId['max'])) { + $this->addUsingAlias(CcStampContentsPeer::STREAM_ID, $dbStreamId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::STREAM_ID, $dbStreamId, $comparison); + } + + /** + * Filter the query on the block_id column + * + * @param int|array $dbBlockId 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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbBlockId($dbBlockId = null, $comparison = null) + { + if (is_array($dbBlockId)) { + $useMinMax = false; + if (isset($dbBlockId['min'])) { + $this->addUsingAlias(CcStampContentsPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbBlockId['max'])) { + $this->addUsingAlias(CcStampContentsPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::BLOCK_ID, $dbBlockId, $comparison); + } + + /** + * Filter the query on the playlist_id column + * + * @param int|array $dbPlaylistId 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 CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) + { + if (is_array($dbPlaylistId)) { + $useMinMax = false; + if (isset($dbPlaylistId['min'])) { + $this->addUsingAlias(CcStampContentsPeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbPlaylistId['max'])) { + $this->addUsingAlias(CcStampContentsPeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::PLAYLIST_ID, $dbPlaylistId, $comparison); + } + + /** + * Filter the query on the position column + * + * @param int|array $dbPosition The value to use as filter. + * Accepts an associative array('min' => $minValue, 'max' => $maxValue) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbPosition($dbPosition = null, $comparison = null) + { + if (is_array($dbPosition)) { + $useMinMax = false; + if (isset($dbPosition['min'])) { + $this->addUsingAlias(CcStampContentsPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbPosition['max'])) { + $this->addUsingAlias(CcStampContentsPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampContentsPeer::POSITION, $dbPosition, $comparison); + } + + /** + * Filter the query on the clip_length column + * + * @param string $dbClipLength The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbClipLength($dbClipLength = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbClipLength)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbClipLength)) { + $dbClipLength = str_replace('*', '%', $dbClipLength); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcStampContentsPeer::CLIP_LENGTH, $dbClipLength, $comparison); + } + + /** + * Filter the query on the cue_in column + * + * @param string $dbCueIn The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbCueIn($dbCueIn = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbCueIn)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbCueIn)) { + $dbCueIn = str_replace('*', '%', $dbCueIn); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcStampContentsPeer::CUE_IN, $dbCueIn, $comparison); + } + + /** + * Filter the query on the cue_out column + * + * @param string $dbCueOut The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbCueOut($dbCueOut = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbCueOut)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbCueOut)) { + $dbCueOut = str_replace('*', '%', $dbCueOut); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcStampContentsPeer::CUE_OUT, $dbCueOut, $comparison); + } + + /** + * Filter the query on the fade_in column + * + * @param string $dbFadeIn The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbFadeIn($dbFadeIn = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbFadeIn)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbFadeIn)) { + $dbFadeIn = str_replace('*', '%', $dbFadeIn); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcStampContentsPeer::FADE_IN, $dbFadeIn, $comparison); + } + + /** + * Filter the query on the fade_out column + * + * @param string $dbFadeOut The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByDbFadeOut($dbFadeOut = null, $comparison = null) + { + if (null === $comparison) { + if (is_array($dbFadeOut)) { + $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbFadeOut)) { + $dbFadeOut = str_replace('*', '%', $dbFadeOut); + $comparison = Criteria::LIKE; + } + } + return $this->addUsingAlias(CcStampContentsPeer::FADE_OUT, $dbFadeOut, $comparison); + } + + /** + * Filter the query by a related CcStamp object + * + * @param CcStamp $ccStamp the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByCcStamp($ccStamp, $comparison = null) + { + return $this + ->addUsingAlias(CcStampContentsPeer::STAMP_ID, $ccStamp->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcStamp relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function joinCcStamp($relationAlias = '', $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcStamp'); + + // 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, 'CcStamp'); + } + + return $this; + } + + /** + * Use the CcStamp relation CcStamp 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 CcStampQuery A secondary query class using the current class as primary query + */ + public function useCcStampQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinCcStamp($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStamp', 'CcStampQuery'); + } + + /** + * Filter the query by a related CcFiles object + * + * @param CcFiles $ccFiles the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByCcFiles($ccFiles, $comparison = null) + { + return $this + ->addUsingAlias(CcStampContentsPeer::FILE_ID, $ccFiles->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcFiles relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcFiles'); + + // 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, 'CcFiles'); + } + + return $this; + } + + /** + * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query + */ + public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcFiles($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); + } + + /** + * Filter the query by a related CcWebstream object + * + * @param CcWebstream $ccWebstream the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByCcWebstream($ccWebstream, $comparison = null) + { + return $this + ->addUsingAlias(CcStampContentsPeer::STREAM_ID, $ccWebstream->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcWebstream relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function joinCcWebstream($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcWebstream'); + + // 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, 'CcWebstream'); + } + + return $this; + } + + /** + * Use the CcWebstream relation CcWebstream 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 CcWebstreamQuery A secondary query class using the current class as primary query + */ + public function useCcWebstreamQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcWebstream($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcWebstream', 'CcWebstreamQuery'); + } + + /** + * Filter the query by a related CcBlock object + * + * @param CcBlock $ccBlock the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByCcBlock($ccBlock, $comparison = null) + { + return $this + ->addUsingAlias(CcStampContentsPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcBlock relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcBlock'); + + // 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, 'CcBlock'); + } + + return $this; + } + + /** + * Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query + */ + public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcBlock($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery'); + } + + /** + * Filter the query by a related CcPlaylist object + * + * @param CcPlaylist $ccPlaylist the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function filterByCcPlaylist($ccPlaylist, $comparison = null) + { + return $this + ->addUsingAlias(CcStampContentsPeer::PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcPlaylist relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcPlaylist'); + + // 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, 'CcPlaylist'); + } + + return $this; + } + + /** + * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query + */ + public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinCcPlaylist($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); + } + + /** + * Exclude object from result + * + * @param CcStampContents $ccStampContents Object to remove from the list of results + * + * @return CcStampContentsQuery The current query, for fluid interface + */ + public function prune($ccStampContents = null) + { + if ($ccStampContents) { + $this->addUsingAlias(CcStampContentsPeer::ID, $ccStampContents->getDbId(), Criteria::NOT_EQUAL); + } + + return $this; + } + +} // BaseCcStampContentsQuery diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php new file mode 100644 index 000000000..d6db733c7 --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php @@ -0,0 +1,1368 @@ + array ('DbId', 'DbShowId', 'DbInstanceId', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbInstanceId', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::INSTANCE_ID, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'INSTANCE_ID', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'instance_id', ), + BasePeer::TYPE_NUM => array (0, 1, 2, ) + ); + + /** + * 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, 'DbShowId' => 1, 'DbInstanceId' => 2, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbInstanceId' => 2, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::INSTANCE_ID => 2, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'INSTANCE_ID' => 2, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'instance_id' => 2, ), + BasePeer::TYPE_NUM => array (0, 1, 2, ) + ); + + /** + * 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. + * + * $c->addAlias("alias1", TablePeer::TABLE_NAME); + * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); + * + * @param string $alias The alias for the current table. + * @param string $column The column name for current table. (i.e. CcStampPeer::COLUMN_NAME). + * @return string + */ + public static function alias($alias, $column) + { + return str_replace(CcStampPeer::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(CcStampPeer::ID); + $criteria->addSelectColumn(CcStampPeer::SHOW_ID); + $criteria->addSelectColumn(CcStampPeer::INSTANCE_ID); + } else { + $criteria->addSelectColumn($alias . '.ID'); + $criteria->addSelectColumn($alias . '.SHOW_ID'); + $criteria->addSelectColumn($alias . '.INSTANCE_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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::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(CcStampPeer::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 CcStamp + * @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 = CcStampPeer::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 CcStampPeer::populateObjects(CcStampPeer::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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + if (!$criteria->hasSelectClause()) { + $criteria = clone $criteria; + CcStampPeer::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 CcStamp $value A CcStamp object. + * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). + */ + public static function addInstanceToPool(CcStamp $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 CcStamp object or a primary key value. + */ + public static function removeInstanceFromPool($value) + { + if (Propel::isInstancePoolingEnabled() && $value !== null) { + if (is_object($value) && $value instanceof CcStamp) { + $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 CcStamp 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 CcStamp 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_stamp + * by a foreign key with ON DELETE CASCADE + */ + public static function clearRelatedInstancePool() + { + // Invalidate objects in CcStampContentsPeer instance pool, + // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. + CcStampContentsPeer::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 = CcStampPeer::getOMClass(false); + // populate the object(s) + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj = CcStampPeer::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; + CcStampPeer::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 (CcStamp object, last column rank) + */ + public static function populateObject($row, $startcol = 0) + { + $key = CcStampPeer::getPrimaryKeyHashFromRow($row, $startcol); + if (null !== ($obj = CcStampPeer::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 + CcStampPeer::NUM_COLUMNS; + } else { + $cls = CcStampPeer::OM_CLASS; + $obj = new $cls(); + $col = $obj->hydrate($row, $startcol); + CcStampPeer::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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampPeer::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; + } + + + /** + * 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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampPeer::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 CcStamp 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 CcStamp 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); + } + + CcStampPeer::addSelectColumns($criteria); + $startcol = (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcShowPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampPeer::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 = CcStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampPeer::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 (CcStamp) to $obj2 (CcShow) + $obj2->addCcStamp($obj1); + + } // if joined row was not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStamp 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 CcStamp 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); + } + + CcStampPeer::addSelectColumns($criteria); + $startcol = (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + CcShowInstancesPeer::addSelectColumns($criteria); + + $criteria->addJoin(CcStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampPeer::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 = CcStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampPeer::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 (CcStamp) to $obj2 (CcShowInstances) + $obj2->addCcStamp($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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampPeer::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 CcStamp 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 CcStamp 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); + } + + CcStampPeer::addSelectColumns($criteria); + $startcol2 = (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + $criteria->addJoin(CcStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampPeer::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 = CcStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampPeer::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 (CcStamp) to the collection in $obj2 (CcShow) + $obj2->addCcStamp($obj1); + } // if joined row not null + + // Add objects for joined CcShowInstances rows + + $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); + if ($key3 !== null) { + $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); + if (!$obj3) { + + $cls = CcShowInstancesPeer::getOMClass(false); + + $obj3 = new $cls(); + $obj3->hydrate($row, $startcol3); + CcShowInstancesPeer::addInstanceToPool($obj3, $key3); + } // if obj3 loaded + + // Add the $obj1 (CcStamp) to the collection in $obj3 (CcShowInstances) + $obj3->addCcStamp($obj1); + } // if joined row not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * 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 doCountJoinAllExceptCcShow(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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampPeer::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; + } + + + /** + * 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 doCountJoinAllExceptCcShowInstances(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(CcStampPeer::TABLE_NAME); + + if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { + $criteria->setDistinct(); + } + + if (!$criteria->hasSelectClause()) { + CcStampPeer::addSelectColumns($criteria); + } + + $criteria->clearOrderByColumns(); // ORDER BY should not affect count + + // Set the correct dbName + $criteria->setDbName(self::DATABASE_NAME); + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria->addJoin(CcStampPeer::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 CcStamp objects pre-filled with all related objects except CcShow. + * + * @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 CcStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampPeer::addSelectColumns($criteria); + $startcol2 = (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowInstancesPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampPeer::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 = CcStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampPeer::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 already loaded + + // Add the $obj1 (CcStamp) to the collection in $obj2 (CcShowInstances) + $obj2->addCcStamp($obj1); + + } // if joined row is not null + + $results[] = $obj1; + } + $stmt->closeCursor(); + return $results; + } + + + /** + * Selects a collection of CcStamp objects pre-filled with all related objects except CcShowInstances. + * + * @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 CcStamp objects. + * @throws PropelException Any exceptions caught during processing will be + * rethrown wrapped into a PropelException. + */ + public static function doSelectJoinAllExceptCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) + { + $criteria = clone $criteria; + + // Set the correct dbName if it has not been overridden + // $criteria->getDbName() will return the same object if not set to another value + // so == check is okay and faster + if ($criteria->getDbName() == Propel::getDefaultDB()) { + $criteria->setDbName(self::DATABASE_NAME); + } + + CcStampPeer::addSelectColumns($criteria); + $startcol2 = (CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS); + + CcShowPeer::addSelectColumns($criteria); + $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); + + $criteria->addJoin(CcStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); + + + $stmt = BasePeer::doSelect($criteria, $con); + $results = array(); + + while ($row = $stmt->fetch(PDO::FETCH_NUM)) { + $key1 = CcStampPeer::getPrimaryKeyHashFromRow($row, 0); + if (null !== ($obj1 = CcStampPeer::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 = CcStampPeer::getOMClass(false); + + $obj1 = new $cls(); + $obj1->hydrate($row); + CcStampPeer::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 already loaded + + // Add the $obj1 (CcStamp) to the collection in $obj2 (CcShow) + $obj2->addCcStamp($obj1); + + } // if joined row is 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(BaseCcStampPeer::DATABASE_NAME); + if (!$dbMap->hasTable(BaseCcStampPeer::TABLE_NAME)) + { + $dbMap->addTableObject(new CcStampTableMap()); + } + } + + /** + * 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 ? CcStampPeer::CLASS_DEFAULT : CcStampPeer::OM_CLASS; + } + + /** + * Method perform an INSERT on the database, given a CcStamp or Criteria object. + * + * @param mixed $values Criteria or CcStamp 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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + } else { + $criteria = $values->buildCriteria(); // build Criteria from CcStamp object + } + + if ($criteria->containsKey(CcStampPeer::ID) && $criteria->keyContainsValue(CcStampPeer::ID) ) { + throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcStampPeer::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 CcStamp or Criteria object. + * + * @param mixed $values Criteria or CcStamp 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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); + } + + $selectCriteria = new Criteria(self::DATABASE_NAME); + + if ($values instanceof Criteria) { + $criteria = clone $values; // rename for clarity + + $comparison = $criteria->getComparison(CcStampPeer::ID); + $value = $criteria->remove(CcStampPeer::ID); + if ($value) { + $selectCriteria->add(CcStampPeer::ID, $value, $comparison); + } else { + $selectCriteria->setPrimaryTableName(CcStampPeer::TABLE_NAME); + } + + } else { // $values is CcStamp 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_stamp 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(CcStampPeer::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(CcStampPeer::TABLE_NAME, $con, CcStampPeer::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). + CcStampPeer::clearInstancePool(); + CcStampPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Method perform a DELETE on the database, given a CcStamp or Criteria object OR a primary key value. + * + * @param mixed $values Criteria or CcStamp 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(CcStampPeer::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. + CcStampPeer::clearInstancePool(); + // rename for clarity + $criteria = clone $values; + } elseif ($values instanceof CcStamp) { // it's a model object + // invalidate the cache for this single object + CcStampPeer::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(CcStampPeer::ID, (array) $values, Criteria::IN); + // invalidate the cache for this object(s) + foreach ((array) $values as $singleval) { + CcStampPeer::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); + CcStampPeer::clearRelatedInstancePool(); + $con->commit(); + return $affectedRows; + } catch (PropelException $e) { + $con->rollBack(); + throw $e; + } + } + + /** + * Validates all modified columns of given CcStamp 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 CcStamp $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(CcStamp $obj, $cols = null) + { + $columns = array(); + + if ($cols) { + $dbMap = Propel::getDatabaseMap(CcStampPeer::DATABASE_NAME); + $tableMap = $dbMap->getTable(CcStampPeer::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(CcStampPeer::DATABASE_NAME, CcStampPeer::TABLE_NAME, $columns); + } + + /** + * Retrieve a single object by pkey. + * + * @param int $pk the primary key. + * @param PropelPDO $con the connection to use + * @return CcStamp + */ + public static function retrieveByPK($pk, PropelPDO $con = null) + { + + if (null !== ($obj = CcStampPeer::getInstanceFromPool((string) $pk))) { + return $obj; + } + + if ($con === null) { + $con = Propel::getConnection(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $criteria = new Criteria(CcStampPeer::DATABASE_NAME); + $criteria->add(CcStampPeer::ID, $pk); + + $v = CcStampPeer::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(CcStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); + } + + $objs = null; + if (empty($pks)) { + $objs = array(); + } else { + $criteria = new Criteria(CcStampPeer::DATABASE_NAME); + $criteria->add(CcStampPeer::ID, $pks, Criteria::IN); + $objs = CcStampPeer::doSelect($criteria, $con); + } + return $objs; + } + +} // BaseCcStampPeer + +// This is the static code needed to register the TableMap for this table with the main Propel class. +// +BaseCcStampPeer::buildTableMap(); + diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php new file mode 100644 index 000000000..ef2053a5a --- /dev/null +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php @@ -0,0 +1,439 @@ +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 + * + * $obj = $c->findPk(12, $con); + * + * @param mixed $key Primary key to use for the query + * @param PropelPDO $con an optional connection object + * + * @return CcStamp|array|mixed the result, formatted by the current formatter + */ + public function findPk($key, $con = null) + { + if ((null !== ($obj = CcStampPeer::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 + * + * $objs = $c->findPks(array(12, 56, 832), $con); + * + * @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 CcStampQuery The current query, for fluid interface + */ + public function filterByPrimaryKey($key) + { + return $this->addUsingAlias(CcStampPeer::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 CcStampQuery The current query, for fluid interface + */ + public function filterByPrimaryKeys($keys) + { + return $this->addUsingAlias(CcStampPeer::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 CcStampQuery 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(CcStampPeer::ID, $dbId, $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 CcStampQuery 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(CcStampPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbShowId['max'])) { + $this->addUsingAlias(CcStampPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampPeer::SHOW_ID, $dbShowId, $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 CcStampQuery 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(CcStampPeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbInstanceId['max'])) { + $this->addUsingAlias(CcStampPeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcStampPeer::INSTANCE_ID, $dbInstanceId, $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 CcStampQuery The current query, for fluid interface + */ + public function filterByCcShow($ccShow, $comparison = null) + { + return $this + ->addUsingAlias(CcStampPeer::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 CcStampQuery 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 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 CcStampQuery The current query, for fluid interface + */ + public function filterByCcShowInstances($ccShowInstances, $comparison = null) + { + return $this + ->addUsingAlias(CcStampPeer::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 CcStampQuery The current query, for fluid interface + */ + public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) + { + return $this + ->joinCcShowInstances($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery'); + } + + /** + * Filter the query by a related CcStampContents object + * + * @param CcStampContents $ccStampContents the related object to use as filter + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampQuery The current query, for fluid interface + */ + public function filterByCcStampContents($ccStampContents, $comparison = null) + { + return $this + ->addUsingAlias(CcStampPeer::ID, $ccStampContents->getDbStampId(), $comparison); + } + + /** + * Adds a JOIN clause to the query using the CcStampContents relation + * + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' + * + * @return CcStampQuery The current query, for fluid interface + */ + public function joinCcStampContents($relationAlias = '', $joinType = Criteria::INNER_JOIN) + { + $tableMap = $this->getTableMap(); + $relationMap = $tableMap->getRelation('CcStampContents'); + + // 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, 'CcStampContents'); + } + + return $this; + } + + /** + * Use the CcStampContents relation CcStampContents 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 CcStampContentsQuery A secondary query class using the current class as primary query + */ + public function useCcStampContentsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) + { + return $this + ->joinCcStampContents($relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'CcStampContents', 'CcStampContentsQuery'); + } + + /** + * Exclude object from result + * + * @param CcStamp $ccStamp Object to remove from the list of results + * + * @return CcStampQuery The current query, for fluid interface + */ + public function prune($ccStamp = null) + { + if ($ccStamp) { + $this->addUsingAlias(CcStampPeer::ID, $ccStamp->getDbId(), Criteria::NOT_EQUAL); + } + + return $this; + } + +} // BaseCcStampQuery From aca651a1b43f86039efe73838f647217845093f1 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 8 Apr 2013 18:53:35 -0400 Subject: [PATCH 072/128] better logging --- install_minimal/airtime-install | 3 +++ install_minimal/include/airtime-copy-files.sh | 1 - install_minimal/include/airtime-install.php | 2 +- python_apps/pypo/liquidsoap_scripts/ls_script.liq | 1 + python_apps/pypo/pypofetch.py | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 68005f54b..8728013e6 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -172,6 +172,8 @@ set -e echo -e "\n******************************** Install Begin *********************************" rm -rf "/usr/lib/airtime" +mkdir -p /usr/lib/airtime + if [ "$python_service" -eq "0" ]; then $AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh @@ -208,6 +210,7 @@ if [ "$mediamonitor" = "t" -o "$pypo" = "t" ]; then fi +#An attempt to force apache to realize that files are updated on upgrade... touch /usr/share/airtime/public/index.php if [ "$python_service" -eq "0" ]; then diff --git a/install_minimal/include/airtime-copy-files.sh b/install_minimal/include/airtime-copy-files.sh index 20b128a68..ced1786de 100755 --- a/install_minimal/include/airtime-copy-files.sh +++ b/install_minimal/include/airtime-copy-files.sh @@ -72,7 +72,6 @@ if [ "$python_service" -eq "0" ]; then fi fi -mkdir -p /usr/lib/airtime cp -R $AIRTIMEROOT/utils /usr/lib/airtime cp -R $AIRTIMEROOT/python_apps/std_err_override /usr/lib/airtime diff --git a/install_minimal/include/airtime-install.php b/install_minimal/include/airtime-install.php index bbd0c157a..ec7829269 100644 --- a/install_minimal/include/airtime-install.php +++ b/install_minimal/include/airtime-install.php @@ -13,7 +13,7 @@ require_once(__DIR__.'/airtime-constants.php'); // ------------------------------------------------------------------------- $iniExists = file_exists("/etc/airtime/airtime.conf"); -if ($iniExists){ +if ($iniExists) { //reinstall, Will ask if we should rewrite config files. require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); $CC_CONFIG = Config::getConfig(); diff --git a/python_apps/pypo/liquidsoap_scripts/ls_script.liq b/python_apps/pypo/liquidsoap_scripts/ls_script.liq index 1df261316..b7de38b3d 100644 --- a/python_apps/pypo/liquidsoap_scripts/ls_script.liq +++ b/python_apps/pypo/liquidsoap_scripts/ls_script.liq @@ -192,6 +192,7 @@ def check_dj_client(user,password) = ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}") #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... hd = list.hd(ret) + log("Live DJ authenticated: #{hd}") hd == "True" end diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 7c50b4e2d..06e5607df 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -142,7 +142,7 @@ class PypoFetch(Thread): tn.write('exit\n') tn.read_all() except Exception, e: - logger.error(str(e)) + logger.error(traceback.format_exc()) finally: lock.release() From 9b2fb3bece971bb6ada653a08c82f72ece5fcfb3 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 9 Apr 2013 15:55:18 -0400 Subject: [PATCH 073/128] CC-4961: Show linking --- .../application/models/airtime/CcShow.php | 5 + .../models/airtime/CcShowStamp.php | 18 - .../models/airtime/CcShowStampPeer.php | 18 - .../models/airtime/CcShowStampQuery.php | 18 - .../models/airtime/map/CcScheduleTableMap.php | 1 + .../airtime/map/CcStampContentsTableMap.php | 2 +- .../models/airtime/map/CcStampTableMap.php | 1 + .../models/airtime/om/BaseCcSchedule.php | 56 +- .../models/airtime/om/BaseCcSchedulePeer.php | 31 +- .../models/airtime/om/BaseCcScheduleQuery.php | 35 + .../models/airtime/om/BaseCcShowStamp.php | 1783 ---------- .../models/airtime/om/BaseCcShowStampPeer.php | 3095 ----------------- .../airtime/om/BaseCcShowStampQuery.php | 948 ----- .../models/airtime/om/BaseCcStamp.php | 50 +- .../models/airtime/om/BaseCcStampPeer.php | 31 +- .../models/airtime/om/BaseCcStampQuery.php | 21 + .../application/services/SchedulerService.php | 282 +- airtime_mvc/build/schema.xml | 4 +- airtime_mvc/build/sql/schema.sql | 4 +- 19 files changed, 485 insertions(+), 5918 deletions(-) delete mode 100644 airtime_mvc/application/models/airtime/CcShowStamp.php delete mode 100644 airtime_mvc/application/models/airtime/CcShowStampPeer.php delete mode 100644 airtime_mvc/application/models/airtime/CcShowStampQuery.php delete mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php delete mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php delete mode 100644 airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index 59db84c72..be055b374 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -128,4 +128,9 @@ class CcShow extends BaseCcShow { ->orderByDbStarts() ->find(); } + + public function isLinked() + { + return $this->getDbLinked(); + } } // CcShow diff --git a/airtime_mvc/application/models/airtime/CcShowStamp.php b/airtime_mvc/application/models/airtime/CcShowStamp.php deleted file mode 100644 index 19ced4a05..000000000 --- a/airtime_mvc/application/models/airtime/CcShowStamp.php +++ /dev/null @@ -1,18 +0,0 @@ -addColumn('PLAYOUT_STATUS', 'DbPlayoutStatus', 'SMALLINT', true, null, 1); $this->addColumn('BROADCASTED', 'DbBroadcasted', 'SMALLINT', true, null, 0); $this->addColumn('STAMP_ID', 'DbStampId', 'INTEGER', true, null, 0); + $this->addColumn('STAMP_CONTENT_ID', 'DbStampContentId', 'INTEGER', true, null, 0); // validators } // initialize() diff --git a/airtime_mvc/application/models/airtime/map/CcStampContentsTableMap.php b/airtime_mvc/application/models/airtime/map/CcStampContentsTableMap.php index b4d62edcf..26811c472 100644 --- a/airtime_mvc/application/models/airtime/map/CcStampContentsTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcStampContentsTableMap.php @@ -44,7 +44,7 @@ class CcStampContentsTableMap extends TableMap { $this->addForeignKey('STREAM_ID', 'DbStreamId', 'INTEGER', 'cc_webstream', 'ID', false, null, null); $this->addForeignKey('BLOCK_ID', 'DbBlockId', 'INTEGER', 'cc_block', 'ID', false, null, null); $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); - $this->addColumn('POSITION', 'DbPosition', 'INTEGER', true, null, null); + $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); $this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00'); $this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00'); $this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00'); diff --git a/airtime_mvc/application/models/airtime/map/CcStampTableMap.php b/airtime_mvc/application/models/airtime/map/CcStampTableMap.php index 6574cb410..a353134ea 100644 --- a/airtime_mvc/application/models/airtime/map/CcStampTableMap.php +++ b/airtime_mvc/application/models/airtime/map/CcStampTableMap.php @@ -41,6 +41,7 @@ class CcStampTableMap extends TableMap { $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); $this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null); $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); + $this->addColumn('LINKED', 'DbLinked', 'BOOLEAN', true, null, null); // validators } // initialize() diff --git a/airtime_mvc/application/models/airtime/om/BaseCcSchedule.php b/airtime_mvc/application/models/airtime/om/BaseCcSchedule.php index ddb931074..49a28d79b 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcSchedule.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcSchedule.php @@ -121,6 +121,13 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent */ protected $stamp_id; + /** + * The value for the stamp_content_id field. + * Note: this column has a database default value of: 0 + * @var int + */ + protected $stamp_content_id; + /** * @var CcShowInstances */ @@ -170,6 +177,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $this->playout_status = 1; $this->broadcasted = 0; $this->stamp_id = 0; + $this->stamp_content_id = 0; } /** @@ -424,6 +432,16 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent return $this->stamp_id; } + /** + * Get the [stamp_content_id] column value. + * + * @return int + */ + public function getDbStampContentId() + { + return $this->stamp_content_id; + } + /** * Set the value of [id] column. * @@ -854,6 +872,26 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent return $this; } // setDbStampId() + /** + * Set the value of [stamp_content_id] column. + * + * @param int $v new value + * @return CcSchedule The current object (for fluent API support) + */ + public function setDbStampContentId($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->stamp_content_id !== $v || $this->isNew()) { + $this->stamp_content_id = $v; + $this->modifiedColumns[] = CcSchedulePeer::STAMP_CONTENT_ID; + } + + return $this; + } // setDbStampContentId() + /** * Indicates whether the columns in this object are only set to default values. * @@ -892,6 +930,10 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent return false; } + if ($this->stamp_content_id !== 0) { + return false; + } + // otherwise, everything was equal, so return TRUE return true; } // hasOnlyDefaultValues() @@ -929,6 +971,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $this->playout_status = ($row[$startcol + 12] !== null) ? (int) $row[$startcol + 12] : null; $this->broadcasted = ($row[$startcol + 13] !== null) ? (int) $row[$startcol + 13] : null; $this->stamp_id = ($row[$startcol + 14] !== null) ? (int) $row[$startcol + 14] : null; + $this->stamp_content_id = ($row[$startcol + 15] !== null) ? (int) $row[$startcol + 15] : null; $this->resetModified(); $this->setNew(false); @@ -937,7 +980,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $this->ensureConsistency(); } - return $startcol + 15; // 15 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 16; // 16 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating CcSchedule object", $e); @@ -1361,6 +1404,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent case 14: return $this->getDbStampId(); break; + case 15: + return $this->getDbStampContentId(); + break; default: return null; break; @@ -1400,6 +1446,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $keys[12] => $this->getDbPlayoutStatus(), $keys[13] => $this->getDbBroadcasted(), $keys[14] => $this->getDbStampId(), + $keys[15] => $this->getDbStampContentId(), ); if ($includeForeignObjects) { if (null !== $this->aCcShowInstances) { @@ -1487,6 +1534,9 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent case 14: $this->setDbStampId($value); break; + case 15: + $this->setDbStampContentId($value); + break; } // switch() } @@ -1526,6 +1576,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent if (array_key_exists($keys[12], $arr)) $this->setDbPlayoutStatus($arr[$keys[12]]); if (array_key_exists($keys[13], $arr)) $this->setDbBroadcasted($arr[$keys[13]]); if (array_key_exists($keys[14], $arr)) $this->setDbStampId($arr[$keys[14]]); + if (array_key_exists($keys[15], $arr)) $this->setDbStampContentId($arr[$keys[15]]); } /** @@ -1552,6 +1603,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent if ($this->isColumnModified(CcSchedulePeer::PLAYOUT_STATUS)) $criteria->add(CcSchedulePeer::PLAYOUT_STATUS, $this->playout_status); if ($this->isColumnModified(CcSchedulePeer::BROADCASTED)) $criteria->add(CcSchedulePeer::BROADCASTED, $this->broadcasted); if ($this->isColumnModified(CcSchedulePeer::STAMP_ID)) $criteria->add(CcSchedulePeer::STAMP_ID, $this->stamp_id); + if ($this->isColumnModified(CcSchedulePeer::STAMP_CONTENT_ID)) $criteria->add(CcSchedulePeer::STAMP_CONTENT_ID, $this->stamp_content_id); return $criteria; } @@ -1627,6 +1679,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $copyObj->setDbPlayoutStatus($this->playout_status); $copyObj->setDbBroadcasted($this->broadcasted); $copyObj->setDbStampId($this->stamp_id); + $copyObj->setDbStampContentId($this->stamp_content_id); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of @@ -1960,6 +2013,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent $this->playout_status = null; $this->broadcasted = null; $this->stamp_id = null; + $this->stamp_content_id = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; $this->clearAllReferences(); diff --git a/airtime_mvc/application/models/airtime/om/BaseCcSchedulePeer.php b/airtime_mvc/application/models/airtime/om/BaseCcSchedulePeer.php index 8f4551a23..f14cc6910 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcSchedulePeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcSchedulePeer.php @@ -26,7 +26,7 @@ abstract class BaseCcSchedulePeer { const TM_CLASS = 'CcScheduleTableMap'; /** The total number of columns. */ - const NUM_COLUMNS = 15; + const NUM_COLUMNS = 16; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -76,6 +76,9 @@ abstract class BaseCcSchedulePeer { /** the column name for the STAMP_ID field */ const STAMP_ID = 'cc_schedule.STAMP_ID'; + /** the column name for the STAMP_CONTENT_ID field */ + const STAMP_CONTENT_ID = 'cc_schedule.STAMP_CONTENT_ID'; + /** * 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 @@ -92,12 +95,12 @@ abstract class BaseCcSchedulePeer { * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbStreamId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', 'DbStampId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbStreamId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', 'dbStampId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::STREAM_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, self::STAMP_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'STREAM_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', 'STAMP_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'stream_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', 'stamp_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ) + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbStarts', 'DbEnds', 'DbFileId', 'DbStreamId', 'DbClipLength', 'DbFadeIn', 'DbFadeOut', 'DbCueIn', 'DbCueOut', 'DbMediaItemPlayed', 'DbInstanceId', 'DbPlayoutStatus', 'DbBroadcasted', 'DbStampId', 'DbStampContentId', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbFileId', 'dbStreamId', 'dbClipLength', 'dbFadeIn', 'dbFadeOut', 'dbCueIn', 'dbCueOut', 'dbMediaItemPlayed', 'dbInstanceId', 'dbPlayoutStatus', 'dbBroadcasted', 'dbStampId', 'dbStampContentId', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::FILE_ID, self::STREAM_ID, self::CLIP_LENGTH, self::FADE_IN, self::FADE_OUT, self::CUE_IN, self::CUE_OUT, self::MEDIA_ITEM_PLAYED, self::INSTANCE_ID, self::PLAYOUT_STATUS, self::BROADCASTED, self::STAMP_ID, self::STAMP_CONTENT_ID, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'FILE_ID', 'STREAM_ID', 'CLIP_LENGTH', 'FADE_IN', 'FADE_OUT', 'CUE_IN', 'CUE_OUT', 'MEDIA_ITEM_PLAYED', 'INSTANCE_ID', 'PLAYOUT_STATUS', 'BROADCASTED', 'STAMP_ID', 'STAMP_CONTENT_ID', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'file_id', 'stream_id', 'clip_length', 'fade_in', 'fade_out', 'cue_in', 'cue_out', 'media_item_played', 'instance_id', 'playout_status', 'broadcasted', 'stamp_id', 'stamp_content_id', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ) ); /** @@ -107,12 +110,12 @@ abstract class BaseCcSchedulePeer { * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbClipLength' => 5, 'DbFadeIn' => 6, 'DbFadeOut' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbMediaItemPlayed' => 10, 'DbInstanceId' => 11, 'DbPlayoutStatus' => 12, 'DbBroadcasted' => 13, 'DbStampId' => 14, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbClipLength' => 5, 'dbFadeIn' => 6, 'dbFadeOut' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbMediaItemPlayed' => 10, 'dbInstanceId' => 11, 'dbPlayoutStatus' => 12, 'dbBroadcasted' => 13, 'dbStampId' => 14, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::CLIP_LENGTH => 5, self::FADE_IN => 6, self::FADE_OUT => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::MEDIA_ITEM_PLAYED => 10, self::INSTANCE_ID => 11, self::PLAYOUT_STATUS => 12, self::BROADCASTED => 13, self::STAMP_ID => 14, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'CLIP_LENGTH' => 5, 'FADE_IN' => 6, 'FADE_OUT' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'MEDIA_ITEM_PLAYED' => 10, 'INSTANCE_ID' => 11, 'PLAYOUT_STATUS' => 12, 'BROADCASTED' => 13, 'STAMP_ID' => 14, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'stream_id' => 4, 'clip_length' => 5, 'fade_in' => 6, 'fade_out' => 7, 'cue_in' => 8, 'cue_out' => 9, 'media_item_played' => 10, 'instance_id' => 11, 'playout_status' => 12, 'broadcasted' => 13, 'stamp_id' => 14, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ) + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbStarts' => 1, 'DbEnds' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbClipLength' => 5, 'DbFadeIn' => 6, 'DbFadeOut' => 7, 'DbCueIn' => 8, 'DbCueOut' => 9, 'DbMediaItemPlayed' => 10, 'DbInstanceId' => 11, 'DbPlayoutStatus' => 12, 'DbBroadcasted' => 13, 'DbStampId' => 14, 'DbStampContentId' => 15, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbClipLength' => 5, 'dbFadeIn' => 6, 'dbFadeOut' => 7, 'dbCueIn' => 8, 'dbCueOut' => 9, 'dbMediaItemPlayed' => 10, 'dbInstanceId' => 11, 'dbPlayoutStatus' => 12, 'dbBroadcasted' => 13, 'dbStampId' => 14, 'dbStampContentId' => 15, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::CLIP_LENGTH => 5, self::FADE_IN => 6, self::FADE_OUT => 7, self::CUE_IN => 8, self::CUE_OUT => 9, self::MEDIA_ITEM_PLAYED => 10, self::INSTANCE_ID => 11, self::PLAYOUT_STATUS => 12, self::BROADCASTED => 13, self::STAMP_ID => 14, self::STAMP_CONTENT_ID => 15, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'CLIP_LENGTH' => 5, 'FADE_IN' => 6, 'FADE_OUT' => 7, 'CUE_IN' => 8, 'CUE_OUT' => 9, 'MEDIA_ITEM_PLAYED' => 10, 'INSTANCE_ID' => 11, 'PLAYOUT_STATUS' => 12, 'BROADCASTED' => 13, 'STAMP_ID' => 14, 'STAMP_CONTENT_ID' => 15, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'file_id' => 3, 'stream_id' => 4, 'clip_length' => 5, 'fade_in' => 6, 'fade_out' => 7, 'cue_in' => 8, 'cue_out' => 9, 'media_item_played' => 10, 'instance_id' => 11, 'playout_status' => 12, 'broadcasted' => 13, 'stamp_id' => 14, 'stamp_content_id' => 15, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ) ); /** @@ -199,6 +202,7 @@ abstract class BaseCcSchedulePeer { $criteria->addSelectColumn(CcSchedulePeer::PLAYOUT_STATUS); $criteria->addSelectColumn(CcSchedulePeer::BROADCASTED); $criteria->addSelectColumn(CcSchedulePeer::STAMP_ID); + $criteria->addSelectColumn(CcSchedulePeer::STAMP_CONTENT_ID); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.STARTS'); @@ -215,6 +219,7 @@ abstract class BaseCcSchedulePeer { $criteria->addSelectColumn($alias . '.PLAYOUT_STATUS'); $criteria->addSelectColumn($alias . '.BROADCASTED'); $criteria->addSelectColumn($alias . '.STAMP_ID'); + $criteria->addSelectColumn($alias . '.STAMP_CONTENT_ID'); } } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcScheduleQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcScheduleQuery.php index 9076adc8b..f99c36476 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcScheduleQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcScheduleQuery.php @@ -21,6 +21,7 @@ * @method CcScheduleQuery orderByDbPlayoutStatus($order = Criteria::ASC) Order by the playout_status column * @method CcScheduleQuery orderByDbBroadcasted($order = Criteria::ASC) Order by the broadcasted column * @method CcScheduleQuery orderByDbStampId($order = Criteria::ASC) Order by the stamp_id column + * @method CcScheduleQuery orderByDbStampContentId($order = Criteria::ASC) Order by the stamp_content_id column * * @method CcScheduleQuery groupByDbId() Group by the id column * @method CcScheduleQuery groupByDbStarts() Group by the starts column @@ -37,6 +38,7 @@ * @method CcScheduleQuery groupByDbPlayoutStatus() Group by the playout_status column * @method CcScheduleQuery groupByDbBroadcasted() Group by the broadcasted column * @method CcScheduleQuery groupByDbStampId() Group by the stamp_id column + * @method CcScheduleQuery groupByDbStampContentId() Group by the stamp_content_id column * * @method CcScheduleQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcScheduleQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query @@ -76,6 +78,7 @@ * @method CcSchedule findOneByDbPlayoutStatus(int $playout_status) Return the first CcSchedule filtered by the playout_status column * @method CcSchedule findOneByDbBroadcasted(int $broadcasted) Return the first CcSchedule filtered by the broadcasted column * @method CcSchedule findOneByDbStampId(int $stamp_id) Return the first CcSchedule filtered by the stamp_id column + * @method CcSchedule findOneByDbStampContentId(int $stamp_content_id) Return the first CcSchedule filtered by the stamp_content_id column * * @method array findByDbId(int $id) Return CcSchedule objects filtered by the id column * @method array findByDbStarts(string $starts) Return CcSchedule objects filtered by the starts column @@ -92,6 +95,7 @@ * @method array findByDbPlayoutStatus(int $playout_status) Return CcSchedule objects filtered by the playout_status column * @method array findByDbBroadcasted(int $broadcasted) Return CcSchedule objects filtered by the broadcasted column * @method array findByDbStampId(int $stamp_id) Return CcSchedule objects filtered by the stamp_id column + * @method array findByDbStampContentId(int $stamp_content_id) Return CcSchedule objects filtered by the stamp_content_id column * * @package propel.generator.airtime.om */ @@ -611,6 +615,37 @@ abstract class BaseCcScheduleQuery extends ModelCriteria return $this->addUsingAlias(CcSchedulePeer::STAMP_ID, $dbStampId, $comparison); } + /** + * Filter the query on the stamp_content_id column + * + * @param int|array $dbStampContentId 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 filterByDbStampContentId($dbStampContentId = null, $comparison = null) + { + if (is_array($dbStampContentId)) { + $useMinMax = false; + if (isset($dbStampContentId['min'])) { + $this->addUsingAlias(CcSchedulePeer::STAMP_CONTENT_ID, $dbStampContentId['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($dbStampContentId['max'])) { + $this->addUsingAlias(CcSchedulePeer::STAMP_CONTENT_ID, $dbStampContentId['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + return $this->addUsingAlias(CcSchedulePeer::STAMP_CONTENT_ID, $dbStampContentId, $comparison); + } + /** * Filter the query by a related CcShowInstances object * diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php deleted file mode 100644 index c4e55cf59..000000000 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowStamp.php +++ /dev/null @@ -1,1783 +0,0 @@ -clip_length = '00:00:00'; - $this->cue_in = '00:00:00'; - $this->cue_out = '00:00:00'; - $this->fade_in = '00:00:00'; - $this->fade_out = '00:00:00'; - } - - /** - * Initializes internal state of BaseCcShowStamp object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [show_id] column value. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Get the [instance_id] column value. - * - * @return int - */ - public function getDbInstanceId() - { - return $this->instance_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbFileId() - { - return $this->file_id; - } - - /** - * Get the [stream_id] column value. - * - * @return int - */ - public function getDbStreamId() - { - return $this->stream_id; - } - - /** - * Get the [block_id] column value. - * - * @return int - */ - public function getDbBlockId() - { - return $this->block_id; - } - - /** - * Get the [playlist_id] column value. - * - * @return int - */ - public function getDbPlaylistId() - { - return $this->playlist_id; - } - - /** - * Get the [position] column value. - * - * @return int - */ - public function getDbPosition() - { - return $this->position; - } - - /** - * Get the [clip_length] column value. - * - * @return string - */ - public function getDbClipLength() - { - return $this->clip_length; - } - - /** - * Get the [cue_in] column value. - * - * @return string - */ - public function getDbCueIn() - { - return $this->cue_in; - } - - /** - * Get the [cue_out] column value. - * - * @return string - */ - public function getDbCueOut() - { - return $this->cue_out; - } - - /** - * Get the [fade_in] column value. - * - * @return string - */ - public function getDbFadeIn() - { - return $this->fade_in; - } - - /** - * Get the [fade_out] column value. - * - * @return string - */ - public function getDbFadeOut() - { - return $this->fade_out; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowStampPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowStampPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Set the value of [instance_id] column. - * - * @param int $v new value - * @return CcShowStamp 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[] = CcShowStampPeer::INSTANCE_ID; - } - - if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) { - $this->aCcShowInstances = null; - } - - return $this; - } // setDbInstanceId() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbFileId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcShowStampPeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbFileId() - - /** - * Set the value of [stream_id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbStreamId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->stream_id !== $v) { - $this->stream_id = $v; - $this->modifiedColumns[] = CcShowStampPeer::STREAM_ID; - } - - if ($this->aCcWebstream !== null && $this->aCcWebstream->getDbId() !== $v) { - $this->aCcWebstream = null; - } - - return $this; - } // setDbStreamId() - - /** - * Set the value of [block_id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbBlockId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->block_id !== $v) { - $this->block_id = $v; - $this->modifiedColumns[] = CcShowStampPeer::BLOCK_ID; - } - - if ($this->aCcBlock !== null && $this->aCcBlock->getDbId() !== $v) { - $this->aCcBlock = null; - } - - return $this; - } // setDbBlockId() - - /** - * Set the value of [playlist_id] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbPlaylistId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->playlist_id !== $v) { - $this->playlist_id = $v; - $this->modifiedColumns[] = CcShowStampPeer::PLAYLIST_ID; - } - - if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { - $this->aCcPlaylist = null; - } - - return $this; - } // setDbPlaylistId() - - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[] = CcShowStampPeer::POSITION; - } - - return $this; - } // setDbPosition() - - /** - * Set the value of [clip_length] column. - * - * @param string $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbClipLength($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->clip_length !== $v || $this->isNew()) { - $this->clip_length = $v; - $this->modifiedColumns[] = CcShowStampPeer::CLIP_LENGTH; - } - - return $this; - } // setDbClipLength() - - /** - * Set the value of [cue_in] column. - * - * @param string $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbCueIn($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->cue_in !== $v || $this->isNew()) { - $this->cue_in = $v; - $this->modifiedColumns[] = CcShowStampPeer::CUE_IN; - } - - return $this; - } // setDbCueIn() - - /** - * Set the value of [cue_out] column. - * - * @param string $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbCueOut($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->cue_out !== $v || $this->isNew()) { - $this->cue_out = $v; - $this->modifiedColumns[] = CcShowStampPeer::CUE_OUT; - } - - return $this; - } // setDbCueOut() - - /** - * Set the value of [fade_in] column. - * - * @param string $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbFadeIn($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->fade_in !== $v || $this->isNew()) { - $this->fade_in = $v; - $this->modifiedColumns[] = CcShowStampPeer::FADE_IN; - } - - return $this; - } // setDbFadeIn() - - /** - * Set the value of [fade_out] column. - * - * @param string $v new value - * @return CcShowStamp The current object (for fluent API support) - */ - public function setDbFadeOut($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->fade_out !== $v || $this->isNew()) { - $this->fade_out = $v; - $this->modifiedColumns[] = CcShowStampPeer::FADE_OUT; - } - - return $this; - } // setDbFadeOut() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->clip_length !== '00:00:00') { - return false; - } - - if ($this->cue_in !== '00:00:00') { - return false; - } - - if ($this->cue_out !== '00:00:00') { - return false; - } - - if ($this->fade_in !== '00:00:00') { - return false; - } - - if ($this->fade_out !== '00:00:00') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $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 + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->file_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->stream_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->block_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->playlist_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->position = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->clip_length = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->cue_in = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->cue_out = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->fade_in = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; - $this->fade_out = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 13; // 13 = CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowStamp object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { - $this->aCcShowInstances = null; - } - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - if ($this->aCcWebstream !== null && $this->stream_id !== $this->aCcWebstream->getDbId()) { - $this->aCcWebstream = null; - } - if ($this->aCcBlock !== null && $this->block_id !== $this->aCcBlock->getDbId()) { - $this->aCcBlock = null; - } - if ($this->aCcPlaylist !== null && $this->playlist_id !== $this->aCcPlaylist->getDbId()) { - $this->aCcPlaylist = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowStampPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - $this->aCcShowInstances = null; - $this->aCcFiles = null; - $this->aCcWebstream = null; - $this->aCcBlock = null; - $this->aCcPlaylist = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowStampQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowStampPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->aCcShowInstances !== null) { - if ($this->aCcShowInstances->isModified() || $this->aCcShowInstances->isNew()) { - $affectedRows += $this->aCcShowInstances->save($con); - } - $this->setCcShowInstances($this->aCcShowInstances); - } - - if ($this->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->aCcWebstream !== null) { - if ($this->aCcWebstream->isModified() || $this->aCcWebstream->isNew()) { - $affectedRows += $this->aCcWebstream->save($con); - } - $this->setCcWebstream($this->aCcWebstream); - } - - if ($this->aCcBlock !== null) { - if ($this->aCcBlock->isModified() || $this->aCcBlock->isNew()) { - $affectedRows += $this->aCcBlock->save($con); - } - $this->setCcBlock($this->aCcBlock); - } - - if ($this->aCcPlaylist !== null) { - if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { - $affectedRows += $this->aCcPlaylist->save($con); - } - $this->setCcPlaylist($this->aCcPlaylist); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowStampPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowStampPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowStampPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowStampPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - if ($this->aCcShowInstances !== null) { - if (!$this->aCcShowInstances->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShowInstances->getValidationFailures()); - } - } - - if ($this->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - if ($this->aCcWebstream !== null) { - if (!$this->aCcWebstream->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcWebstream->getValidationFailures()); - } - } - - if ($this->aCcBlock !== null) { - if (!$this->aCcBlock->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcBlock->getValidationFailures()); - } - } - - if ($this->aCcPlaylist !== null) { - if (!$this->aCcPlaylist->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); - } - } - - - if (($retval = CcShowStampPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbShowId(); - break; - case 2: - return $this->getDbInstanceId(); - break; - case 3: - return $this->getDbFileId(); - break; - case 4: - return $this->getDbStreamId(); - break; - case 5: - return $this->getDbBlockId(); - break; - case 6: - return $this->getDbPlaylistId(); - break; - case 7: - return $this->getDbPosition(); - break; - case 8: - return $this->getDbClipLength(); - break; - case 9: - return $this->getDbCueIn(); - break; - case 10: - return $this->getDbCueOut(); - break; - case 11: - return $this->getDbFadeIn(); - break; - case 12: - return $this->getDbFadeOut(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowStampPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbShowId(), - $keys[2] => $this->getDbInstanceId(), - $keys[3] => $this->getDbFileId(), - $keys[4] => $this->getDbStreamId(), - $keys[5] => $this->getDbBlockId(), - $keys[6] => $this->getDbPlaylistId(), - $keys[7] => $this->getDbPosition(), - $keys[8] => $this->getDbClipLength(), - $keys[9] => $this->getDbCueIn(), - $keys[10] => $this->getDbCueOut(), - $keys[11] => $this->getDbFadeIn(), - $keys[12] => $this->getDbFadeOut(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcShowInstances) { - $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcWebstream) { - $result['CcWebstream'] = $this->aCcWebstream->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcBlock) { - $result['CcBlock'] = $this->aCcBlock->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcPlaylist) { - $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowStampPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbShowId($value); - break; - case 2: - $this->setDbInstanceId($value); - break; - case 3: - $this->setDbFileId($value); - break; - case 4: - $this->setDbStreamId($value); - break; - case 5: - $this->setDbBlockId($value); - break; - case 6: - $this->setDbPlaylistId($value); - break; - case 7: - $this->setDbPosition($value); - break; - case 8: - $this->setDbClipLength($value); - break; - case 9: - $this->setDbCueIn($value); - break; - case 10: - $this->setDbCueOut($value); - break; - case 11: - $this->setDbFadeIn($value); - break; - case 12: - $this->setDbFadeOut($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowStampPeer::getFieldNames($keyType); - - 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[2], $arr)) $this->setDbInstanceId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbFileId($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbStreamId($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbBlockId($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbPlaylistId($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbPosition($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbClipLength($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbCueIn($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbCueOut($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDbFadeIn($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setDbFadeOut($arr[$keys[12]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowStampPeer::ID)) $criteria->add(CcShowStampPeer::ID, $this->id); - if ($this->isColumnModified(CcShowStampPeer::SHOW_ID)) $criteria->add(CcShowStampPeer::SHOW_ID, $this->show_id); - if ($this->isColumnModified(CcShowStampPeer::INSTANCE_ID)) $criteria->add(CcShowStampPeer::INSTANCE_ID, $this->instance_id); - if ($this->isColumnModified(CcShowStampPeer::FILE_ID)) $criteria->add(CcShowStampPeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcShowStampPeer::STREAM_ID)) $criteria->add(CcShowStampPeer::STREAM_ID, $this->stream_id); - if ($this->isColumnModified(CcShowStampPeer::BLOCK_ID)) $criteria->add(CcShowStampPeer::BLOCK_ID, $this->block_id); - if ($this->isColumnModified(CcShowStampPeer::PLAYLIST_ID)) $criteria->add(CcShowStampPeer::PLAYLIST_ID, $this->playlist_id); - if ($this->isColumnModified(CcShowStampPeer::POSITION)) $criteria->add(CcShowStampPeer::POSITION, $this->position); - if ($this->isColumnModified(CcShowStampPeer::CLIP_LENGTH)) $criteria->add(CcShowStampPeer::CLIP_LENGTH, $this->clip_length); - if ($this->isColumnModified(CcShowStampPeer::CUE_IN)) $criteria->add(CcShowStampPeer::CUE_IN, $this->cue_in); - if ($this->isColumnModified(CcShowStampPeer::CUE_OUT)) $criteria->add(CcShowStampPeer::CUE_OUT, $this->cue_out); - if ($this->isColumnModified(CcShowStampPeer::FADE_IN)) $criteria->add(CcShowStampPeer::FADE_IN, $this->fade_in); - if ($this->isColumnModified(CcShowStampPeer::FADE_OUT)) $criteria->add(CcShowStampPeer::FADE_OUT, $this->fade_out); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); - $criteria->add(CcShowStampPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowStamp (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbShowId($this->show_id); - $copyObj->setDbInstanceId($this->instance_id); - $copyObj->setDbFileId($this->file_id); - $copyObj->setDbStreamId($this->stream_id); - $copyObj->setDbBlockId($this->block_id); - $copyObj->setDbPlaylistId($this->playlist_id); - $copyObj->setDbPosition($this->position); - $copyObj->setDbClipLength($this->clip_length); - $copyObj->setDbCueIn($this->cue_in); - $copyObj->setDbCueOut($this->cue_out); - $copyObj->setDbFadeIn($this->fade_in); - $copyObj->setDbFadeOut($this->fade_out); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowStamp Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowStampPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowStampPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowStamp The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowStamp($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowStamps($this); - */ - } - return $this->aCcShow; - } - - /** - * Declares an association between this object and a CcShowInstances object. - * - * @param CcShowInstances $v - * @return CcShowStamp 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->addCcShowStamp($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->addCcShowStamps($this); - */ - } - return $this->aCcShowInstances; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcShowStamp The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbFileId(NULL); - } else { - $this->setDbFileId($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcShowStamp($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcShowStamps($this); - */ - } - return $this->aCcFiles; - } - - /** - * Declares an association between this object and a CcWebstream object. - * - * @param CcWebstream $v - * @return CcShowStamp The current object (for fluent API support) - * @throws PropelException - */ - public function setCcWebstream(CcWebstream $v = null) - { - if ($v === null) { - $this->setDbStreamId(NULL); - } else { - $this->setDbStreamId($v->getDbId()); - } - - $this->aCcWebstream = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcWebstream object, it will not be re-added. - if ($v !== null) { - $v->addCcShowStamp($this); - } - - return $this; - } - - - /** - * Get the associated CcWebstream object - * - * @param PropelPDO Optional Connection object. - * @return CcWebstream The associated CcWebstream object. - * @throws PropelException - */ - public function getCcWebstream(PropelPDO $con = null) - { - if ($this->aCcWebstream === null && ($this->stream_id !== null)) { - $this->aCcWebstream = CcWebstreamQuery::create()->findPk($this->stream_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->aCcWebstream->addCcShowStamps($this); - */ - } - return $this->aCcWebstream; - } - - /** - * Declares an association between this object and a CcBlock object. - * - * @param CcBlock $v - * @return CcShowStamp The current object (for fluent API support) - * @throws PropelException - */ - public function setCcBlock(CcBlock $v = null) - { - if ($v === null) { - $this->setDbBlockId(NULL); - } else { - $this->setDbBlockId($v->getDbId()); - } - - $this->aCcBlock = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcBlock object, it will not be re-added. - if ($v !== null) { - $v->addCcShowStamp($this); - } - - return $this; - } - - - /** - * Get the associated CcBlock object - * - * @param PropelPDO Optional Connection object. - * @return CcBlock The associated CcBlock object. - * @throws PropelException - */ - public function getCcBlock(PropelPDO $con = null) - { - if ($this->aCcBlock === null && ($this->block_id !== null)) { - $this->aCcBlock = CcBlockQuery::create()->findPk($this->block_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->aCcBlock->addCcShowStamps($this); - */ - } - return $this->aCcBlock; - } - - /** - * Declares an association between this object and a CcPlaylist object. - * - * @param CcPlaylist $v - * @return CcShowStamp The current object (for fluent API support) - * @throws PropelException - */ - public function setCcPlaylist(CcPlaylist $v = null) - { - if ($v === null) { - $this->setDbPlaylistId(NULL); - } else { - $this->setDbPlaylistId($v->getDbId()); - } - - $this->aCcPlaylist = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcPlaylist object, it will not be re-added. - if ($v !== null) { - $v->addCcShowStamp($this); - } - - return $this; - } - - - /** - * Get the associated CcPlaylist object - * - * @param PropelPDO Optional Connection object. - * @return CcPlaylist The associated CcPlaylist object. - * @throws PropelException - */ - public function getCcPlaylist(PropelPDO $con = null) - { - if ($this->aCcPlaylist === null && ($this->playlist_id !== null)) { - $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->playlist_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->aCcPlaylist->addCcShowStamps($this); - */ - } - return $this->aCcPlaylist; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->show_id = null; - $this->instance_id = null; - $this->file_id = null; - $this->stream_id = null; - $this->block_id = null; - $this->playlist_id = null; - $this->position = null; - $this->clip_length = null; - $this->cue_in = null; - $this->cue_out = null; - $this->fade_in = null; - $this->fade_out = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - $this->aCcShowInstances = null; - $this->aCcFiles = null; - $this->aCcWebstream = null; - $this->aCcBlock = null; - $this->aCcPlaylist = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowStamp diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php deleted file mode 100644 index fb96eb0a7..000000000 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowStampPeer.php +++ /dev/null @@ -1,3095 +0,0 @@ - array ('DbId', 'DbShowId', 'DbInstanceId', 'DbFileId', 'DbStreamId', 'DbBlockId', 'DbPlaylistId', 'DbPosition', 'DbClipLength', 'DbCueIn', 'DbCueOut', 'DbFadeIn', 'DbFadeOut', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbInstanceId', 'dbFileId', 'dbStreamId', 'dbBlockId', 'dbPlaylistId', 'dbPosition', 'dbClipLength', 'dbCueIn', 'dbCueOut', 'dbFadeIn', 'dbFadeOut', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::INSTANCE_ID, self::FILE_ID, self::STREAM_ID, self::BLOCK_ID, self::PLAYLIST_ID, self::POSITION, self::CLIP_LENGTH, self::CUE_IN, self::CUE_OUT, self::FADE_IN, self::FADE_OUT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'INSTANCE_ID', 'FILE_ID', 'STREAM_ID', 'BLOCK_ID', 'PLAYLIST_ID', 'POSITION', 'CLIP_LENGTH', 'CUE_IN', 'CUE_OUT', 'FADE_IN', 'FADE_OUT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'instance_id', 'file_id', 'stream_id', 'block_id', 'playlist_id', 'position', 'clip_length', 'cue_in', 'cue_out', 'fade_in', 'fade_out', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) - ); - - /** - * 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, 'DbShowId' => 1, 'DbInstanceId' => 2, 'DbFileId' => 3, 'DbStreamId' => 4, 'DbBlockId' => 5, 'DbPlaylistId' => 6, 'DbPosition' => 7, 'DbClipLength' => 8, 'DbCueIn' => 9, 'DbCueOut' => 10, 'DbFadeIn' => 11, 'DbFadeOut' => 12, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbInstanceId' => 2, 'dbFileId' => 3, 'dbStreamId' => 4, 'dbBlockId' => 5, 'dbPlaylistId' => 6, 'dbPosition' => 7, 'dbClipLength' => 8, 'dbCueIn' => 9, 'dbCueOut' => 10, 'dbFadeIn' => 11, 'dbFadeOut' => 12, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::INSTANCE_ID => 2, self::FILE_ID => 3, self::STREAM_ID => 4, self::BLOCK_ID => 5, self::PLAYLIST_ID => 6, self::POSITION => 7, self::CLIP_LENGTH => 8, self::CUE_IN => 9, self::CUE_OUT => 10, self::FADE_IN => 11, self::FADE_OUT => 12, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'INSTANCE_ID' => 2, 'FILE_ID' => 3, 'STREAM_ID' => 4, 'BLOCK_ID' => 5, 'PLAYLIST_ID' => 6, 'POSITION' => 7, 'CLIP_LENGTH' => 8, 'CUE_IN' => 9, 'CUE_OUT' => 10, 'FADE_IN' => 11, 'FADE_OUT' => 12, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'instance_id' => 2, 'file_id' => 3, 'stream_id' => 4, 'block_id' => 5, 'playlist_id' => 6, 'position' => 7, 'clip_length' => 8, 'cue_in' => 9, 'cue_out' => 10, 'fade_in' => 11, 'fade_out' => 12, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowStampPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowStampPeer::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(CcShowStampPeer::ID); - $criteria->addSelectColumn(CcShowStampPeer::SHOW_ID); - $criteria->addSelectColumn(CcShowStampPeer::INSTANCE_ID); - $criteria->addSelectColumn(CcShowStampPeer::FILE_ID); - $criteria->addSelectColumn(CcShowStampPeer::STREAM_ID); - $criteria->addSelectColumn(CcShowStampPeer::BLOCK_ID); - $criteria->addSelectColumn(CcShowStampPeer::PLAYLIST_ID); - $criteria->addSelectColumn(CcShowStampPeer::POSITION); - $criteria->addSelectColumn(CcShowStampPeer::CLIP_LENGTH); - $criteria->addSelectColumn(CcShowStampPeer::CUE_IN); - $criteria->addSelectColumn(CcShowStampPeer::CUE_OUT); - $criteria->addSelectColumn(CcShowStampPeer::FADE_IN); - $criteria->addSelectColumn(CcShowStampPeer::FADE_OUT); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.INSTANCE_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.STREAM_ID'); - $criteria->addSelectColumn($alias . '.BLOCK_ID'); - $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); - $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.CLIP_LENGTH'); - $criteria->addSelectColumn($alias . '.CUE_IN'); - $criteria->addSelectColumn($alias . '.CUE_OUT'); - $criteria->addSelectColumn($alias . '.FADE_IN'); - $criteria->addSelectColumn($alias . '.FADE_OUT'); - } - } - - /** - * 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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::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 CcShowStamp - * @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 = CcShowStampPeer::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 CcShowStampPeer::populateObjects(CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowStampPeer::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 CcShowStamp $value A CcShowStamp object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowStamp $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 CcShowStamp object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowStamp) { - $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 CcShowStamp 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 CcShowStamp 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_stamp - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowStampPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowStampPeer::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; - CcShowStampPeer::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 (CcShowStamp object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowStampPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowStampPeer::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 + CcShowStampPeer::NUM_COLUMNS; - } else { - $cls = CcShowStampPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowStampPeer::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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::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; - } - - - /** - * 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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinCcWebstream(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinCcBlock(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinCcPlaylist(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcShowStamp 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 CcShowStamp 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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 (CcShowStamp) to $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp 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 CcShowStamp 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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowInstancesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 (CcShowStamp) to $obj2 (CcShowInstances) - $obj2->addCcShowStamp($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with their CcFiles 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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcFiles(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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowStamp) to $obj2 (CcFiles) - $obj2->addCcShowStamp($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with their CcWebstream 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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcWebstream(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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcWebstreamPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcWebstreamPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcWebstreamPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowStamp) to $obj2 (CcWebstream) - $obj2->addCcShowStamp($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with their CcBlock 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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcBlock(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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcBlockPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcBlockPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcBlockPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowStamp) to $obj2 (CcBlock) - $obj2->addCcShowStamp($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with their CcPlaylist 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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcPlaylist(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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - CcPlaylistPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcPlaylistPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowStamp) to $obj2 (CcPlaylist) - $obj2->addCcShowStamp($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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcShowStamp 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 CcShowStamp 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); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol8 = $startcol7 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - } // if joined row not null - - // Add objects for joined CcShowInstances rows - - $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcShowInstancesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcShowInstancesPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) - $obj3->addCcShowStamp($obj1); - } // if joined row not null - - // Add objects for joined CcFiles rows - - $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcFilesPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcFilesPeer::addInstanceToPool($obj4, $key4); - } // if obj4 loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) - $obj4->addCcShowStamp($obj1); - } // if joined row not null - - // Add objects for joined CcWebstream rows - - $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcWebstreamPeer::addInstanceToPool($obj5, $key5); - } // if obj5 loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) - $obj5->addCcShowStamp($obj1); - } // if joined row not null - - // Add objects for joined CcBlock rows - - $key6 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcBlockPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcBlockPeer::addInstanceToPool($obj6, $key6); - } // if obj6 loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcBlock) - $obj6->addCcShowStamp($obj1); - } // if joined row not null - - // Add objects for joined CcPlaylist rows - - $key7 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol7); - if ($key7 !== null) { - $obj7 = CcPlaylistPeer::getInstanceFromPool($key7); - if (!$obj7) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj7 = new $cls(); - $obj7->hydrate($row, $startcol7); - CcPlaylistPeer::addInstanceToPool($obj7, $key7); - } // if obj7 loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj7 (CcPlaylist) - $obj7->addCcShowStamp($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShow(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * 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 doCountJoinAllExceptCcShowInstances(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcWebstream 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 doCountJoinAllExceptCcWebstream(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcBlock 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 doCountJoinAllExceptCcBlock(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinAllExceptCcPlaylist(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(CcShowStampPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowStampPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::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 CcShowStamp objects pre-filled with all related objects except CcShow. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShowInstances) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcFiles) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcWebstream rows - - $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcWebstreamPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcBlock rows - - $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcBlockPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcBlockPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcPlaylist rows - - $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcPlaylistPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) - $obj6->addCcShowStamp($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcShowInstances. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcFiles) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcWebstream rows - - $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcWebstreamPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcBlock rows - - $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcBlockPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcBlockPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcPlaylist rows - - $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcPlaylistPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) - $obj6->addCcShowStamp($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcFiles. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcShowInstances rows - - $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcShowInstancesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcShowInstancesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcWebstream rows - - $key4 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcWebstreamPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcWebstreamPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcWebstream) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcBlock rows - - $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcBlockPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcBlockPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcPlaylist rows - - $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcPlaylistPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) - $obj6->addCcShowStamp($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcWebstream. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcWebstream(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcShowInstances rows - - $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcShowInstancesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcShowInstancesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcFilesPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcFilesPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcBlock rows - - $key5 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcBlockPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcBlockPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcBlock) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcPlaylist rows - - $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcPlaylistPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) - $obj6->addCcShowStamp($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcBlock. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcBlock(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcShowInstances rows - - $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcShowInstancesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcShowInstancesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcFilesPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcFilesPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcWebstream rows - - $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcWebstreamPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcPlaylist rows - - $key6 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcPlaylistPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcPlaylistPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcPlaylist) - $obj6->addCcShowStamp($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowStamp objects pre-filled with all related objects except CcPlaylist. - * - * @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 CcShowStamp objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowStampPeer::addSelectColumns($criteria); - $startcol2 = (CcShowStampPeer::NUM_COLUMNS - CcShowStampPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol5 = $startcol4 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcWebstreamPeer::addSelectColumns($criteria); - $startcol6 = $startcol5 + (CcWebstreamPeer::NUM_COLUMNS - CcWebstreamPeer::NUM_LAZY_LOAD_COLUMNS); - - CcBlockPeer::addSelectColumns($criteria); - $startcol7 = $startcol6 + (CcBlockPeer::NUM_COLUMNS - CcBlockPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowStampPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::STREAM_ID, CcWebstreamPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowStampPeer::BLOCK_ID, CcBlockPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowStampPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowStampPeer::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 = CcShowStampPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowStampPeer::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 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj2 (CcShow) - $obj2->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcShowInstances rows - - $key3 = CcShowInstancesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcShowInstancesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcShowInstancesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcShowInstancesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj3 (CcShowInstances) - $obj3->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key4 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol4); - if ($key4 !== null) { - $obj4 = CcFilesPeer::getInstanceFromPool($key4); - if (!$obj4) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj4 = new $cls(); - $obj4->hydrate($row, $startcol4); - CcFilesPeer::addInstanceToPool($obj4, $key4); - } // if $obj4 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj4 (CcFiles) - $obj4->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcWebstream rows - - $key5 = CcWebstreamPeer::getPrimaryKeyHashFromRow($row, $startcol5); - if ($key5 !== null) { - $obj5 = CcWebstreamPeer::getInstanceFromPool($key5); - if (!$obj5) { - - $cls = CcWebstreamPeer::getOMClass(false); - - $obj5 = new $cls(); - $obj5->hydrate($row, $startcol5); - CcWebstreamPeer::addInstanceToPool($obj5, $key5); - } // if $obj5 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj5 (CcWebstream) - $obj5->addCcShowStamp($obj1); - - } // if joined row is not null - - // Add objects for joined CcBlock rows - - $key6 = CcBlockPeer::getPrimaryKeyHashFromRow($row, $startcol6); - if ($key6 !== null) { - $obj6 = CcBlockPeer::getInstanceFromPool($key6); - if (!$obj6) { - - $cls = CcBlockPeer::getOMClass(false); - - $obj6 = new $cls(); - $obj6->hydrate($row, $startcol6); - CcBlockPeer::addInstanceToPool($obj6, $key6); - } // if $obj6 already loaded - - // Add the $obj1 (CcShowStamp) to the collection in $obj6 (CcBlock) - $obj6->addCcShowStamp($obj1); - - } // if joined row is 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(BaseCcShowStampPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowStampPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowStampTableMap()); - } - } - - /** - * 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 ? CcShowStampPeer::CLASS_DEFAULT : CcShowStampPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowStamp or Criteria object. - * - * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowStamp object - } - - if ($criteria->containsKey(CcShowStampPeer::ID) && $criteria->keyContainsValue(CcShowStampPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowStampPeer::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 CcShowStamp or Criteria object. - * - * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowStampPeer::ID); - $value = $criteria->remove(CcShowStampPeer::ID); - if ($value) { - $selectCriteria->add(CcShowStampPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowStampPeer::TABLE_NAME); - } - - } else { // $values is CcShowStamp 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_stamp 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(CcShowStampPeer::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(CcShowStampPeer::TABLE_NAME, $con, CcShowStampPeer::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). - CcShowStampPeer::clearInstancePool(); - CcShowStampPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowStamp or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowStamp 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(CcShowStampPeer::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. - CcShowStampPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowStamp) { // it's a model object - // invalidate the cache for this single object - CcShowStampPeer::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(CcShowStampPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowStampPeer::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); - CcShowStampPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowStamp 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 CcShowStamp $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(CcShowStamp $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowStampPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, CcShowStampPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowStamp - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowStampPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); - $criteria->add(CcShowStampPeer::ID, $pk); - - $v = CcShowStampPeer::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(CcShowStampPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowStampPeer::DATABASE_NAME); - $criteria->add(CcShowStampPeer::ID, $pks, Criteria::IN); - $objs = CcShowStampPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowStampPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowStampPeer::buildTableMap(); - diff --git a/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php deleted file mode 100644 index dacdcbffa..000000000 --- a/airtime_mvc/application/models/airtime/om/BaseCcShowStampQuery.php +++ /dev/null @@ -1,948 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowStamp|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowStampPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery 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(CcShowStampPeer::ID, $dbId, $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 CcShowStampQuery 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(CcShowStampPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShowId['max'])) { - $this->addUsingAlias(CcShowStampPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::SHOW_ID, $dbShowId, $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 CcShowStampQuery 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(CcShowStampPeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbInstanceId['max'])) { - $this->addUsingAlias(CcShowStampPeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::INSTANCE_ID, $dbInstanceId, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbFileId 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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbFileId($dbFileId = null, $comparison = null) - { - if (is_array($dbFileId)) { - $useMinMax = false; - if (isset($dbFileId['min'])) { - $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFileId['max'])) { - $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::FILE_ID, $dbFileId, $comparison); - } - - /** - * Filter the query on the stream_id column - * - * @param int|array $dbStreamId 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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbStreamId($dbStreamId = null, $comparison = null) - { - if (is_array($dbStreamId)) { - $useMinMax = false; - if (isset($dbStreamId['min'])) { - $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStreamId['max'])) { - $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::STREAM_ID, $dbStreamId, $comparison); - } - - /** - * Filter the query on the block_id column - * - * @param int|array $dbBlockId 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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbBlockId($dbBlockId = null, $comparison = null) - { - if (is_array($dbBlockId)) { - $useMinMax = false; - if (isset($dbBlockId['min'])) { - $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbBlockId['max'])) { - $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::BLOCK_ID, $dbBlockId, $comparison); - } - - /** - * Filter the query on the playlist_id column - * - * @param int|array $dbPlaylistId 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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) - { - if (is_array($dbPlaylistId)) { - $useMinMax = false; - if (isset($dbPlaylistId['min'])) { - $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPlaylistId['max'])) { - $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $dbPlaylistId, $comparison); - } - - /** - * Filter the query on the position column - * - * @param int|array $dbPosition The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbPosition($dbPosition = null, $comparison = null) - { - if (is_array($dbPosition)) { - $useMinMax = false; - if (isset($dbPosition['min'])) { - $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPosition['max'])) { - $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowStampPeer::POSITION, $dbPosition, $comparison); - } - - /** - * Filter the query on the clip_length column - * - * @param string $dbClipLength The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbClipLength($dbClipLength = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbClipLength)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbClipLength)) { - $dbClipLength = str_replace('*', '%', $dbClipLength); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowStampPeer::CLIP_LENGTH, $dbClipLength, $comparison); - } - - /** - * Filter the query on the cue_in column - * - * @param string $dbCueIn The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbCueIn($dbCueIn = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCueIn)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCueIn)) { - $dbCueIn = str_replace('*', '%', $dbCueIn); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowStampPeer::CUE_IN, $dbCueIn, $comparison); - } - - /** - * Filter the query on the cue_out column - * - * @param string $dbCueOut The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbCueOut($dbCueOut = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCueOut)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCueOut)) { - $dbCueOut = str_replace('*', '%', $dbCueOut); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowStampPeer::CUE_OUT, $dbCueOut, $comparison); - } - - /** - * Filter the query on the fade_in column - * - * @param string $dbFadeIn The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbFadeIn($dbFadeIn = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFadeIn)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFadeIn)) { - $dbFadeIn = str_replace('*', '%', $dbFadeIn); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowStampPeer::FADE_IN, $dbFadeIn, $comparison); - } - - /** - * Filter the query on the fade_out column - * - * @param string $dbFadeOut The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByDbFadeOut($dbFadeOut = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFadeOut)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFadeOut)) { - $dbFadeOut = str_replace('*', '%', $dbFadeOut); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowStampPeer::FADE_OUT, $dbFadeOut, $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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery 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 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 CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcShowInstances($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::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 CcShowStampQuery The current query, for fluid interface - */ - public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) - { - return $this - ->joinCcShowInstances($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Filter the query by a related CcWebstream object - * - * @param CcWebstream $ccWebstream the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcWebstream($ccWebstream, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::STREAM_ID, $ccWebstream->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcWebstream relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function joinCcWebstream($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcWebstream'); - - // 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, 'CcWebstream'); - } - - return $this; - } - - /** - * Use the CcWebstream relation CcWebstream 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 CcWebstreamQuery A secondary query class using the current class as primary query - */ - public function useCcWebstreamQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcWebstream($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcWebstream', 'CcWebstreamQuery'); - } - - /** - * Filter the query by a related CcBlock object - * - * @param CcBlock $ccBlock the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcBlock($ccBlock, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::BLOCK_ID, $ccBlock->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcBlock relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function joinCcBlock($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcBlock'); - - // 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, 'CcBlock'); - } - - return $this; - } - - /** - * Use the CcBlock relation CcBlock 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 CcBlockQuery A secondary query class using the current class as primary query - */ - public function useCcBlockQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcBlock($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcBlock', 'CcBlockQuery'); - } - - /** - * Filter the query by a related CcPlaylist object - * - * @param CcPlaylist $ccPlaylist the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) - { - return $this - ->addUsingAlias(CcShowStampPeer::PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylist relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); - - // 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, 'CcPlaylist'); - } - - return $this; - } - - /** - * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); - } - - /** - * Exclude object from result - * - * @param CcShowStamp $ccShowStamp Object to remove from the list of results - * - * @return CcShowStampQuery The current query, for fluid interface - */ - public function prune($ccShowStamp = null) - { - if ($ccShowStamp) { - $this->addUsingAlias(CcShowStampPeer::ID, $ccShowStamp->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowStampQuery diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStamp.php b/airtime_mvc/application/models/airtime/om/BaseCcStamp.php index dcb488d02..629e28b3a 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcStamp.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcStamp.php @@ -42,6 +42,12 @@ abstract class BaseCcStamp extends BaseObject implements Persistent */ protected $instance_id; + /** + * The value for the linked field. + * @var boolean + */ + protected $linked; + /** * @var CcShow */ @@ -101,6 +107,16 @@ abstract class BaseCcStamp extends BaseObject implements Persistent return $this->instance_id; } + /** + * Get the [linked] column value. + * + * @return boolean + */ + public function getDbLinked() + { + return $this->linked; + } + /** * Set the value of [id] column. * @@ -169,6 +185,26 @@ abstract class BaseCcStamp extends BaseObject implements Persistent return $this; } // setDbInstanceId() + /** + * Set the value of [linked] column. + * + * @param boolean $v new value + * @return CcStamp The current object (for fluent API support) + */ + public function setDbLinked($v) + { + if ($v !== null) { + $v = (boolean) $v; + } + + if ($this->linked !== $v) { + $this->linked = $v; + $this->modifiedColumns[] = CcStampPeer::LINKED; + } + + return $this; + } // setDbLinked() + /** * Indicates whether the columns in this object are only set to default values. * @@ -204,6 +240,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent $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 + 2] !== null) ? (int) $row[$startcol + 2] : null; + $this->linked = ($row[$startcol + 3] !== null) ? (boolean) $row[$startcol + 3] : null; $this->resetModified(); $this->setNew(false); @@ -212,7 +249,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent $this->ensureConsistency(); } - return $startcol + 3; // 3 = CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 4; // 4 = CcStampPeer::NUM_COLUMNS - CcStampPeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating CcStamp object", $e); @@ -583,6 +620,9 @@ abstract class BaseCcStamp extends BaseObject implements Persistent case 2: return $this->getDbInstanceId(); break; + case 3: + return $this->getDbLinked(); + break; default: return null; break; @@ -610,6 +650,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent $keys[0] => $this->getDbId(), $keys[1] => $this->getDbShowId(), $keys[2] => $this->getDbInstanceId(), + $keys[3] => $this->getDbLinked(), ); if ($includeForeignObjects) { if (null !== $this->aCcShow) { @@ -658,6 +699,9 @@ abstract class BaseCcStamp extends BaseObject implements Persistent case 2: $this->setDbInstanceId($value); break; + case 3: + $this->setDbLinked($value); + break; } // switch() } @@ -685,6 +729,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent 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[2], $arr)) $this->setDbInstanceId($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setDbLinked($arr[$keys[3]]); } /** @@ -699,6 +744,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent if ($this->isColumnModified(CcStampPeer::ID)) $criteria->add(CcStampPeer::ID, $this->id); if ($this->isColumnModified(CcStampPeer::SHOW_ID)) $criteria->add(CcStampPeer::SHOW_ID, $this->show_id); if ($this->isColumnModified(CcStampPeer::INSTANCE_ID)) $criteria->add(CcStampPeer::INSTANCE_ID, $this->instance_id); + if ($this->isColumnModified(CcStampPeer::LINKED)) $criteria->add(CcStampPeer::LINKED, $this->linked); return $criteria; } @@ -762,6 +808,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent { $copyObj->setDbShowId($this->show_id); $copyObj->setDbInstanceId($this->instance_id); + $copyObj->setDbLinked($this->linked); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of @@ -1134,6 +1181,7 @@ abstract class BaseCcStamp extends BaseObject implements Persistent $this->id = null; $this->show_id = null; $this->instance_id = null; + $this->linked = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; $this->clearAllReferences(); diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php b/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php index d6db733c7..920862c89 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampPeer.php @@ -26,7 +26,7 @@ abstract class BaseCcStampPeer { const TM_CLASS = 'CcStampTableMap'; /** The total number of columns. */ - const NUM_COLUMNS = 3; + const NUM_COLUMNS = 4; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -40,6 +40,9 @@ abstract class BaseCcStampPeer { /** the column name for the INSTANCE_ID field */ const INSTANCE_ID = 'cc_stamp.INSTANCE_ID'; + /** the column name for the LINKED field */ + const LINKED = 'cc_stamp.LINKED'; + /** * An identiy map to hold any loaded instances of CcStamp objects. * This must be public so that other peer classes can access this when hydrating from JOIN @@ -56,12 +59,12 @@ abstract class BaseCcStampPeer { * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('DbId', 'DbShowId', 'DbInstanceId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbInstanceId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::INSTANCE_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'INSTANCE_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'instance_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) + BasePeer::TYPE_PHPNAME => array ('DbId', 'DbShowId', 'DbInstanceId', 'DbLinked', ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShowId', 'dbInstanceId', 'dbLinked', ), + BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::INSTANCE_ID, self::LINKED, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'INSTANCE_ID', 'LINKED', ), + BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'instance_id', 'linked', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, ) ); /** @@ -71,12 +74,12 @@ abstract class BaseCcStampPeer { * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbShowId' => 1, 'DbInstanceId' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbInstanceId' => 2, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::INSTANCE_ID => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'INSTANCE_ID' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'instance_id' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) + BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbShowId' => 1, 'DbInstanceId' => 2, 'DbLinked' => 3, ), + BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShowId' => 1, 'dbInstanceId' => 2, 'dbLinked' => 3, ), + BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::INSTANCE_ID => 2, self::LINKED => 3, ), + BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'INSTANCE_ID' => 2, 'LINKED' => 3, ), + BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'instance_id' => 2, 'linked' => 3, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, ) ); /** @@ -151,10 +154,12 @@ abstract class BaseCcStampPeer { $criteria->addSelectColumn(CcStampPeer::ID); $criteria->addSelectColumn(CcStampPeer::SHOW_ID); $criteria->addSelectColumn(CcStampPeer::INSTANCE_ID); + $criteria->addSelectColumn(CcStampPeer::LINKED); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.SHOW_ID'); $criteria->addSelectColumn($alias . '.INSTANCE_ID'); + $criteria->addSelectColumn($alias . '.LINKED'); } } diff --git a/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php b/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php index ef2053a5a..e055e8078 100644 --- a/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php +++ b/airtime_mvc/application/models/airtime/om/BaseCcStampQuery.php @@ -9,10 +9,12 @@ * @method CcStampQuery orderByDbId($order = Criteria::ASC) Order by the id column * @method CcStampQuery orderByDbShowId($order = Criteria::ASC) Order by the show_id column * @method CcStampQuery orderByDbInstanceId($order = Criteria::ASC) Order by the instance_id column + * @method CcStampQuery orderByDbLinked($order = Criteria::ASC) Order by the linked column * * @method CcStampQuery groupByDbId() Group by the id column * @method CcStampQuery groupByDbShowId() Group by the show_id column * @method CcStampQuery groupByDbInstanceId() Group by the instance_id column + * @method CcStampQuery groupByDbLinked() Group by the linked column * * @method CcStampQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcStampQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query @@ -36,10 +38,12 @@ * @method CcStamp findOneByDbId(int $id) Return the first CcStamp filtered by the id column * @method CcStamp findOneByDbShowId(int $show_id) Return the first CcStamp filtered by the show_id column * @method CcStamp findOneByDbInstanceId(int $instance_id) Return the first CcStamp filtered by the instance_id column + * @method CcStamp findOneByDbLinked(boolean $linked) Return the first CcStamp filtered by the linked column * * @method array findByDbId(int $id) Return CcStamp objects filtered by the id column * @method array findByDbShowId(int $show_id) Return CcStamp objects filtered by the show_id column * @method array findByDbInstanceId(int $instance_id) Return CcStamp objects filtered by the instance_id column + * @method array findByDbLinked(boolean $linked) Return CcStamp objects filtered by the linked column * * @package propel.generator.airtime.om */ @@ -228,6 +232,23 @@ abstract class BaseCcStampQuery extends ModelCriteria return $this->addUsingAlias(CcStampPeer::INSTANCE_ID, $dbInstanceId, $comparison); } + /** + * Filter the query on the linked column + * + * @param boolean|string $dbLinked The value to use as filter. + * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return CcStampQuery The current query, for fluid interface + */ + public function filterByDbLinked($dbLinked = null, $comparison = null) + { + if (is_string($dbLinked)) { + $linked = in_array(strtolower($dbLinked), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; + } + return $this->addUsingAlias(CcStampPeer::LINKED, $dbLinked, $comparison); + } + /** * Filter the query by a related CcShow object * diff --git a/airtime_mvc/application/services/SchedulerService.php b/airtime_mvc/application/services/SchedulerService.php index 635569f55..a5d152680 100644 --- a/airtime_mvc/application/services/SchedulerService.php +++ b/airtime_mvc/application/services/SchedulerService.php @@ -15,7 +15,7 @@ class Application_Service_SchedulerService private $epochNow; private $nowDT; - private $user; + private $currentUser; private $checkUserPermissions = true; public function __construct() @@ -36,7 +36,7 @@ class Application_Service_SchedulerService } $user_service = new Application_Service_UserService(); - $this->user = $user_service->getCurrentUser(); + $this->currentUser = $user_service->getCurrentUser(); } /** @@ -63,12 +63,16 @@ class Application_Service_SchedulerService $diff = $showStartsEpoch - $scheduleStartsEpoch; } + } - $sql = "UPDATE cc_schedule " - ."SET starts = starts + INTERVAL '$diff sec', " - ."ends = ends + INTERVAL '$diff sec' " - ."WHERE instance_id IN ($showIdList)"; - $con->exec($sql); + $ccSchedules = CcScheduleQuery::create() + ->filterByDbInstanceId($instanceIds, Criteria::IN) + ->find(); + foreach ($ccSchedules as $ccSchedule) { + $ccSchedule + ->setDbStarts($ccSchedule->getDbStarts() + $diff) + ->setDbEnds($ccSchedule->getDbEnds() + $diff) + ->save(); } } } @@ -131,4 +135,268 @@ class Application_Service_SchedulerService return $dt; } + + /** + * + * Enter description here ... + * @param array $scheduleItems (schedule_id and instance_id it belongs to) + * @param array $mediaItems (file|block|playlist|webstream) + * @param $adjustSched + */ + public function scheduleAdd($scheduleItems, $mediaItems, $adjustSched=true) + { + $this->con->beginTransaction(); + + $filesToInsert = array(); + + try { + $this->validateRequest($scheduleItems); + + /* + * create array of arrays + * array of schedule item info + * (sched_id is the cc_schedule id and is set if an item is being + * moved because it is already in cc_schedule) + * [0] = Array( + * id => 1, + * cliplength => 00:04:32, + * cuein => 00:00:00, + * cueout => 00:04:32, + * fadein => 00.5, + * fadeout => 00.5, + * sched_id => , + * type => 0) + * [1] = Array( + * id => 2, + * cliplength => 00:05:07, + * cuein => 00:00:00, + * cueout => 00:05:07, + * fadein => 00.5, + * fadeout => 00.5, + * sched_id => , + * type => 0) + */ + foreach ($mediaItems as $media) { + $filesToInsert = array_merge($filesToInsert, $this->retrieveMediaFiles($media["id"], $media["type"])); + } + + //$this->insertAfter($scheduleItems, $filesToInsert, $adjustSched); + $ccStamp = $this->prepareStamp($scheduleItems, $mediaItems, $adjustSched); + + $this->insertStamp($ccStamp); + + //keep track of which shows had their schedule change + //dont forget about the linked shows + + $this->con->commit(); + + Application_Model_RabbitMq::PushSchedule(); + } catch (Exception $e) { + $this->con->rollback(); + throw $e; + } + } + + private function setCcStamp($ccStamp, $instanceId) + { + $ccShowInstance = CcShowInstancesQuery::create()->findPk($instanceId); + $ccShow = $ccShowInstance->getCcShow(); + if ($ccShow->isLinked()) { + $ccStamp + ->setDbLinked(true) + ->setDbShowId($ccShow->getDbId()) + ->save(); + } else { + $ccStamp + ->setDbLinked(false) + ->setDbInstanceId($ccShowInstance->getDbId()) + ->save(); + } + } + + /** + * + * Enter description here ... + * @param $scheduleItems + * cc_schedule items, where the items get inserted after + * @param $filesToInsert + * array of schedule item info, what gets inserted into cc_schedule + * @param $adjustSched + */ + private function prepareStamp($scheduleItems, $itemsToInsert, $adjustSched = true) + { + try { + + foreach ($scheduleItems as $schedule) { + $id = intval($schedule["id"]); + + if ($id == 0) { + //if we get here, we know the show is empty and therefore + //need to create a new stamp + $pos = 0; + $ccStamp = new CcStamp(); + $this->setCcStamp($ccStamp, $schedule["instance"]); + } else { + $ccStamp = $this->getStamp($id); + //get the cc_stamp_contents item of the scheduleItem($schedule) + //this is where we are inserting after so we have to start the + //position counter after it + $ccStampContent = $this->getCurrentStampItem($id); + $pos = $ccStampContent->getDbPosition() + 1; + + //clear the positions of stamp items after the current + //item so we know we have to reassign their positions + //after inserting the new items + CcStampContentsQuery::create() + ->filterByDbStampId($ccStamp->getDbId()) + ->filterByDbPosition($pos, Criteria::GREATER_EQUAL) + ->setDbPosition(null) + ->save(); + } + + $stampId = $ccStamp->getDbId(); + foreach ($itemsToInsert as $item) { + $ccStampContent = new CcStampContents(); + $ccStampContent + ->setDbStampId($stampId) + ->setDbPosition($pos) + ->save(); + switch ($item["type"]) { + case "playlist": + $ccStampContent->setDbPlaylistId($item["id"])->save(); + break; + case "audioclip": + $ccStampContent->setDbFileId($item["id"])->save(); + + //update is_scheduled flag in cc_files + $ccFile = CcFilesQuery::create()->findPk($item['id']); + $ccFile->setDbIsScheduled(true)->save(); + break; + case "block": + $ccStampContent->setDbBlockId($item["id"])->save(); + break; + case "stream": + $ccStampContent->setDbStreamId($item["id"])->save(); + break; + } + $pos++; + } + + //reassign positions + $ccStampContents = CcStampContentsQuery::create() + ->filterByDbStampId($stampId) + ->filterByDbPosition(null) + ->find(); + foreach ($ccStampContents as $ccStampContent) { + $ccStampContent->setDbPosition($pos)->save(); + $pos++; + } + + return $ccStamp; + } + } catch (Exception $e) { + Logging::debug($e->getMessage()); + throw $e; + } + } + + private function insertStamp($ccStamp) + { + //delete cc_schedule entries + //CcScheduleQuery::create()->filterByDbStampId($ccStamp->getDbId())->delete(); + } + + private function getStamp($scheduleId) + { + $ccSchedule = CcScheduleQuery::create()->findPk($scheduleId); + return CcStamp::create()->findPk($ccSchedule->getDbStampId()); + } + + private function getCurrentStampItem($scheduleId) + { + $ccSchedule = CcScheduleQuery::create()->findPk($scheduleId); + return CcStampContents::create()->findPk($ccSchedule->getDbStampContentsId()); + } + + /** + * + * Enter description here ... + * @param array $items (schedule_id and instance_id it belongs to) + */ + private function validateRequest($items) + { + $nowEpoch = floatval($this->nowDT->format("U.u")); + + for ($i = 0; $i < count($items); $i++) { + $id = $items[$i]["id"]; + + //could be added to the beginning of a show, which sends id = 0; + if ($id > 0) { + //schedule_id of where we are inserting after? + $schedInfo[$id] = $items[$i]["instance"]; + } + + //what is timestamp for? + //format is instance_id => timestamp + $instanceInfo[$items[$i]["instance"]] = $items[$i]["timestamp"]; + } + + if (count($instanceInfo) === 0) { + throw new Exception("Invalid Request."); + } + + $schedIds = array(); + if (isset($schedInfo)) { + $schedIds = array_keys($schedInfo); + } + $schedItems = CcScheduleQuery::create()->findPKs($schedIds, $this->con); + $instanceIds = array_keys($instanceInfo); + $showInstances = CcShowInstancesQuery::create()->findPKs($instanceIds, $this->con); + + //an item has been deleted + if (count($schedIds) !== count($schedItems)) { + throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (sched mismatch)")); + } + + //a show has been deleted + if (count($instanceIds) !== count($showInstances)) { + throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (instance mismatch)")); + } + + foreach ($schedItems as $schedItem) { + $id = $schedItem->getDbId(); + $instance = $schedItem->getCcShowInstances($this->con); + + if (intval($schedInfo[$id]) !== $instance->getDbId()) { + throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!")); + } + } + + foreach ($showInstances as $instance) { + + $id = $instance->getDbId(); + $show = $instance->getCcShow($this->con); + + if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) { + throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName())); + } + + if ($instance->getDbRecord()) { + throw new Exception(_("You cannot add files to recording shows.")); + } + + $showEndEpoch = floatval($instance->getDbEnds("U.u")); + + if ($showEndEpoch < $nowEpoch) { + throw new OutDatedScheduleException(sprintf(_("The show %s is over and cannot be scheduled."), $show->getDbName())); + } + + $ts = intval($instanceInfo[$id]); + $lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0; + if ($ts < $lastSchedTs) { + Logging::info("ts {$ts} last sched {$lastSchedTs}"); + throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName())); + } + } + } } \ No newline at end of file diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index bbcd7f0fe..94ae2b5a1 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -328,6 +328,7 @@ broadcasted = 1) --> + - - + @@ -478,45 +474,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index a6dda42e3..8ae6d5cd5 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -427,8 +427,7 @@ CREATE TABLE "cc_schedule" "instance_id" INTEGER NOT NULL, "playout_status" INT2 default 1 NOT NULL, "broadcasted" INT2 default 0 NOT NULL, - "stamp_id" INTEGER default 0 NOT NULL, - "stamp_content_id" INTEGER default 0 NOT NULL, + "position" INTEGER default 0 NOT NULL, PRIMARY KEY ("id") ); @@ -750,54 +749,6 @@ CREATE TABLE "cc_locale" COMMENT ON TABLE "cc_locale" IS ''; -SET search_path TO public; ------------------------------------------------------------------------------ --- cc_stamp_contents ------------------------------------------------------------------------------ - -DROP TABLE "cc_stamp_contents" CASCADE; - - -CREATE TABLE "cc_stamp_contents" -( - "id" serial NOT NULL, - "stamp_id" INTEGER NOT NULL, - "file_id" INTEGER, - "stream_id" INTEGER, - "block_id" INTEGER, - "playlist_id" INTEGER, - "position" INTEGER, - "clip_length" interval default '00:00:00', - "cue_in" interval default '00:00:00', - "cue_out" interval default '00:00:00', - "fade_in" interval default '00:00:00', - "fade_out" interval default '00:00:00', - PRIMARY KEY ("id") -); - -COMMENT ON TABLE "cc_stamp_contents" IS ''; - - -SET search_path TO public; ------------------------------------------------------------------------------ --- cc_stamp ------------------------------------------------------------------------------ - -DROP TABLE "cc_stamp" CASCADE; - - -CREATE TABLE "cc_stamp" -( - "id" serial NOT NULL, - "show_id" INTEGER NOT NULL, - "instance_id" INTEGER, - "linked" BOOLEAN NOT NULL, - PRIMARY KEY ("id") -); - -COMMENT ON TABLE "cc_stamp" IS ''; - - SET search_path TO public; ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_owner_fkey" FOREIGN KEY ("owner_id") REFERENCES "cc_subjs" ("id"); @@ -854,17 +805,3 @@ ALTER TABLE "cc_webstream_metadata" ADD CONSTRAINT "cc_schedule_inst_fkey" FOREI ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_timestamp_inst_fkey" FOREIGN KEY ("timestamp_id") REFERENCES "cc_timestamp" ("id") ON DELETE CASCADE; ALTER TABLE "cc_listener_count" ADD CONSTRAINT "cc_mount_name_inst_fkey" FOREIGN KEY ("mount_name_id") REFERENCES "cc_mount_name" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_stamp_id_fkey" FOREIGN KEY ("stamp_id") REFERENCES "cc_stamp" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_file_id_fkey" FOREIGN KEY ("file_id") REFERENCES "cc_files" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_stream_id_fkey" FOREIGN KEY ("stream_id") REFERENCES "cc_webstream" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_block_id_fkey" FOREIGN KEY ("block_id") REFERENCES "cc_block" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp_contents" ADD CONSTRAINT "cc_stamp_contents_playlist_id_fkey" FOREIGN KEY ("playlist_id") REFERENCES "cc_playlist" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp" ADD CONSTRAINT "cc_stamp_show_id_fkey" FOREIGN KEY ("show_id") REFERENCES "cc_show" ("id") ON DELETE CASCADE; - -ALTER TABLE "cc_stamp" ADD CONSTRAINT "cc_stamp_instance_id_fkey" FOREIGN KEY ("instance_id") REFERENCES "cc_show_instances" ("id") ON DELETE CASCADE; From 1a2a05c3cf8a8c69265f8cbc26dd4bf3e646b5d6 Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 12 Apr 2013 16:34:36 -0400 Subject: [PATCH 082/128] CC-4961: Show linking --- airtime_mvc/application/models/Scheduler.php | 126 +++++++++++++++++-- 1 file changed, 119 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 5068149ad..685fa6222 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -45,6 +45,21 @@ class Application_Model_Scheduler $this->checkUserPermissions = $value; } + private function validateItemMove($itemsToMove, $afterItem) + { + $afterInstanceId = $afterItem["instance"]; + + foreach ($itemsToMove as $itemToMove) { + $ccShowInstance = CcShowInstancesQuery::create() + ->findPk($itemToMove["instance"]); + $linked = $ccShowInstance->getCcShow()->isLinked(); + + if ($linked && $itemToMove["instance"] != $afterInstanceId) { + throw new Exception(_("Linked items can only be moved within its own show")); + } + } + } + /* * make sure any incoming requests for scheduling are ligit. * @@ -394,6 +409,9 @@ class Application_Model_Scheduler */ private function insertAfter($scheduleItems, $filesToInsert, $adjustSched = true) { + Logging::info($scheduleItems); + //Logging::info($filesToInsert); + try { $affectedShowInstances = array(); @@ -408,23 +426,71 @@ class Application_Model_Scheduler $startProfile = microtime(true); + /* + * We need to prevent items getting added to linked shows more + * than once. This can happen if a cursor is selected in the same + * position on 2 or more linked shows + */ + $temp = array(); + $instance = null; + $pos = 0; + foreach ($scheduleItems as $schedule) { $id = intval($schedule["id"]); + if ($id != 0) { + $ccSchedule = CcScheduleQuery::create()->findPk($schedule["id"]); + $ccShowInstance = CcShowInstancesQuery::create()->findPk($ccSchedule->getDbInstanceId()); + $ccShow = $ccShowInstance->getCcShow(); + if ($ccShow->isLinked()) { + $unique = $ccShow->getDbId() . $ccSchedule->getDbPosition(); + if (!in_array($unique, $temp)) { + $temp[] = $unique; + } else { + continue; + } + } + } else { + $ccShowInstance = CcShowInstancesQuery::create()->findPk($schedule["instance"]); + $ccShow = $ccShowInstance->getccShow(); + if ($ccShow->isLinked()) { + $unique = $ccShow->getDbId() . "a"; + if (!in_array($unique, $temp)) { + $temp[] = $unique; + } else { + continue; + } + } + } + + $instances = $this->getInstances($schedule["instance"]); + foreach($instances as $instance) { + + Logging::info($instance->getDbId()); if ($id !== 0) { $schedItem = CcScheduleQuery::create()->findPK($id, $this->con); - $instance = $schedItem->getCcShowInstances($this->con); + $pos = $schedItem->getDbPosition(); - $schedItemEndDT = $schedItem->getDbEnds(null); + $ccSchedule = CcScheduleQuery::create() + ->filterByDbInstanceId($instance->getDbId()) + ->filterByDbPosition($pos) + ->findOne(); + + //$schedItemEndDT = $schedItem->getDbEnds(null); + $schedItemEndDT = $ccSchedule->getDbEnds(null); $nextStartDT = $this->findNextStartTime($schedItemEndDT, $instance); + + $pos++; } //selected empty row to add after else { - $instance = CcShowInstancesQuery::create()->findPK($schedule["instance"], $this->con); + //$instance = CcShowInstancesQuery::create()->findPK($schedule["instance"], $this->con); $showStartDT = $instance->getDbStarts(null); $nextStartDT = $this->findNextStartTime($showStartDT, $instance); + //show is empty so start position counter at 0 + $pos = 0; } if (!in_array($instance->getDbId(), $affectedShowInstances)) { @@ -452,6 +518,7 @@ class Application_Model_Scheduler } foreach ($filesToInsert as $file) { + Logging::info("INSERTING FILE ----- ".$instance->getDbId()); $endTimeDT = $this->findEndTime($nextStartDT, $file['cliplength']); //item existed previously and is being moved. @@ -466,7 +533,7 @@ class Application_Model_Scheduler // we need to convert to '00:00:00' format $file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']); $file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']); - + $sched->setDbStarts($nextStartDT) ->setDbEnds($endTimeDT) ->setDbCueIn($file['cuein']) @@ -474,6 +541,7 @@ class Application_Model_Scheduler ->setDbFadeIn($file['fadein']) ->setDbFadeOut($file['fadeout']) ->setDbClipLength($file['cliplength']) + ->setDbPosition($pos) ->setDbInstanceId($instance->getDbId()); switch ($file["type"]) { @@ -489,6 +557,7 @@ class Application_Model_Scheduler $sched->save($this->con); $nextStartDT = $endTimeDT; + $pos++; }//all files have been inserted/moved if ($adjustSched === true) { @@ -497,20 +566,23 @@ class Application_Model_Scheduler //recalculate the start/end times after the inserted items. foreach ($followingSchedItems as $item) { - $endTimeDT = $this->findEndTime($nextStartDT, $item->getDbClipLength()); $item->setDbStarts($nextStartDT); $item->setDbEnds($endTimeDT); + $item->setDbPosition($pos); $item->save($this->con); $nextStartDT = $endTimeDT; + $pos++; } $pend = microtime(true); Logging::debug("adjusting all following items."); Logging::debug(floatval($pend) - floatval($pstart)); } - } + }//for each instance + + }//for each schedule location $endProfile = microtime(true); Logging::debug("finished adding scheduled items."); @@ -554,6 +626,17 @@ class Application_Model_Scheduler } } + private function getInstances($instanceId) + { + $ccShowInstance = CcShowInstancesQuery::create()->findPk($instanceId); + $ccShow = $ccShowInstance->getCcShow(); + if ($ccShow->isLinked()) { + return $ccShow->getCcShowInstancess(); + } else { + return array($ccShowInstance); + } + } + /* * @param array $scheduleItems (schedule_id and instance_id it belongs to) * @param array $mediaItems (file|block|playlist|webstream) @@ -611,6 +694,9 @@ class Application_Model_Scheduler */ public function moveItem($selectedItems, $afterItems, $adjustSched = true) { + //Logging::info($selectedItems); + //Logging::info($afterItems); + $startProfile = microtime(true); $this->con->beginTransaction(); @@ -618,6 +704,7 @@ class Application_Model_Scheduler try { + $this->validateItemMove($selectedItems, $afterItems[0]); $this->validateRequest($selectedItems); $this->validateRequest($afterItems); @@ -657,7 +744,7 @@ class Application_Model_Scheduler $modifiedMap[$showInstanceId] = array($schedId); } } - +Logging::info($movedData); //calculate times excluding the to be moved items. foreach ($modifiedMap as $instance => $schedIds) { $startProfile = microtime(true); @@ -716,6 +803,31 @@ class Application_Model_Scheduler $instance = $removedItem->getCcShowInstances($this->con); + //check if instance is linked and if so get the schedule items + //for all linked instances so we can delete them too + if ($instance->getCcShow()->isLinked()) { + //returns all linked instances if linked + $ccShowInstances = $this->getInstances($instance->getDbId()); + $instanceIds = array(); + foreach ($ccShowInstances as $ccShowInstance) { + $instanceIds[] = $ccShowInstance->getDbId(); + } + /* + * Find all the schedule items that are in the same position + * as the selected item by the user. + * The position of each track is the same across each linked instance + */ + $itemsToDelete = CcScheduleQuery::create() + ->filterByDbPosition($removedItem->getDbPosition()) + ->filterByDbInstanceId($instanceIds, Criteria::IN) + ->find(); + foreach ($itemsToDelete as $item) { + if (!$removedItems->contains($item)) { + $removedItems->append($item); + } + } + } + //check to truncate the currently playing item instead of deleting it. if ($removedItem->isCurrentItem($this->epochNow)) { From 592b532b79d4e97178ae830af98988390af36b26 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 14 Apr 2013 18:10:35 -0400 Subject: [PATCH 083/128] use master instead of devel for nightlies --- gen-snapshot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen-snapshot.sh b/gen-snapshot.sh index 7702caaf2..682069e34 100755 --- a/gen-snapshot.sh +++ b/gen-snapshot.sh @@ -6,7 +6,7 @@ VERSION=2.3.0~$(date "+%Y%m%d") BUILDDEST=/tmp/airtime-${VERSION}/ DEBDIR=`pwd`/debian -git checkout devel +git checkout master git pull echo "cleaning up previous build..." From 479e69de1203c04819a6b26b93e2f40456c4b280 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 18 Apr 2013 15:40:33 -0400 Subject: [PATCH 084/128] CC-5009: Use Silan to silently update track length in the background -done --- .../application/controllers/ApiController.php | 18 +++++++++++++++++- .../application/models/airtime/CcFiles.php | 2 ++ python_apps/pypo/media/update/silananalyzer.py | 9 ++++++--- utils/airtime-silan.py | 1 + 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index ec2de93fc..ee382026f 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -979,8 +979,24 @@ class ApiController extends Zend_Controller_Action list($id, $info) = $pair; // TODO : move this code into model -- RG $file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm(); + + //What we are doing here is setting a more accurate length that was + //calculated with silan by actually scanning the entire file. This + //process takes a really long time, and so we only do it in the background + //after the file has already been imported -MK + $length = $file->getDbLength(); + if (isset($info['length'])) { + $length = $info['length']; + //length decimal number in seconds. Need to convert it to format + //HH:mm:ss to get around silly PHP limitations. + $length = Application_Common_DateHelper::secondsToPlaylistTime($length); + + $file->setDbLength($length); + } + $cuein = isset($info['cuein']) ? $info['cuein'] : 0; - $cueout = isset($info['cueout']) ? $info['cueout'] : $file->getDbLength(); + $cueout = isset($info['cueout']) ? $info['cueout'] : $length; + $file->setDbCuein($cuein); $file->setDbCueout($cueout); $file->setDbSilanCheck(true); diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 9c6bc8359..001c2c7a1 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -20,6 +20,8 @@ class CcFiles extends BaseCcFiles { public function setDbLength($v) { + //we are using DateTime instead of DateInterval because the latter doesn't + //support subseconds :( if ($v instanceof DateTime) { $dt = $v; } diff --git a/python_apps/pypo/media/update/silananalyzer.py b/python_apps/pypo/media/update/silananalyzer.py index 03441d614..4682b14c0 100644 --- a/python_apps/pypo/media/update/silananalyzer.py +++ b/python_apps/pypo/media/update/silananalyzer.py @@ -49,9 +49,12 @@ class SilanAnalyzer(Thread): if len(comm): out = comm[0].strip('\r\n') info = json.loads(out) - if len(info['sound']) >= 2: - data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) - data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + try: data['length'] = str('{0:f}'.format(info['file duration'])) + except: pass + try: data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) + except: pass + try: data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + except: pass except Exception, e: self.logger.error(str(command)) self.logger.error(e) diff --git a/utils/airtime-silan.py b/utils/airtime-silan.py index 00e94d77e..d434d2ddb 100644 --- a/utils/airtime-silan.py +++ b/utils/airtime-silan.py @@ -55,6 +55,7 @@ try: data = {} data['cuein'] = str('{0:f}'.format(info['sound'][0][0])) data['cueout'] = str('{0:f}'.format(info['sound'][-1][1])) + data['length'] = str('{0:f}'.format(info['file duration'])) processed_data.append((f['id'], data)) total += 1 if total % 5 == 0: From 01af1ff8fb8eaf0d8da91879c039c32e5c381121 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 18 Apr 2013 15:56:20 -0400 Subject: [PATCH 085/128] CC-5022: airtime-install -l doesn't take effect -option removed for now --- install_minimal/airtime-install | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 1440e3691..88054685f 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -17,8 +17,7 @@ showhelp () { --reinstall|-r Force a fresh install of this Airtime Version --media-monitor|-m Install only media-monitor --pypo|-p Install only pypo and liquidsoap ---web|-w Install only files for web-server ---liquidsoap-keep-alive|-l Keep Liquidsoap alive when upgrading" +--web|-w Install only files for web-server" exit 0 } @@ -30,7 +29,6 @@ mediamonitor="f" pypo="f" showrecorder="f" web="f" -liquidsoap_keep_alive="f" disable_deb_check="f" set -- $(getopt -l help,overwrite,preserve,no-db,reinstall,media-monitor,pypo,web,liquidsoap-keep-alive,disable-deb-check "hopnrmywld" "$@") @@ -45,7 +43,6 @@ do (-m|--media-monitor) mediamonitor="t";; (-y|--pypo) pypo="t";; (-w|--web) web="t";; - (-l|--liquidsoap-keep-alive) liquidsoap_keep_alive="t";; (-d|--disable-deb-check) disable_deb_check="t";; (--) shift; break;; @@ -168,7 +165,6 @@ export reinstall export nodb export overwrite export preserve -export liquidsoap_keep_alive set +e test "$mediamonitor" = "t" -o "$pypo" = "t" From 351dfc027a7a3b34d0df447aefaa7e7ccdc853d1 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 18 Apr 2013 16:09:09 -0400 Subject: [PATCH 086/128] clean up upgrades for 2.4 Don't allow upgrades earlier than 2.2 --- install_minimal/include/airtime-upgrade.php | 36 +- .../upgrades/airtime-2.0.1/UpgradeCommon.php | 256 - .../airtime-2.0.1/airtime-monit.cfg.201 | 24 - .../airtime-2.0.1/airtime-upgrade.php | 83 - .../upgrades/airtime-2.0.1/airtime.conf.201 | 23 - .../upgrades/airtime-2.0.1/api_client.cfg.201 | 104 - .../upgrades/airtime-2.0.1/liquidsoap.cfg.201 | 69 - .../airtime-2.0.1/media-monitor.cfg.201 | 22 - .../airtime-2.0.1/propel/airtime-conf.php | 28 - .../airtime-2.0.1/propel/airtime/CcAccess.php | 18 - .../propel/airtime/CcAccessPeer.php | 18 - .../propel/airtime/CcAccessQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcBackup.php | 18 - .../propel/airtime/CcBackupPeer.php | 18 - .../propel/airtime/CcBackupQuery.php | 18 - .../propel/airtime/CcCountry.php | 18 - .../propel/airtime/CcCountryPeer.php | 18 - .../propel/airtime/CcCountryQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcFiles.php | 31 - .../propel/airtime/CcFilesPeer.php | 18 - .../propel/airtime/CcFilesQuery.php | 18 - .../propel/airtime/CcLoginAttempts.php | 18 - .../propel/airtime/CcLoginAttemptsPeer.php | 18 - .../propel/airtime/CcLoginAttemptsQuery.php | 18 - .../propel/airtime/CcMusicDirs.php | 18 - .../propel/airtime/CcMusicDirsPeer.php | 18 - .../propel/airtime/CcMusicDirsQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcPerms.php | 18 - .../propel/airtime/CcPermsPeer.php | 18 - .../propel/airtime/CcPermsQuery.php | 18 - .../propel/airtime/CcPlaylist.php | 48 - .../propel/airtime/CcPlaylistPeer.php | 18 - .../propel/airtime/CcPlaylistQuery.php | 18 - .../propel/airtime/CcPlaylistcontents.php | 81 - .../propel/airtime/CcPlaylistcontentsPeer.php | 18 - .../airtime/CcPlaylistcontentsQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcPref.php | 18 - .../propel/airtime/CcPrefPeer.php | 18 - .../propel/airtime/CcPrefQuery.php | 18 - .../propel/airtime/CcSchedule.php | 18 - .../propel/airtime/CcSchedulePeer.php | 18 - .../propel/airtime/CcScheduleQuery.php | 18 - .../propel/airtime/CcServiceRegister.php | 18 - .../propel/airtime/CcServiceRegisterPeer.php | 18 - .../propel/airtime/CcServiceRegisterQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcSess.php | 18 - .../propel/airtime/CcSessPeer.php | 18 - .../propel/airtime/CcSessQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcShow.php | 18 - .../propel/airtime/CcShowDays.php | 18 - .../propel/airtime/CcShowDaysPeer.php | 18 - .../propel/airtime/CcShowDaysQuery.php | 18 - .../propel/airtime/CcShowHosts.php | 18 - .../propel/airtime/CcShowHostsPeer.php | 18 - .../propel/airtime/CcShowHostsQuery.php | 18 - .../propel/airtime/CcShowInstances.php | 18 - .../propel/airtime/CcShowInstancesPeer.php | 18 - .../propel/airtime/CcShowInstancesQuery.php | 18 - .../propel/airtime/CcShowPeer.php | 18 - .../propel/airtime/CcShowQuery.php | 18 - .../propel/airtime/CcShowRebroadcast.php | 18 - .../propel/airtime/CcShowRebroadcastPeer.php | 18 - .../propel/airtime/CcShowRebroadcastQuery.php | 18 - .../propel/airtime/CcShowSchedule.php | 18 - .../propel/airtime/CcShowSchedulePeer.php | 18 - .../propel/airtime/CcShowScheduleQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcSmemb.php | 18 - .../propel/airtime/CcSmembPeer.php | 18 - .../propel/airtime/CcSmembQuery.php | 18 - .../propel/airtime/CcStreamSetting.php | 18 - .../propel/airtime/CcStreamSettingPeer.php | 18 - .../propel/airtime/CcStreamSettingQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcSubjs.php | 18 - .../propel/airtime/CcSubjsPeer.php | 18 - .../propel/airtime/CcSubjsQuery.php | 18 - .../airtime-2.0.1/propel/airtime/CcTrans.php | 18 - .../propel/airtime/CcTransPeer.php | 18 - .../propel/airtime/CcTransQuery.php | 18 - .../airtime-2.0.1/propel/airtime/Common.php | 19 - .../propel/airtime/map/CcAccessTableMap.php | 61 - .../propel/airtime/map/CcBackupTableMap.php | 55 - .../propel/airtime/map/CcCountryTableMap.php | 52 - .../propel/airtime/map/CcFilesTableMap.php | 115 - .../airtime/map/CcLoginAttemptsTableMap.php | 52 - .../airtime/map/CcMusicDirsTableMap.php | 55 - .../propel/airtime/map/CcPermsTableMap.php | 56 - .../propel/airtime/map/CcPlaylistTableMap.php | 61 - .../map/CcPlaylistcontentsTableMap.php | 62 - .../propel/airtime/map/CcPrefTableMap.php | 56 - .../propel/airtime/map/CcScheduleTableMap.php | 80 - .../airtime/map/CcServiceRegisterTableMap.php | 52 - .../propel/airtime/map/CcSessTableMap.php | 55 - .../propel/airtime/map/CcShowDaysTableMap.php | 63 - .../airtime/map/CcShowHostsTableMap.php | 56 - .../airtime/map/CcShowInstancesTableMap.php | 79 - .../airtime/map/CcShowRebroadcastTableMap.php | 56 - .../airtime/map/CcShowScheduleTableMap.php | 56 - .../propel/airtime/map/CcShowTableMap.php | 62 - .../propel/airtime/map/CcSmembTableMap.php | 55 - .../airtime/map/CcStreamSettingTableMap.php | 53 - .../propel/airtime/map/CcSubjsTableMap.php | 70 - .../propel/airtime/map/CcTransTableMap.php | 75 - .../propel/airtime/om/BaseCcAccess.php | 1236 ----- .../propel/airtime/om/BaseCcAccessPeer.php | 1008 ---- .../propel/airtime/om/BaseCcAccessQuery.php | 477 -- .../propel/airtime/om/BaseCcBackup.php | 956 ---- .../propel/airtime/om/BaseCcBackupPeer.php | 750 --- .../propel/airtime/om/BaseCcBackupQuery.php | 292 -- .../propel/airtime/om/BaseCcCountry.php | 708 --- .../propel/airtime/om/BaseCcCountryPeer.php | 735 --- .../propel/airtime/om/BaseCcCountryQuery.php | 196 - .../propel/airtime/om/BaseCcFiles.php | 4325 ---------------- .../propel/airtime/om/BaseCcFilesPeer.php | 1654 ------ .../propel/airtime/om/BaseCcFilesQuery.php | 2094 -------- .../propel/airtime/om/BaseCcLoginAttempts.php | 735 --- .../airtime/om/BaseCcLoginAttemptsPeer.php | 735 --- .../airtime/om/BaseCcLoginAttemptsQuery.php | 205 - .../propel/airtime/om/BaseCcMusicDirs.php | 941 ---- .../propel/airtime/om/BaseCcMusicDirsPeer.php | 747 --- .../airtime/om/BaseCcMusicDirsQuery.php | 285 -- .../propel/airtime/om/BaseCcPerms.php | 945 ---- .../propel/airtime/om/BaseCcPermsPeer.php | 984 ---- .../propel/airtime/om/BaseCcPermsQuery.php | 355 -- .../propel/airtime/om/BaseCcPlaylist.php | 1365 ----- .../propel/airtime/om/BaseCcPlaylistPeer.php | 1006 ---- .../propel/airtime/om/BaseCcPlaylistQuery.php | 510 -- .../airtime/om/BaseCcPlaylistcontents.php | 1540 ------ .../airtime/om/BaseCcPlaylistcontentsPeer.php | 1395 ----- .../om/BaseCcPlaylistcontentsQuery.php | 581 --- .../propel/airtime/om/BaseCcPref.php | 905 ---- .../propel/airtime/om/BaseCcPrefPeer.php | 983 ---- .../propel/airtime/om/BaseCcPrefQuery.php | 320 -- .../propel/airtime/om/BaseCcSchedule.php | 1923 ------- .../propel/airtime/om/BaseCcSchedulePeer.php | 1420 ------ .../propel/airtime/om/BaseCcScheduleQuery.php | 814 --- .../airtime/om/BaseCcServiceRegister.php | 708 --- .../airtime/om/BaseCcServiceRegisterPeer.php | 735 --- .../airtime/om/BaseCcServiceRegisterQuery.php | 196 - .../propel/airtime/om/BaseCcSess.php | 949 ---- .../propel/airtime/om/BaseCcSessPeer.php | 979 ---- .../propel/airtime/om/BaseCcSessQuery.php | 334 -- .../propel/airtime/om/BaseCcShow.php | 1654 ------ .../propel/airtime/om/BaseCcShowDays.php | 1476 ------ .../propel/airtime/om/BaseCcShowDaysPeer.php | 1018 ---- .../propel/airtime/om/BaseCcShowDaysQuery.php | 565 -- .../propel/airtime/om/BaseCcShowHosts.php | 936 ---- .../propel/airtime/om/BaseCcShowHostsPeer.php | 1365 ----- .../airtime/om/BaseCcShowHostsQuery.php | 371 -- .../propel/airtime/om/BaseCcShowInstances.php | 1945 ------- .../airtime/om/BaseCcShowInstancesPeer.php | 1555 ------ .../airtime/om/BaseCcShowInstancesQuery.php | 806 --- .../propel/airtime/om/BaseCcShowPeer.php | 776 --- .../propel/airtime/om/BaseCcShowQuery.php | 593 --- .../airtime/om/BaseCcShowRebroadcast.php | 957 ---- .../airtime/om/BaseCcShowRebroadcastPeer.php | 983 ---- .../airtime/om/BaseCcShowRebroadcastQuery.php | 329 -- .../propel/airtime/om/BaseCcShowSchedule.php | 905 ---- .../airtime/om/BaseCcShowSchedulePeer.php | 983 ---- .../airtime/om/BaseCcShowScheduleQuery.php | 338 -- .../propel/airtime/om/BaseCcSmemb.php | 891 ---- .../propel/airtime/om/BaseCcSmembPeer.php | 750 --- .../propel/airtime/om/BaseCcSmembQuery.php | 305 -- .../propel/airtime/om/BaseCcStreamSetting.php | 756 --- .../airtime/om/BaseCcStreamSettingPeer.php | 740 --- .../airtime/om/BaseCcStreamSettingQuery.php | 222 - .../propel/airtime/om/BaseCcSubjs.php | 2423 --------- .../propel/airtime/om/BaseCcSubjsPeer.php | 801 --- .../propel/airtime/om/BaseCcSubjsQuery.php | 954 ---- .../propel/airtime/om/BaseCcTrans.php | 1903 ------- .../propel/airtime/om/BaseCcTransPeer.php | 849 --- .../propel/airtime/om/BaseCcTransQuery.php | 826 --- .../propel/airtime/om/CcFiles.php | 31 - .../propel/airtime/om/CcPlaylist.php | 48 - .../propel/airtime/om/CcPlaylistcontents.php | 81 - .../propel/airtime/om/Common.php | 19 - .../propel/classmap-airtime-conf.php | 144 - .../upgrades/airtime-2.0.1/pypo.cfg.201 | 73 - .../upgrades/airtime-2.0.1/recorder.cfg.201 | 30 - .../upgrades/airtime-2.0.2/UpgradeCommon.php | 250 - .../airtime-2.0.2/airtime-monit.cfg.202 | 24 - .../airtime-2.0.2/airtime-upgrade.php | 81 - .../upgrades/airtime-2.0.2/airtime.conf.202 | 23 - .../upgrades/airtime-2.0.2/api_client.cfg.202 | 97 - .../upgrades/airtime-2.0.2/liquidsoap.cfg.202 | 69 - .../airtime-2.0.2/media-monitor.cfg.202 | 22 - .../airtime-2.0.2/propel/airtime-conf.php | 28 - .../airtime-2.0.2/propel/airtime/CcAccess.php | 18 - .../propel/airtime/CcAccessPeer.php | 18 - .../propel/airtime/CcAccessQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcBackup.php | 18 - .../propel/airtime/CcBackupPeer.php | 18 - .../propel/airtime/CcBackupQuery.php | 18 - .../propel/airtime/CcCountry.php | 18 - .../propel/airtime/CcCountryPeer.php | 18 - .../propel/airtime/CcCountryQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcFiles.php | 31 - .../propel/airtime/CcFilesPeer.php | 18 - .../propel/airtime/CcFilesQuery.php | 18 - .../propel/airtime/CcLoginAttempts.php | 18 - .../propel/airtime/CcLoginAttemptsPeer.php | 18 - .../propel/airtime/CcLoginAttemptsQuery.php | 18 - .../propel/airtime/CcMusicDirs.php | 18 - .../propel/airtime/CcMusicDirsPeer.php | 18 - .../propel/airtime/CcMusicDirsQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcPerms.php | 18 - .../propel/airtime/CcPermsPeer.php | 18 - .../propel/airtime/CcPermsQuery.php | 18 - .../propel/airtime/CcPlaylist.php | 48 - .../propel/airtime/CcPlaylistPeer.php | 18 - .../propel/airtime/CcPlaylistQuery.php | 18 - .../propel/airtime/CcPlaylistcontents.php | 81 - .../propel/airtime/CcPlaylistcontentsPeer.php | 18 - .../airtime/CcPlaylistcontentsQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcPref.php | 18 - .../propel/airtime/CcPrefPeer.php | 18 - .../propel/airtime/CcPrefQuery.php | 18 - .../propel/airtime/CcSchedule.php | 18 - .../propel/airtime/CcSchedulePeer.php | 18 - .../propel/airtime/CcScheduleQuery.php | 18 - .../propel/airtime/CcServiceRegister.php | 18 - .../propel/airtime/CcServiceRegisterPeer.php | 18 - .../propel/airtime/CcServiceRegisterQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcSess.php | 18 - .../propel/airtime/CcSessPeer.php | 18 - .../propel/airtime/CcSessQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcShow.php | 18 - .../propel/airtime/CcShowDays.php | 18 - .../propel/airtime/CcShowDaysPeer.php | 18 - .../propel/airtime/CcShowDaysQuery.php | 18 - .../propel/airtime/CcShowHosts.php | 18 - .../propel/airtime/CcShowHostsPeer.php | 18 - .../propel/airtime/CcShowHostsQuery.php | 18 - .../propel/airtime/CcShowInstances.php | 18 - .../propel/airtime/CcShowInstancesPeer.php | 18 - .../propel/airtime/CcShowInstancesQuery.php | 18 - .../propel/airtime/CcShowPeer.php | 18 - .../propel/airtime/CcShowQuery.php | 18 - .../propel/airtime/CcShowRebroadcast.php | 18 - .../propel/airtime/CcShowRebroadcastPeer.php | 18 - .../propel/airtime/CcShowRebroadcastQuery.php | 18 - .../propel/airtime/CcShowSchedule.php | 18 - .../propel/airtime/CcShowSchedulePeer.php | 18 - .../propel/airtime/CcShowScheduleQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcSmemb.php | 18 - .../propel/airtime/CcSmembPeer.php | 18 - .../propel/airtime/CcSmembQuery.php | 18 - .../propel/airtime/CcStreamSetting.php | 18 - .../propel/airtime/CcStreamSettingPeer.php | 18 - .../propel/airtime/CcStreamSettingQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcSubjs.php | 18 - .../propel/airtime/CcSubjsPeer.php | 18 - .../propel/airtime/CcSubjsQuery.php | 18 - .../airtime-2.0.2/propel/airtime/CcTrans.php | 18 - .../propel/airtime/CcTransPeer.php | 18 - .../propel/airtime/CcTransQuery.php | 18 - .../airtime-2.0.2/propel/airtime/Common.php | 19 - .../propel/airtime/map/CcAccessTableMap.php | 61 - .../propel/airtime/map/CcBackupTableMap.php | 55 - .../propel/airtime/map/CcCountryTableMap.php | 52 - .../propel/airtime/map/CcFilesTableMap.php | 115 - .../airtime/map/CcLoginAttemptsTableMap.php | 52 - .../airtime/map/CcMusicDirsTableMap.php | 55 - .../propel/airtime/map/CcPermsTableMap.php | 56 - .../propel/airtime/map/CcPlaylistTableMap.php | 61 - .../map/CcPlaylistcontentsTableMap.php | 62 - .../propel/airtime/map/CcPrefTableMap.php | 56 - .../propel/airtime/map/CcScheduleTableMap.php | 80 - .../airtime/map/CcServiceRegisterTableMap.php | 52 - .../propel/airtime/map/CcSessTableMap.php | 55 - .../propel/airtime/map/CcShowDaysTableMap.php | 63 - .../airtime/map/CcShowHostsTableMap.php | 56 - .../airtime/map/CcShowInstancesTableMap.php | 79 - .../airtime/map/CcShowRebroadcastTableMap.php | 56 - .../airtime/map/CcShowScheduleTableMap.php | 56 - .../propel/airtime/map/CcShowTableMap.php | 62 - .../propel/airtime/map/CcSmembTableMap.php | 55 - .../airtime/map/CcStreamSettingTableMap.php | 53 - .../propel/airtime/map/CcSubjsTableMap.php | 70 - .../propel/airtime/map/CcTransTableMap.php | 75 - .../propel/airtime/om/BaseCcAccess.php | 1236 ----- .../propel/airtime/om/BaseCcAccessPeer.php | 1008 ---- .../propel/airtime/om/BaseCcAccessQuery.php | 477 -- .../propel/airtime/om/BaseCcBackup.php | 956 ---- .../propel/airtime/om/BaseCcBackupPeer.php | 750 --- .../propel/airtime/om/BaseCcBackupQuery.php | 292 -- .../propel/airtime/om/BaseCcCountry.php | 708 --- .../propel/airtime/om/BaseCcCountryPeer.php | 735 --- .../propel/airtime/om/BaseCcCountryQuery.php | 196 - .../propel/airtime/om/BaseCcFiles.php | 4325 ---------------- .../propel/airtime/om/BaseCcFilesPeer.php | 1654 ------ .../propel/airtime/om/BaseCcFilesQuery.php | 2094 -------- .../propel/airtime/om/BaseCcLoginAttempts.php | 735 --- .../airtime/om/BaseCcLoginAttemptsPeer.php | 735 --- .../airtime/om/BaseCcLoginAttemptsQuery.php | 205 - .../propel/airtime/om/BaseCcMusicDirs.php | 941 ---- .../propel/airtime/om/BaseCcMusicDirsPeer.php | 747 --- .../airtime/om/BaseCcMusicDirsQuery.php | 285 -- .../propel/airtime/om/BaseCcPerms.php | 945 ---- .../propel/airtime/om/BaseCcPermsPeer.php | 984 ---- .../propel/airtime/om/BaseCcPermsQuery.php | 355 -- .../propel/airtime/om/BaseCcPlaylist.php | 1365 ----- .../propel/airtime/om/BaseCcPlaylistPeer.php | 1006 ---- .../propel/airtime/om/BaseCcPlaylistQuery.php | 510 -- .../airtime/om/BaseCcPlaylistcontents.php | 1540 ------ .../airtime/om/BaseCcPlaylistcontentsPeer.php | 1395 ----- .../om/BaseCcPlaylistcontentsQuery.php | 581 --- .../propel/airtime/om/BaseCcPref.php | 905 ---- .../propel/airtime/om/BaseCcPrefPeer.php | 983 ---- .../propel/airtime/om/BaseCcPrefQuery.php | 320 -- .../propel/airtime/om/BaseCcSchedule.php | 1923 ------- .../propel/airtime/om/BaseCcSchedulePeer.php | 1420 ------ .../propel/airtime/om/BaseCcScheduleQuery.php | 814 --- .../airtime/om/BaseCcServiceRegister.php | 708 --- .../airtime/om/BaseCcServiceRegisterPeer.php | 735 --- .../airtime/om/BaseCcServiceRegisterQuery.php | 196 - .../propel/airtime/om/BaseCcSess.php | 949 ---- .../propel/airtime/om/BaseCcSessPeer.php | 979 ---- .../propel/airtime/om/BaseCcSessQuery.php | 334 -- .../propel/airtime/om/BaseCcShow.php | 1654 ------ .../propel/airtime/om/BaseCcShowDays.php | 1476 ------ .../propel/airtime/om/BaseCcShowDaysPeer.php | 1018 ---- .../propel/airtime/om/BaseCcShowDaysQuery.php | 565 -- .../propel/airtime/om/BaseCcShowHosts.php | 936 ---- .../propel/airtime/om/BaseCcShowHostsPeer.php | 1365 ----- .../airtime/om/BaseCcShowHostsQuery.php | 371 -- .../propel/airtime/om/BaseCcShowInstances.php | 1945 ------- .../airtime/om/BaseCcShowInstancesPeer.php | 1555 ------ .../airtime/om/BaseCcShowInstancesQuery.php | 806 --- .../propel/airtime/om/BaseCcShowPeer.php | 776 --- .../propel/airtime/om/BaseCcShowQuery.php | 593 --- .../airtime/om/BaseCcShowRebroadcast.php | 957 ---- .../airtime/om/BaseCcShowRebroadcastPeer.php | 983 ---- .../airtime/om/BaseCcShowRebroadcastQuery.php | 329 -- .../propel/airtime/om/BaseCcShowSchedule.php | 905 ---- .../airtime/om/BaseCcShowSchedulePeer.php | 983 ---- .../airtime/om/BaseCcShowScheduleQuery.php | 338 -- .../propel/airtime/om/BaseCcSmemb.php | 891 ---- .../propel/airtime/om/BaseCcSmembPeer.php | 750 --- .../propel/airtime/om/BaseCcSmembQuery.php | 305 -- .../propel/airtime/om/BaseCcStreamSetting.php | 756 --- .../airtime/om/BaseCcStreamSettingPeer.php | 740 --- .../airtime/om/BaseCcStreamSettingQuery.php | 222 - .../propel/airtime/om/BaseCcSubjs.php | 2423 --------- .../propel/airtime/om/BaseCcSubjsPeer.php | 801 --- .../propel/airtime/om/BaseCcSubjsQuery.php | 954 ---- .../propel/airtime/om/BaseCcTrans.php | 1903 ------- .../propel/airtime/om/BaseCcTransPeer.php | 849 --- .../propel/airtime/om/BaseCcTransQuery.php | 826 --- .../propel/airtime/om/CcFiles.php | 31 - .../propel/airtime/om/CcPlaylist.php | 48 - .../propel/airtime/om/CcPlaylistcontents.php | 81 - .../propel/airtime/om/Common.php | 19 - .../propel/classmap-airtime-conf.php | 144 - .../upgrades/airtime-2.0.2/pypo.cfg.202 | 87 - .../airtime-2.0.3/airtime-upgrade.php | 75 - .../airtime-2.0.3/monit-airtime-generic.cfg | 6 - .../airtime-2.1.0/ConfFileUpgrade.php | 16 - .../upgrades/airtime-2.1.0/DbUpgrade.php | 25 - .../upgrades/airtime-2.1.0/MiscUpgrade.php | 24 - .../airtime-2.1.0/airtime-upgrade.php | 61 - .../airtime-2.1.0/common/UpgradeCommon.php | 246 - .../common/Version20120402103944.php | 26 - .../common/Version20120403143635.php | 23 - .../common/Version20120405114454.php | 29 - .../common/Version20120410104441.php | 49 - .../common/Version20120410143340.php | 41 - .../common/Version20120411102907.php | 52 - .../common/Version20120411174904.php | 30 - .../airtime-2.1.0/common/migrations.xml | 15 - .../upgrades/airtime-2.1.0/data/upgrade.sql | 165 - .../airtime-2.1.0/etc/airtime.conf.210 | 31 - .../airtime-2.1.0/etc/api_client.cfg.210 | 111 - .../airtime-2.1.0/etc/liquidsoap.cfg.210 | 69 - .../airtime-2.1.0/etc/media-monitor.cfg.210 | 22 - .../upgrades/airtime-2.1.0/etc/pypo.cfg.210 | 85 - .../airtime-2.1.0/propel/airtime-conf.php | 28 - .../airtime-2.1.0/propel/airtime/CcAccess.php | 18 - .../propel/airtime/CcAccessPeer.php | 18 - .../propel/airtime/CcAccessQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcBackup.php | 18 - .../propel/airtime/CcBackupPeer.php | 18 - .../propel/airtime/CcBackupQuery.php | 18 - .../propel/airtime/CcCountry.php | 18 - .../propel/airtime/CcCountryPeer.php | 18 - .../propel/airtime/CcCountryQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcFiles.php | 44 - .../propel/airtime/CcFilesPeer.php | 18 - .../propel/airtime/CcFilesQuery.php | 18 - .../propel/airtime/CcLoginAttempts.php | 18 - .../propel/airtime/CcLoginAttemptsPeer.php | 18 - .../propel/airtime/CcLoginAttemptsQuery.php | 18 - .../propel/airtime/CcMusicDirs.php | 18 - .../propel/airtime/CcMusicDirsPeer.php | 18 - .../propel/airtime/CcMusicDirsQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcPerms.php | 18 - .../propel/airtime/CcPermsPeer.php | 18 - .../propel/airtime/CcPermsQuery.php | 18 - .../propel/airtime/CcPlaylist.php | 102 - .../propel/airtime/CcPlaylistPeer.php | 18 - .../propel/airtime/CcPlaylistQuery.php | 18 - .../propel/airtime/CcPlaylistcontents.php | 112 - .../propel/airtime/CcPlaylistcontentsPeer.php | 18 - .../airtime/CcPlaylistcontentsQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcPref.php | 18 - .../propel/airtime/CcPrefPeer.php | 18 - .../propel/airtime/CcPrefQuery.php | 18 - .../propel/airtime/CcSchedule.php | 260 - .../propel/airtime/CcSchedulePeer.php | 18 - .../propel/airtime/CcScheduleQuery.php | 18 - .../propel/airtime/CcServiceRegister.php | 18 - .../propel/airtime/CcServiceRegisterPeer.php | 18 - .../propel/airtime/CcServiceRegisterQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcSess.php | 18 - .../propel/airtime/CcSessPeer.php | 18 - .../propel/airtime/CcSessQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcShow.php | 18 - .../propel/airtime/CcShowDays.php | 18 - .../propel/airtime/CcShowDaysPeer.php | 18 - .../propel/airtime/CcShowDaysQuery.php | 18 - .../propel/airtime/CcShowHosts.php | 18 - .../propel/airtime/CcShowHostsPeer.php | 18 - .../propel/airtime/CcShowHostsQuery.php | 18 - .../propel/airtime/CcShowInstances.php | 171 - .../propel/airtime/CcShowInstancesPeer.php | 18 - .../propel/airtime/CcShowInstancesQuery.php | 18 - .../propel/airtime/CcShowPeer.php | 18 - .../propel/airtime/CcShowQuery.php | 18 - .../propel/airtime/CcShowRebroadcast.php | 18 - .../propel/airtime/CcShowRebroadcastPeer.php | 18 - .../propel/airtime/CcShowRebroadcastQuery.php | 18 - .../propel/airtime/CcShowSchedule.php | 18 - .../propel/airtime/CcShowSchedulePeer.php | 18 - .../propel/airtime/CcShowScheduleQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcSmemb.php | 18 - .../propel/airtime/CcSmembPeer.php | 18 - .../propel/airtime/CcSmembQuery.php | 18 - .../propel/airtime/CcStreamSetting.php | 18 - .../propel/airtime/CcStreamSettingPeer.php | 18 - .../propel/airtime/CcStreamSettingQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcSubjs.php | 18 - .../propel/airtime/CcSubjsPeer.php | 18 - .../propel/airtime/CcSubjsQuery.php | 18 - .../propel/airtime/CcSubjsToken.php | 18 - .../propel/airtime/CcSubjsTokenPeer.php | 18 - .../propel/airtime/CcSubjsTokenQuery.php | 18 - .../airtime-2.1.0/propel/airtime/CcTrans.php | 18 - .../propel/airtime/CcTransPeer.php | 18 - .../propel/airtime/CcTransQuery.php | 18 - .../airtime-2.1.0/propel/airtime/Common.php | 19 - .../propel/airtime/map/CcAccessTableMap.php | 61 - .../propel/airtime/map/CcBackupTableMap.php | 55 - .../propel/airtime/map/CcCountryTableMap.php | 52 - .../propel/airtime/map/CcFilesTableMap.php | 118 - .../airtime/map/CcLoginAttemptsTableMap.php | 52 - .../airtime/map/CcMusicDirsTableMap.php | 57 - .../propel/airtime/map/CcPermsTableMap.php | 56 - .../propel/airtime/map/CcPlaylistTableMap.php | 73 - .../map/CcPlaylistcontentsTableMap.php | 75 - .../propel/airtime/map/CcPrefTableMap.php | 56 - .../propel/airtime/map/CcScheduleTableMap.php | 65 - .../airtime/map/CcServiceRegisterTableMap.php | 52 - .../propel/airtime/map/CcSessTableMap.php | 55 - .../propel/airtime/map/CcShowDaysTableMap.php | 63 - .../airtime/map/CcShowHostsTableMap.php | 56 - .../airtime/map/CcShowInstancesTableMap.php | 68 - .../airtime/map/CcShowRebroadcastTableMap.php | 56 - .../airtime/map/CcShowScheduleTableMap.php | 56 - .../propel/airtime/map/CcShowTableMap.php | 66 - .../propel/airtime/map/CcSmembTableMap.php | 55 - .../airtime/map/CcStreamSettingTableMap.php | 53 - .../propel/airtime/map/CcSubjsTableMap.php | 71 - .../airtime/map/CcSubjsTokenTableMap.php | 57 - .../propel/airtime/map/CcTransTableMap.php | 75 - .../propel/airtime/om/BaseCcAccess.php | 1236 ----- .../propel/airtime/om/BaseCcAccessPeer.php | 1008 ---- .../propel/airtime/om/BaseCcAccessQuery.php | 477 -- .../propel/airtime/om/BaseCcBackup.php | 956 ---- .../propel/airtime/om/BaseCcBackupPeer.php | 750 --- .../propel/airtime/om/BaseCcBackupQuery.php | 292 -- .../propel/airtime/om/BaseCcCountry.php | 708 --- .../propel/airtime/om/BaseCcCountryPeer.php | 735 --- .../propel/airtime/om/BaseCcCountryQuery.php | 196 - .../propel/airtime/om/BaseCcFiles.php | 4533 ----------------- .../propel/airtime/om/BaseCcFilesPeer.php | 1669 ------ .../propel/airtime/om/BaseCcFilesQuery.php | 2194 -------- .../propel/airtime/om/BaseCcLoginAttempts.php | 735 --- .../airtime/om/BaseCcLoginAttemptsPeer.php | 735 --- .../airtime/om/BaseCcLoginAttemptsQuery.php | 205 - .../propel/airtime/om/BaseCcMusicDirs.php | 1070 ---- .../propel/airtime/om/BaseCcMusicDirsPeer.php | 754 --- .../airtime/om/BaseCcMusicDirsQuery.php | 327 -- .../propel/airtime/om/BaseCcPerms.php | 945 ---- .../propel/airtime/om/BaseCcPermsPeer.php | 984 ---- .../propel/airtime/om/BaseCcPermsQuery.php | 355 -- .../propel/airtime/om/BaseCcPlaylist.php | 1391 ----- .../propel/airtime/om/BaseCcPlaylistPeer.php | 1001 ---- .../propel/airtime/om/BaseCcPlaylistQuery.php | 484 -- .../airtime/om/BaseCcPlaylistcontents.php | 1408 ----- .../airtime/om/BaseCcPlaylistcontentsPeer.php | 1395 ----- .../om/BaseCcPlaylistcontentsQuery.php | 640 --- .../propel/airtime/om/BaseCcPref.php | 905 ---- .../propel/airtime/om/BaseCcPrefPeer.php | 983 ---- .../propel/airtime/om/BaseCcPrefQuery.php | 320 -- .../propel/airtime/om/BaseCcSchedule.php | 1641 ------ .../propel/airtime/om/BaseCcSchedulePeer.php | 1410 ----- .../propel/airtime/om/BaseCcScheduleQuery.php | 645 --- .../airtime/om/BaseCcServiceRegister.php | 708 --- .../airtime/om/BaseCcServiceRegisterPeer.php | 735 --- .../airtime/om/BaseCcServiceRegisterQuery.php | 196 - .../propel/airtime/om/BaseCcSess.php | 949 ---- .../propel/airtime/om/BaseCcSessPeer.php | 979 ---- .../propel/airtime/om/BaseCcSessQuery.php | 334 -- .../propel/airtime/om/BaseCcShow.php | 1858 ------- .../propel/airtime/om/BaseCcShowDays.php | 1476 ------ .../propel/airtime/om/BaseCcShowDaysPeer.php | 1018 ---- .../propel/airtime/om/BaseCcShowDaysQuery.php | 565 -- .../propel/airtime/om/BaseCcShowHosts.php | 936 ---- .../propel/airtime/om/BaseCcShowHostsPeer.php | 1365 ----- .../airtime/om/BaseCcShowHostsQuery.php | 371 -- .../propel/airtime/om/BaseCcShowInstances.php | 2071 -------- .../airtime/om/BaseCcShowInstancesPeer.php | 1565 ------ .../airtime/om/BaseCcShowInstancesQuery.php | 867 ---- .../propel/airtime/om/BaseCcShowPeer.php | 796 --- .../propel/airtime/om/BaseCcShowQuery.php | 687 --- .../airtime/om/BaseCcShowRebroadcast.php | 957 ---- .../airtime/om/BaseCcShowRebroadcastPeer.php | 983 ---- .../airtime/om/BaseCcShowRebroadcastQuery.php | 329 -- .../propel/airtime/om/BaseCcShowSchedule.php | 905 ---- .../airtime/om/BaseCcShowSchedulePeer.php | 983 ---- .../airtime/om/BaseCcShowScheduleQuery.php | 338 -- .../propel/airtime/om/BaseCcSmemb.php | 891 ---- .../propel/airtime/om/BaseCcSmembPeer.php | 750 --- .../propel/airtime/om/BaseCcSmembQuery.php | 305 -- .../propel/airtime/om/BaseCcStreamSetting.php | 756 --- .../airtime/om/BaseCcStreamSettingPeer.php | 740 --- .../airtime/om/BaseCcStreamSettingQuery.php | 222 - .../propel/airtime/om/BaseCcSubjs.php | 2567 ---------- .../propel/airtime/om/BaseCcSubjsPeer.php | 804 --- .../propel/airtime/om/BaseCcSubjsQuery.php | 1022 ---- .../propel/airtime/om/BaseCcSubjsToken.php | 1005 ---- .../airtime/om/BaseCcSubjsTokenPeer.php | 988 ---- .../airtime/om/BaseCcSubjsTokenQuery.php | 355 -- .../propel/airtime/om/BaseCcTrans.php | 1903 ------- .../propel/airtime/om/BaseCcTransPeer.php | 849 --- .../propel/airtime/om/BaseCcTransQuery.php | 826 --- .../propel/classmap-airtime-conf.php | 151 - .../upgrades/airtime-2.1.1/DbUpgrade.php | 24 - .../airtime-2.1.1/airtime-upgrade.php | 8 - .../upgrades/airtime-2.1.1/data/upgrade.sql | 2 - .../upgrades/airtime-2.1.2/DbUpgrade.php | 24 - .../airtime-2.1.2/airtime-upgrade.php | 8 - .../upgrades/airtime-2.1.2/data/upgrade.sql | 2 - .../upgrades/airtime-2.1.3/DbUpgrade.php | 24 - .../airtime-2.1.3/airtime-upgrade.php | 8 - .../upgrades/airtime-2.1.3/data/upgrade.sql | 4 - 555 files changed, 2 insertions(+), 213625 deletions(-) delete mode 100644 install_minimal/upgrades/airtime-2.0.1/UpgradeCommon.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/airtime-monit.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/airtime.conf.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/api_client.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/liquidsoap.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/media-monitor.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/Common.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcAccessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcBackupTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcCountryTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcFilesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcLoginAttemptsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcMusicDirsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPermsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistcontentsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPrefTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcServiceRegisterTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowDaysTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowHostsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowInstancesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowRebroadcastTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSmembTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcStreamSettingTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSubjsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcTransTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/Common.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/propel/classmap-airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.0.1/pypo.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.1/recorder.cfg.201 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/UpgradeCommon.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/airtime-monit.cfg.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/airtime.conf.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/api_client.cfg.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/liquidsoap.cfg.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/media-monitor.cfg.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/Common.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcAccessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcBackupTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcCountryTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcFilesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcLoginAttemptsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcMusicDirsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPermsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistcontentsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPrefTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcServiceRegisterTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowDaysTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowHostsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowInstancesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowRebroadcastTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSmembTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcStreamSettingTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSubjsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcTransTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/Common.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/propel/classmap-airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.0.2/pypo.cfg.202 delete mode 100644 install_minimal/upgrades/airtime-2.0.3/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.0.3/monit-airtime-generic.cfg delete mode 100644 install_minimal/upgrades/airtime-2.1.0/ConfFileUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/DbUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/MiscUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/UpgradeCommon.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120402103944.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120403143635.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120405114454.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120410104441.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120410143340.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120411102907.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/common/migrations.xml delete mode 100644 install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql delete mode 100644 install_minimal/upgrades/airtime-2.1.0/etc/airtime.conf.210 delete mode 100644 install_minimal/upgrades/airtime-2.1.0/etc/api_client.cfg.210 delete mode 100644 install_minimal/upgrades/airtime-2.1.0/etc/liquidsoap.cfg.210 delete mode 100644 install_minimal/upgrades/airtime-2.1.0/etc/media-monitor.cfg.210 delete mode 100644 install_minimal/upgrades/airtime-2.1.0/etc/pypo.cfg.210 delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjsToken.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjsTokenPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcSubjsTokenQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/CcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/Common.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcAccessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcBackupTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcCountryTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcFilesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcLoginAttemptsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcMusicDirsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcPermsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcPlaylistTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcPlaylistcontentsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcPrefTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcServiceRegisterTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcSessTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowDaysTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowHostsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowInstancesTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowRebroadcastTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowScheduleTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcShowTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcSmembTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcStreamSettingTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcSubjsTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcSubjsTokenTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/map/CcTransTableMap.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcAccess.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcAccessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcAccessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcBackup.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcBackupPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcBackupQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcCountry.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcCountryPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcCountryQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcFiles.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcFilesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcFilesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcLoginAttempts.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcLoginAttemptsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcLoginAttemptsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcMusicDirs.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcMusicDirsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcMusicDirsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPerms.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPermsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPermsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylist.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylistPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylistQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylistcontents.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylistcontentsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPlaylistcontentsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPref.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPrefPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcPrefQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcServiceRegister.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcServiceRegisterPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcServiceRegisterQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSess.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSessPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSessQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShow.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowDays.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowDaysPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowDaysQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowHosts.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowHostsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowHostsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowInstances.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowInstancesPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowInstancesQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowRebroadcast.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowRebroadcastPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowRebroadcastQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowSchedule.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowSchedulePeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcShowScheduleQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSmemb.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSmembPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSmembQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcStreamSetting.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcStreamSettingPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcStreamSettingQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjs.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjsPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjsQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjsToken.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjsTokenPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcSubjsTokenQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcTrans.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcTransPeer.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/airtime/om/BaseCcTransQuery.php delete mode 100644 install_minimal/upgrades/airtime-2.1.0/propel/classmap-airtime-conf.php delete mode 100644 install_minimal/upgrades/airtime-2.1.1/DbUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.1/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.1/data/upgrade.sql delete mode 100644 install_minimal/upgrades/airtime-2.1.2/DbUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.2/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.2/data/upgrade.sql delete mode 100644 install_minimal/upgrades/airtime-2.1.3/DbUpgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.3/airtime-upgrade.php delete mode 100644 install_minimal/upgrades/airtime-2.1.3/data/upgrade.sql diff --git a/install_minimal/include/airtime-upgrade.php b/install_minimal/include/airtime-upgrade.php index cfa2093dc..ee33d0662 100644 --- a/install_minimal/include/airtime-upgrade.php +++ b/install_minimal/include/airtime-upgrade.php @@ -64,41 +64,9 @@ $version = substr($version, 0, 5); $SCRIPTPATH = __DIR__; -if (strcmp($version, "2.0.0") < 0) { - echo "Unsupported Airtime version. You must upgrade from at least Airtime 2.0.0.".PHP_EOL; - exit(1); -} -if (strcmp($version, "2.0.1") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.0.1/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.0.2") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.0.2/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.0.3") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.0.3/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.1.0") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.0/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.1.1") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.1.2") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php"); - pause(); -} -if (strcmp($version, "2.1.3") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.3/airtime-upgrade.php"); - pause(); -} if (strcmp($version, "2.2.0") < 0) { - passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.0/airtime-upgrade.php"); - pause(); + echo "Unsupported Airtime version. You must upgrade from at least Airtime 2.2.0.".PHP_EOL; + exit(1); } if (strcmp($version, "2.2.1") < 0) { passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.2.1/airtime-upgrade.php"); diff --git a/install_minimal/upgrades/airtime-2.0.1/UpgradeCommon.php b/install_minimal/upgrades/airtime-2.0.1/UpgradeCommon.php deleted file mode 100644 index 59a2ef0fc..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/UpgradeCommon.php +++ /dev/null @@ -1,256 +0,0 @@ -fetchColumn(); - - date_default_timezone_set($timezone); - } - - public static function connectToDatabase($p_exitOnError = true) - { - try { - $con = Propel::getConnection(); - } catch (Exception $e) { - echo $e->getMessage().PHP_EOL; - echo "Database connection problem.".PHP_EOL; - echo "Check if database exists with corresponding permissions.".PHP_EOL; - if ($p_exitOnError) { - exit(1); - } - return false; - } - return true; - } - - - public static function DbTableExists($p_name) - { - $con = Propel::getConnection(); - try { - $sql = "SELECT * FROM ".$p_name." LIMIT 1"; - $con->query($sql); - } catch (PDOException $e){ - return false; - } - return true; - } - - private static function GetAirtimeSrcDir() - { - return __DIR__."/../../../airtime_mvc"; - } - - public static function MigrateTablesToVersion($dir, $version) - { - echo "Upgrading database, may take several minutes, please wait".PHP_EOL; - - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/../../DoctrineMigrations/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction migrations:migrate $version"; - system($command); - } - - public static function BypassMigrations($dir, $version) - { - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/../../DoctrineMigrations/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction --add migrations:version $version"; - system($command); - } - - public static function upgradeConfigFiles(){ - - $configFiles = array(UpgradeCommon::CONF_FILE_AIRTIME, - UpgradeCommon::CONF_FILE_PYPO, - UpgradeCommon::CONF_FILE_RECORDER, - UpgradeCommon::CONF_FILE_LIQUIDSOAP, - UpgradeCommon::CONF_FILE_MEDIAMONITOR, - UpgradeCommon::CONF_FILE_API_CLIENT); - - // Backup the config files - $suffix = date("Ymdhis")."-".UpgradeCommon::VERSION_NUMBER; - foreach ($configFiles as $conf) { - // do not back up monit cfg - if (file_exists($conf)) { - echo "Backing up $conf to $conf$suffix.bak".PHP_EOL; - //copy($conf, $conf.$suffix.".bak"); - exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes - } - } - - self::CreateIniFiles(UpgradeCommon::CONF_BACKUP_SUFFIX); - self::MergeConfigFiles($configFiles, $suffix); - } - - /** - * This function creates the /etc/airtime configuration folder - * and copies the default config files to it. - */ - public static function CreateIniFiles($suffix) - { - if (!file_exists("/etc/airtime/")){ - if (!mkdir("/etc/airtime/", 0755, true)){ - echo "Could not create /etc/airtime/ directory. Exiting."; - exit(1); - } - } - - if (!copy(__DIR__."/airtime.conf.$suffix", self::CONF_FILE_AIRTIME)){ - echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/pypo.cfg.$suffix", self::CONF_FILE_PYPO)){ - echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/recorder.cfg.$suffix", self::CONF_FILE_RECORDER)){ - echo "Could not copy recorder.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/media-monitor.cfg.$suffix", self::CONF_FILE_MEDIAMONITOR)){ - echo "Could not copy meadia-monitor.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/api_client.cfg.$suffix", self::CONF_FILE_API_CLIENT)){ - echo "Could not copy api_client.cfg to /etc/monit/conf.d/. Exiting."; - exit(1); - } - } - - private static function MergeConfigFiles($configFiles, $suffix) { - foreach ($configFiles as $conf) { - // we want to use new liquidsoap.cfg so don't merge - // also for monit - if( $conf == self::CONF_FILE_LIQUIDSOAP){ - continue; - } - if (file_exists("$conf$suffix.bak")) { - - if($conf === self::CONF_FILE_AIRTIME) { - // Parse with sections - $newSettings = parse_ini_file($conf, true); - $oldSettings = parse_ini_file("$conf$suffix.bak", true); - } - else { - $newSettings = self::ReadPythonConfig($conf); - $oldSettings = self::ReadPythonConfig("$conf$suffix.bak"); - } - - $settings = array_keys($newSettings); - - foreach($settings as $section) { - if(isset($oldSettings[$section])) { - if(is_array($oldSettings[$section])) { - $sectionKeys = array_keys($newSettings[$section]); - foreach($sectionKeys as $sectionKey) { - // skip airtim_dir as we want to use new value - if($sectionKey != "airtime_dir"){ - if(isset($oldSettings[$section][$sectionKey])) { - self::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]); - } - } - } - } - else { - self::UpdateIniValue($conf, $section, $oldSettings[$section]); - } - } - } - } - } - } - - private static function ReadPythonConfig($p_filename) - { - $values = array(); - - $fh = fopen($p_filename, 'r'); - - while(!feof($fh)){ - $line = fgets($fh); - if(substr(trim($line), 0, 1) == '#' || trim($line) == ""){ - continue; - }else{ - $info = explode('=', $line, 2); - $values[trim($info[0])] = trim($info[1]); - } - } - - return $values; - } - - /** - * This function updates an INI style config file. - * - * A property and the value the property should be changed to are - * supplied. If the property is not found, then no changes are made. - * - * @param string $p_filename - * The path the to the file. - * @param string $p_property - * The property to look for in order to change its value. - * @param string $p_value - * The value the property should be changed to. - * - */ - private static function UpdateIniValue($p_filename, $p_property, $p_value) - { - $lines = file($p_filename); - $n=count($lines); - foreach ($lines as &$line) { - if ($line[0] != "#"){ - $key_value = explode("=", $line); - $key = trim($key_value[0]); - - if ($key == $p_property){ - $line = "$p_property = $p_value".PHP_EOL; - } - } - } - - $fp=fopen($p_filename, 'w'); - for($i=0; $i<$n; $i++){ - fwrite($fp, $lines[$i]); - } - fclose($fp); - } - - public static function queryDb($p_sql){ - $con = Propel::getConnection(); - - try { - $result = $con->query($p_sql); - } catch (Exception $e) { - echo "Error executing $p_sql. Exiting."; - exit(1); - } - - return $result; - } -} diff --git a/install_minimal/upgrades/airtime-2.0.1/airtime-monit.cfg.201 b/install_minimal/upgrades/airtime-2.0.1/airtime-monit.cfg.201 deleted file mode 100644 index ba4f0878d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/airtime-monit.cfg.201 +++ /dev/null @@ -1,24 +0,0 @@ - set daemon 10 # Poll at 10 second intervals - #set logfile syslog facility log_daemon - set logfile /var/log/monit.log - - set httpd port 2812 and use address 127.0.0.1 - allow localhost - allow admin:monit - - check process airtime-playout - with pidfile "/var/run/airtime-playout.pid" - start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds - stop program = "/etc/init.d/airtime-playout stop" - check process airtime-liquidsoap - with pidfile "/var/run/airtime-liquidsoap.pid" - start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds - stop program = "/etc/init.d/airtime-playout stop" - check process airtime-media-monitor - with pidfile "/var/run/airtime-media-monitor.pid" - start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds - stop program = "/etc/init.d/airtime-media-monitor stop" - check process airtime-show-recorder - with pidfile "/var/run/airtime-show-recorder.pid" - start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds - stop program = "/etc/init.d/airtime-show-recorder stop" diff --git a/install_minimal/upgrades/airtime-2.0.1/airtime-upgrade.php b/install_minimal/upgrades/airtime-2.0.1/airtime-upgrade.php deleted file mode 100644 index 5bce72315..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/airtime-upgrade.php +++ /dev/null @@ -1,83 +0,0 @@ -.log" -#log_level = 3 - -########################################### -# Icecast Stream settings # -########################################### -s1_host = "127.0.0.1" -s2_host = "127.0.0.1" -s3_host = "127.0.0.1" -s1_port = 8000 -s2_port = 8000 -s3_port = 8000 -s1_user = "" -s2_user = "" -s3_user = "" -s1_pass = "hackme" -s2_pass = "hackme" -s3_pass = "hackme" - -# Icecast mountpoint names -s1_mount = "airtime_128.ogg" -s2_mount = "airtime_128.ogg" -s3_mount = "airtime_160.mp3" - -# Webstream metadata settings -s1_url = "http://airtime.sourcefabric.org" -s2_url = "http://airtime.sourcefabric.org" -s3_url = "http://airtime.sourcefabric.org" -s1_description = "Airtime Radio! stream1" -s2_description = "Airtime Radio! stream2" -s3_description = "Airtime Radio! stream3" -s1_genre = "genre" -s2_genre = "genre" -s3_genre = "genre" - -# Audio stream metadata for vorbis/ogg is disabled by default -# due to a number of client media players that disconnect -# when the metadata changes to a new track. Some versions of -# mplayer and VLC have this problem. Enable this option at your -# own risk! -icecast_vorbis_metadata = false diff --git a/install_minimal/upgrades/airtime-2.0.1/media-monitor.cfg.201 b/install_minimal/upgrades/airtime-2.0.1/media-monitor.cfg.201 deleted file mode 100644 index 44819833b..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/media-monitor.cfg.201 +++ /dev/null @@ -1,22 +0,0 @@ -api_client = "airtime" - -# where the binary files live -bin_dir = '/usr/lib/airtime/media-monitor' - -# where the logging files live -log_dir = '/var/log/airtime/media-monitor' - - -############################################ -# RabbitMQ settings # -############################################ -rabbitmq_host = 'localhost' -rabbitmq_user = 'guest' -rabbitmq_password = 'guest' -rabbitmq_vhost = '/' - -############################################ -# Media-Monitor preferences # -############################################ -check_filesystem_events = 5 #how long to queue up events performed on the files themselves. -check_airtime_events = 30 #how long to queue metadata input from airtime. diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime-conf.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime-conf.php deleted file mode 100644 index a25701479..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime-conf.php +++ /dev/null @@ -1,28 +0,0 @@ - - array ( - 'airtime' => - array ( - 'adapter' => 'pgsql', - 'connection' => - array ( - 'dsn' => "pgsql:host=$dbhost;port=5432;dbname=$dbname;user=$dbuser;password=$dbpass", - ), - ), - 'default' => 'airtime', - ), - 'generator_version' => '1.5.2', -); -$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php'); -return $conf; diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccess.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccess.php deleted file mode 100644 index 2b3d4443d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcAccess.php +++ /dev/null @@ -1,18 +0,0 @@ -length; - } - - public function setDbLength($time) - { - $this->length = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; - return Common::setTimeInSub($this, 'LENGTH', $time); - } - - -} // CcFiles diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFilesPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFilesPeer.php deleted file mode 100644 index 0e2fbbe86..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcFilesPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - public function computeLength() - { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME); - - $sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length' - . ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME - . ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1'; - - $stmt = $con->prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - -} // CcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistPeer.php deleted file mode 100644 index 4f7c82791..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -fadein; - } - - public function setDbFadein($time) - { - $this->fadein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - Common::setTimeInSub($this, 'FADEIN', $time); - } - - public function getDbFadeout() - { - return $this->fadeout; - } - - public function setDbFadeout($time) - { - $this->fadeout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - Common::setTimeInSub($this, 'FADEOUT', $time); - } - - public function getDbCuein() - { - return $this->cuein; - } - - public function setDbCuein($time) - { - $this->cuein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - Common::setTimeInSub($this, 'CUEIN', $time); - } - - public function getDbCueout() - { - return $this->cueout; - } - - public function setDbCueout($time) - { - $this->cueout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - Common::setTimeInSub($this, 'CUEOUT', $time); - } - - public function getDbCliplength() - { - return $this->cliplength; - } - - public function setDbCliplength($time) - { - $this->cliplength = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - Common::setTimeInSub($this, 'CLIPLENGTH', $time); - } - - - - -} // CcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontentsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontentsPeer.php deleted file mode 100644 index 00210575b..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/CcPlaylistcontentsPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -prepare($sql); - $stmt->bindValue(':f1', $time); - $stmt->bindValue(':p1', $row->getDbId()); - $stmt->execute(); - } -} diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcAccessTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcAccessTableMap.php deleted file mode 100644 index 5b0584f3f..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcAccessTableMap.php +++ /dev/null @@ -1,61 +0,0 @@ -setName('cc_access'); - $this->setPhpName('CcAccess'); - $this->setClassname('CcAccess'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_access_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null); - $this->addColumn('TOKEN', 'Token', 'BIGINT', false, null, null); - $this->addColumn('CHSUM', 'Chsum', 'CHAR', true, 32, ''); - $this->addColumn('EXT', 'Ext', 'VARCHAR', true, 128, ''); - $this->addColumn('TYPE', 'Type', 'VARCHAR', true, 20, ''); - $this->addColumn('PARENT', 'Parent', 'BIGINT', false, null, null); - $this->addForeignKey('OWNER', 'Owner', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), null, null); - } // buildRelations() - -} // CcAccessTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcBackupTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcBackupTableMap.php deleted file mode 100644 index 35ea58159..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcBackupTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_backup'); - $this->setPhpName('CcBackup'); - $this->setClassname('CcBackup'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('TOKEN', 'Token', 'VARCHAR', true, 64, null); - $this->addColumn('SESSIONID', 'Sessionid', 'VARCHAR', true, 64, null); - $this->addColumn('STATUS', 'Status', 'VARCHAR', true, 32, null); - $this->addColumn('FROMTIME', 'Fromtime', 'TIMESTAMP', true, null, null); - $this->addColumn('TOTIME', 'Totime', 'TIMESTAMP', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcBackupTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcCountryTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcCountryTableMap.php deleted file mode 100644 index b839d0359..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcCountryTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_country'); - $this->setPhpName('CcCountry'); - $this->setClassname('CcCountry'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('ISOCODE', 'DbIsoCode', 'CHAR', true, 3, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcCountryTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcFilesTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcFilesTableMap.php deleted file mode 100644 index 38d2e3955..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcFilesTableMap.php +++ /dev/null @@ -1,115 +0,0 @@ -setName('cc_files'); - $this->setPhpName('CcFiles'); - $this->setClassname('CcFiles'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_files_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('GUNID', 'DbGunid', 'CHAR', true, 32, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('MIME', 'DbMime', 'VARCHAR', true, 255, ''); - $this->addColumn('FTYPE', 'DbFtype', 'VARCHAR', true, 128, ''); - $this->addForeignKey('DIRECTORY', 'DbDirectory', 'INTEGER', 'cc_music_dirs', 'ID', false, null, null); - $this->addColumn('FILEPATH', 'DbFilepath', 'LONGVARCHAR', false, null, ''); - $this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty'); - $this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0); - $this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null); - $this->addColumn('MD5', 'DbMd5', 'CHAR', false, 32, null); - $this->addColumn('TRACK_TITLE', 'DbTrackTitle', 'VARCHAR', false, 512, null); - $this->addColumn('ARTIST_NAME', 'DbArtistName', 'VARCHAR', false, 512, null); - $this->addColumn('BIT_RATE', 'DbBitRate', 'VARCHAR', false, 32, null); - $this->addColumn('SAMPLE_RATE', 'DbSampleRate', 'VARCHAR', false, 32, null); - $this->addColumn('FORMAT', 'DbFormat', 'VARCHAR', false, 128, null); - $this->addColumn('LENGTH', 'DbLength', 'TIME', false, null, null); - $this->addColumn('ALBUM_TITLE', 'DbAlbumTitle', 'VARCHAR', false, 512, null); - $this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 64, null); - $this->addColumn('COMMENTS', 'DbComments', 'LONGVARCHAR', false, null, null); - $this->addColumn('YEAR', 'DbYear', 'VARCHAR', false, 16, null); - $this->addColumn('TRACK_NUMBER', 'DbTrackNumber', 'INTEGER', false, null, null); - $this->addColumn('CHANNELS', 'DbChannels', 'INTEGER', false, null, null); - $this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 1024, null); - $this->addColumn('BPM', 'DbBpm', 'VARCHAR', false, 8, null); - $this->addColumn('RATING', 'DbRating', 'VARCHAR', false, 8, null); - $this->addColumn('ENCODED_BY', 'DbEncodedBy', 'VARCHAR', false, 255, null); - $this->addColumn('DISC_NUMBER', 'DbDiscNumber', 'VARCHAR', false, 8, null); - $this->addColumn('MOOD', 'DbMood', 'VARCHAR', false, 64, null); - $this->addColumn('LABEL', 'DbLabel', 'VARCHAR', false, 512, null); - $this->addColumn('COMPOSER', 'DbComposer', 'VARCHAR', false, 512, null); - $this->addColumn('ENCODER', 'DbEncoder', 'VARCHAR', false, 64, null); - $this->addColumn('CHECKSUM', 'DbChecksum', 'VARCHAR', false, 256, null); - $this->addColumn('LYRICS', 'DbLyrics', 'LONGVARCHAR', false, null, null); - $this->addColumn('ORCHESTRA', 'DbOrchestra', 'VARCHAR', false, 512, null); - $this->addColumn('CONDUCTOR', 'DbConductor', 'VARCHAR', false, 512, null); - $this->addColumn('LYRICIST', 'DbLyricist', 'VARCHAR', false, 512, null); - $this->addColumn('ORIGINAL_LYRICIST', 'DbOriginalLyricist', 'VARCHAR', false, 512, null); - $this->addColumn('RADIO_STATION_NAME', 'DbRadioStationName', 'VARCHAR', false, 512, null); - $this->addColumn('INFO_URL', 'DbInfoUrl', 'VARCHAR', false, 512, null); - $this->addColumn('ARTIST_URL', 'DbArtistUrl', 'VARCHAR', false, 512, null); - $this->addColumn('AUDIO_SOURCE_URL', 'DbAudioSourceUrl', 'VARCHAR', false, 512, null); - $this->addColumn('RADIO_STATION_URL', 'DbRadioStationUrl', 'VARCHAR', false, 512, null); - $this->addColumn('BUY_THIS_URL', 'DbBuyThisUrl', 'VARCHAR', false, 512, null); - $this->addColumn('ISRC_NUMBER', 'DbIsrcNumber', 'VARCHAR', false, 512, null); - $this->addColumn('CATALOG_NUMBER', 'DbCatalogNumber', 'VARCHAR', false, 512, null); - $this->addColumn('ORIGINAL_ARTIST', 'DbOriginalArtist', 'VARCHAR', false, 512, null); - $this->addColumn('COPYRIGHT', 'DbCopyright', 'VARCHAR', false, 512, null); - $this->addColumn('REPORT_DATETIME', 'DbReportDatetime', 'VARCHAR', false, 32, null); - $this->addColumn('REPORT_LOCATION', 'DbReportLocation', 'VARCHAR', false, 512, null); - $this->addColumn('REPORT_ORGANIZATION', 'DbReportOrganization', 'VARCHAR', false, 512, null); - $this->addColumn('SUBJECT', 'DbSubject', 'VARCHAR', false, 512, null); - $this->addColumn('CONTRIBUTOR', 'DbContributor', 'VARCHAR', false, 512, null); - $this->addColumn('LANGUAGE', 'DbLanguage', 'VARCHAR', false, 512, null); - $this->addColumn('SOUNDCLOUD_ID', 'DbSoundcloudId', 'INTEGER', false, null, null); - $this->addColumn('SOUNDCLOUD_ERROR_CODE', 'DbSoundcloudErrorCode', 'INTEGER', false, null, null); - $this->addColumn('SOUNDCLOUD_ERROR_MSG', 'DbSoundcloudErrorMsg', 'VARCHAR', false, 512, null); - $this->addColumn('SOUNDCLOUD_LINK_TO_FILE', 'DbSoundcloudLinkToFile', 'VARCHAR', false, 4096, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null); - $this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), 'CASCADE', null); - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcFilesTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcLoginAttemptsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcLoginAttemptsTableMap.php deleted file mode 100644 index 32ce73743..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcLoginAttemptsTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_login_attempts'); - $this->setPhpName('CcLoginAttempts'); - $this->setClassname('CcLoginAttempts'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('IP', 'DbIP', 'VARCHAR', true, 32, null); - $this->addColumn('ATTEMPTS', 'DbAttempts', 'INTEGER', false, null, 0); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcLoginAttemptsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcMusicDirsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcMusicDirsTableMap.php deleted file mode 100644 index 022ef658c..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcMusicDirsTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_music_dirs'); - $this->setPhpName('CcMusicDirs'); - $this->setClassname('CcMusicDirs'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_music_dirs_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('DIRECTORY', 'Directory', 'LONGVARCHAR', false, null, null); - $this->addColumn('TYPE', 'Type', 'VARCHAR', false, 255, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'directory', ), 'CASCADE', null); - } // buildRelations() - -} // CcMusicDirsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPermsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPermsTableMap.php deleted file mode 100644 index 481d17c96..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPermsTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_perms'); - $this->setPhpName('CcPerms'); - $this->setClassname('CcPerms'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('PERMID', 'Permid', 'INTEGER', true, null, null); - $this->addForeignKey('SUBJ', 'Subj', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('ACTION', 'Action', 'VARCHAR', false, 20, null); - $this->addColumn('OBJ', 'Obj', 'INTEGER', false, null, null); - $this->addColumn('TYPE', 'Type', 'CHAR', false, 1, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subj' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPermsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistTableMap.php deleted file mode 100644 index e4ad1bbd5..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistTableMap.php +++ /dev/null @@ -1,61 +0,0 @@ -setName('cc_playlist'); - $this->setPhpName('CcPlaylist'); - $this->setClassname('CcPlaylist'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_playlist_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty'); - $this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0); - $this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null); - $this->addColumn('CREATOR', 'DbCreator', 'VARCHAR', false, 32, null); - $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null); - $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPlaylistTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistcontentsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistcontentsTableMap.php deleted file mode 100644 index b00f39ade..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPlaylistcontentsTableMap.php +++ /dev/null @@ -1,62 +0,0 @@ -setName('cc_playlistcontents'); - $this->setPhpName('CcPlaylistcontents'); - $this->setClassname('CcPlaylistcontents'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_playlistcontents_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); - $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); - $this->addColumn('CLIPLENGTH', 'DbCliplength', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUEIN', 'DbCuein', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUEOUT', 'DbCueout', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADEIN', 'DbFadein', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADEOUT', 'DbFadeout', 'TIME', false, null, '00:00:00'); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPlaylistcontentsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPrefTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPrefTableMap.php deleted file mode 100644 index 1d22a122d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcPrefTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_pref'); - $this->setPhpName('CcPref'); - $this->setClassname('CcPref'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_pref_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addForeignKey('SUBJID', 'Subjid', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('KEYSTR', 'Keystr', 'VARCHAR', false, 255, null); - $this->addColumn('VALSTR', 'Valstr', 'LONGVARCHAR', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjid' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPrefTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcScheduleTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcScheduleTableMap.php deleted file mode 100644 index 12fa8d712..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcScheduleTableMap.php +++ /dev/null @@ -1,80 +0,0 @@ -setName('cc_schedule'); - $this->setPhpName('CcSchedule'); - $this->setClassname('CcSchedule'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_schedule_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', false, null, null); - $this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null); - $this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null); - $this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', false, null, null); - $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('CLIP_LENGTH', 'DbClipLength', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUE_IN', 'DbCueIn', '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('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false); - $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'aggregate_column_relation' => array('foreign_table' => 'cc_show_instances', 'update_method' => 'updateDbTimeFilled', ), - ); - } // getBehaviors() - -} // CcScheduleTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcServiceRegisterTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcServiceRegisterTableMap.php deleted file mode 100644 index f4eae5e60..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcServiceRegisterTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_service_register'); - $this->setPhpName('CcServiceRegister'); - $this->setClassname('CcServiceRegister'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('NAME', 'DbName', 'VARCHAR', true, 32, null); - $this->addColumn('IP', 'DbIp', 'VARCHAR', true, 18, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcServiceRegisterTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSessTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSessTableMap.php deleted file mode 100644 index 66605b4eb..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSessTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_sess'); - $this->setPhpName('CcSess'); - $this->setClassname('CcSess'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('SESSID', 'Sessid', 'CHAR', true, 32, null); - $this->addForeignKey('USERID', 'Userid', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('LOGIN', 'Login', 'VARCHAR', false, 255, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('userid' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcSessTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowDaysTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowDaysTableMap.php deleted file mode 100644 index 7d6b8a10e..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowDaysTableMap.php +++ /dev/null @@ -1,63 +0,0 @@ -setName('cc_show_days'); - $this->setPhpName('CcShowDays'); - $this->setClassname('CcShowDays'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_days_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null); - $this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null); - $this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null); - $this->addColumn('TIMEZONE', 'DbTimezone', 'VARCHAR', true, 255, null); - $this->addColumn('DURATION', 'DbDuration', 'VARCHAR', true, 255, null); - $this->addColumn('DAY', 'DbDay', 'TINYINT', false, 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->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0); - // 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); - } // buildRelations() - -} // CcShowDaysTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowHostsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowHostsTableMap.php deleted file mode 100644 index c76efdbd3..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowHostsTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_hosts'); - $this->setPhpName('CcShowHosts'); - $this->setClassname('CcShowHosts'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_hosts_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('SHOW_ID', 'DbShow', 'INTEGER', 'cc_show', 'ID', true, null, null); - $this->addForeignKey('SUBJS_ID', 'DbHost', 'INTEGER', 'cc_subjs', '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('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjs_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowHostsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowInstancesTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowInstancesTableMap.php deleted file mode 100644 index 75e7da2c7..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowInstancesTableMap.php +++ /dev/null @@ -1,79 +0,0 @@ -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); - $this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0); - $this->addColumn('REBROADCAST', 'DbRebroadcast', 'TINYINT', false, null, 0); - $this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); - $this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null); - $this->addColumn('MODIFIED_INSTANCE', 'DbModifiedInstance', 'BOOLEAN', true, null, false); - // 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('CcShowInstancesRelatedByDbOriginalShow', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcShowInstancesRelatedByDbId', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); - $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'aggregate_column' => array('name' => 'time_filled', 'expression' => 'SUM(clip_length)', 'foreign_table' => 'cc_schedule', ), - ); - } // getBehaviors() - -} // CcShowInstancesTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowRebroadcastTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowRebroadcastTableMap.php deleted file mode 100644 index 60a9ba980..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowRebroadcastTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_rebroadcast'); - $this->setPhpName('CcShowRebroadcast'); - $this->setClassname('CcShowRebroadcast'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_rebroadcast_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('DAY_OFFSET', 'DbDayOffset', 'VARCHAR', true, 255, null); - $this->addColumn('START_TIME', 'DbStartTime', 'TIME', 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); - } // buildRelations() - -} // CcShowRebroadcastTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowScheduleTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowScheduleTableMap.php deleted file mode 100644 index 96528559c..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowScheduleTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_schedule'); - $this->setPhpName('CcShowSchedule'); - $this->setClassname('CcShowSchedule'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_schedule_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null); - $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); - $this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowScheduleTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowTableMap.php deleted file mode 100644 index b558b6e93..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcShowTableMap.php +++ /dev/null @@ -1,62 +0,0 @@ -setName('cc_show'); - $this->setPhpName('CcShow'); - $this->setClassname('CcShow'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 255, ''); - $this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 255, ''); - $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); - $this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null); - $this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - 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('CcShowRebroadcast', 'CcShowRebroadcast', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); - $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSmembTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSmembTableMap.php deleted file mode 100644 index 236cdd016..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSmembTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_smemb'); - $this->setPhpName('CcSmemb'); - $this->setClassname('CcSmemb'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('UID', 'Uid', 'INTEGER', true, null, 0); - $this->addColumn('GID', 'Gid', 'INTEGER', true, null, 0); - $this->addColumn('LEVEL', 'Level', 'INTEGER', true, null, 0); - $this->addColumn('MID', 'Mid', 'INTEGER', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcSmembTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcStreamSettingTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcStreamSettingTableMap.php deleted file mode 100644 index d401ce096..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcStreamSettingTableMap.php +++ /dev/null @@ -1,53 +0,0 @@ -setName('cc_stream_setting'); - $this->setPhpName('CcStreamSetting'); - $this->setClassname('CcStreamSetting'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('KEYNAME', 'DbKeyName', 'VARCHAR', true, 64, null); - $this->addColumn('VALUE', 'DbValue', 'VARCHAR', false, 255, null); - $this->addColumn('TYPE', 'DbType', 'VARCHAR', true, 16, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcStreamSettingTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSubjsTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSubjsTableMap.php deleted file mode 100644 index 49e883968..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcSubjsTableMap.php +++ /dev/null @@ -1,70 +0,0 @@ -setName('cc_subjs'); - $this->setPhpName('CcSubjs'); - $this->setClassname('CcSubjs'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_subjs_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, ''); - $this->addColumn('PASS', 'DbPass', 'VARCHAR', true, 255, ''); - $this->addColumn('TYPE', 'DbType', 'CHAR', true, 1, 'U'); - $this->addColumn('FIRST_NAME', 'DbFirstName', 'VARCHAR', true, 255, ''); - $this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, ''); - $this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null); - $this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null); - $this->addColumn('SKYPE_CONTACT', 'DbSkypeContact', 'VARCHAR', false, 255, null); - $this->addColumn('JABBER_CONTACT', 'DbJabberContact', 'VARCHAR', false, 255, null); - $this->addColumn('EMAIL', 'DbEmail', 'VARCHAR', false, 255, null); - $this->addColumn('LOGIN_ATTEMPTS', 'DbLoginAttempts', 'INTEGER', false, null, 0); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcAccess', 'CcAccess', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), null, null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null); - $this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null); - $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null); - $this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null); - $this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null); - } // buildRelations() - -} // CcSubjsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcTransTableMap.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcTransTableMap.php deleted file mode 100644 index 4c5d35e1a..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/map/CcTransTableMap.php +++ /dev/null @@ -1,75 +0,0 @@ -setName('cc_trans'); - $this->setPhpName('CcTrans'); - $this->setClassname('CcTrans'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_trans_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('TRTOK', 'Trtok', 'CHAR', true, 16, null); - $this->addColumn('DIRECTION', 'Direction', 'VARCHAR', true, 128, null); - $this->addColumn('STATE', 'State', 'VARCHAR', true, 128, null); - $this->addColumn('TRTYPE', 'Trtype', 'VARCHAR', true, 128, null); - $this->addColumn('LOCK', 'Lock', 'CHAR', true, 1, 'N'); - $this->addColumn('TARGET', 'Target', 'VARCHAR', false, 255, null); - $this->addColumn('RTRTOK', 'Rtrtok', 'CHAR', false, 16, null); - $this->addColumn('MDTRTOK', 'Mdtrtok', 'CHAR', false, 16, null); - $this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null); - $this->addColumn('PDTOKEN', 'Pdtoken', 'BIGINT', false, null, null); - $this->addColumn('URL', 'Url', 'VARCHAR', false, 255, null); - $this->addColumn('LOCALFILE', 'Localfile', 'VARCHAR', false, 255, null); - $this->addColumn('FNAME', 'Fname', 'VARCHAR', false, 255, null); - $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); - $this->addColumn('EXPECTEDSUM', 'Expectedsum', 'CHAR', false, 32, null); - $this->addColumn('REALSUM', 'Realsum', 'CHAR', false, 32, null); - $this->addColumn('EXPECTEDSIZE', 'Expectedsize', 'INTEGER', false, null, null); - $this->addColumn('REALSIZE', 'Realsize', 'INTEGER', false, null, null); - $this->addColumn('UID', 'Uid', 'INTEGER', false, null, null); - $this->addColumn('ERRMSG', 'Errmsg', 'VARCHAR', false, 255, null); - $this->addColumn('JOBPID', 'Jobpid', 'INTEGER', false, null, null); - $this->addColumn('START', 'Start', 'TIMESTAMP', false, null, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcTransTableMap diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccess.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccess.php deleted file mode 100644 index 8f2de9dca..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccess.php +++ /dev/null @@ -1,1236 +0,0 @@ -chsum = ''; - $this->ext = ''; - $this->type = ''; - } - - /** - * Initializes internal state of BaseCcAccess object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getGunid() - { - return $this->gunid; - } - - /** - * Get the [token] column value. - * - * @return string - */ - public function getToken() - { - return $this->token; - } - - /** - * Get the [chsum] column value. - * - * @return string - */ - public function getChsum() - { - return $this->chsum; - } - - /** - * Get the [ext] column value. - * - * @return string - */ - public function getExt() - { - return $this->ext; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Get the [parent] column value. - * - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Get the [owner] column value. - * - * @return int - */ - public function getOwner() - { - return $this->owner; - } - - /** - * Get the [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcAccessPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcAccessPeer::GUNID; - } - - return $this; - } // setGunid() - - /** - * Set the value of [token] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setToken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->token !== $v) { - $this->token = $v; - $this->modifiedColumns[] = CcAccessPeer::TOKEN; - } - - return $this; - } // setToken() - - /** - * Set the value of [chsum] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setChsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->chsum !== $v || $this->isNew()) { - $this->chsum = $v; - $this->modifiedColumns[] = CcAccessPeer::CHSUM; - } - - return $this; - } // setChsum() - - /** - * Set the value of [ext] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setExt($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ext !== $v || $this->isNew()) { - $this->ext = $v; - $this->modifiedColumns[] = CcAccessPeer::EXT; - } - - return $this; - } // setExt() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v || $this->isNew()) { - $this->type = $v; - $this->modifiedColumns[] = CcAccessPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Set the value of [parent] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setParent($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->parent !== $v) { - $this->parent = $v; - $this->modifiedColumns[] = CcAccessPeer::PARENT; - } - - return $this; - } // setParent() - - /** - * Set the value of [owner] column. - * - * @param int $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setOwner($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->owner !== $v) { - $this->owner = $v; - $this->modifiedColumns[] = CcAccessPeer::OWNER; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setOwner() - - /** - * Sets the value of [ts] 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 CcAccess The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcAccessPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->chsum !== '') { - return false; - } - - if ($this->ext !== '') { - return false; - } - - if ($this->type !== '') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->gunid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->token = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->chsum = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->ext = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->type = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->parent = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->owner = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->ts = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 9; // 9 = CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcAccess object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->owner !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcAccessPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcAccessQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcAccessPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcAccessPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcAccessPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcAccessPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcAccessPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcAccessPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcAccessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getGunid(); - break; - case 2: - return $this->getToken(); - break; - case 3: - return $this->getChsum(); - break; - case 4: - return $this->getExt(); - break; - case 5: - return $this->getType(); - break; - case 6: - return $this->getParent(); - break; - case 7: - return $this->getOwner(); - break; - case 8: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcAccessPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getGunid(), - $keys[2] => $this->getToken(), - $keys[3] => $this->getChsum(), - $keys[4] => $this->getExt(), - $keys[5] => $this->getType(), - $keys[6] => $this->getParent(), - $keys[7] => $this->getOwner(), - $keys[8] => $this->getTs(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcAccessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setGunid($value); - break; - case 2: - $this->setToken($value); - break; - case 3: - $this->setChsum($value); - break; - case 4: - $this->setExt($value); - break; - case 5: - $this->setType($value); - break; - case 6: - $this->setParent($value); - break; - case 7: - $this->setOwner($value); - break; - case 8: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcAccessPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setGunid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setToken($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setChsum($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setExt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setType($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setParent($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setOwner($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setTs($arr[$keys[8]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcAccessPeer::ID)) $criteria->add(CcAccessPeer::ID, $this->id); - if ($this->isColumnModified(CcAccessPeer::GUNID)) $criteria->add(CcAccessPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcAccessPeer::TOKEN)) $criteria->add(CcAccessPeer::TOKEN, $this->token); - if ($this->isColumnModified(CcAccessPeer::CHSUM)) $criteria->add(CcAccessPeer::CHSUM, $this->chsum); - if ($this->isColumnModified(CcAccessPeer::EXT)) $criteria->add(CcAccessPeer::EXT, $this->ext); - if ($this->isColumnModified(CcAccessPeer::TYPE)) $criteria->add(CcAccessPeer::TYPE, $this->type); - if ($this->isColumnModified(CcAccessPeer::PARENT)) $criteria->add(CcAccessPeer::PARENT, $this->parent); - if ($this->isColumnModified(CcAccessPeer::OWNER)) $criteria->add(CcAccessPeer::OWNER, $this->owner); - if ($this->isColumnModified(CcAccessPeer::TS)) $criteria->add(CcAccessPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcAccess (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setGunid($this->gunid); - $copyObj->setToken($this->token); - $copyObj->setChsum($this->chsum); - $copyObj->setExt($this->ext); - $copyObj->setType($this->type); - $copyObj->setParent($this->parent); - $copyObj->setOwner($this->owner); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcAccess Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcAccessPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcAccessPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcAccess The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setOwner(NULL); - } else { - $this->setOwner($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcAccess($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->owner !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->owner, $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->aCcSubjs->addCcAccesss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->gunid = null; - $this->token = null; - $this->chsum = null; - $this->ext = null; - $this->type = null; - $this->parent = null; - $this->owner = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcAccess diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessPeer.php deleted file mode 100644 index c14312b14..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessPeer.php +++ /dev/null @@ -1,1008 +0,0 @@ - array ('Id', 'Gunid', 'Token', 'Chsum', 'Ext', 'Type', 'Parent', 'Owner', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'gunid', 'token', 'chsum', 'ext', 'type', 'parent', 'owner', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::TOKEN, self::CHSUM, self::EXT, self::TYPE, self::PARENT, self::OWNER, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'TOKEN', 'CHSUM', 'EXT', 'TYPE', 'PARENT', 'OWNER', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'token', 'chsum', 'ext', 'type', 'parent', 'owner', 'ts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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 ('Id' => 0, 'Gunid' => 1, 'Token' => 2, 'Chsum' => 3, 'Ext' => 4, 'Type' => 5, 'Parent' => 6, 'Owner' => 7, 'Ts' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'gunid' => 1, 'token' => 2, 'chsum' => 3, 'ext' => 4, 'type' => 5, 'parent' => 6, 'owner' => 7, 'ts' => 8, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::TOKEN => 2, self::CHSUM => 3, self::EXT => 4, self::TYPE => 5, self::PARENT => 6, self::OWNER => 7, self::TS => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'TOKEN' => 2, 'CHSUM' => 3, 'EXT' => 4, 'TYPE' => 5, 'PARENT' => 6, 'OWNER' => 7, 'TS' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'token' => 2, 'chsum' => 3, 'ext' => 4, 'type' => 5, 'parent' => 6, 'owner' => 7, 'ts' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcAccessPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcAccessPeer::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(CcAccessPeer::ID); - $criteria->addSelectColumn(CcAccessPeer::GUNID); - $criteria->addSelectColumn(CcAccessPeer::TOKEN); - $criteria->addSelectColumn(CcAccessPeer::CHSUM); - $criteria->addSelectColumn(CcAccessPeer::EXT); - $criteria->addSelectColumn(CcAccessPeer::TYPE); - $criteria->addSelectColumn(CcAccessPeer::PARENT); - $criteria->addSelectColumn(CcAccessPeer::OWNER); - $criteria->addSelectColumn(CcAccessPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.TOKEN'); - $criteria->addSelectColumn($alias . '.CHSUM'); - $criteria->addSelectColumn($alias . '.EXT'); - $criteria->addSelectColumn($alias . '.TYPE'); - $criteria->addSelectColumn($alias . '.PARENT'); - $criteria->addSelectColumn($alias . '.OWNER'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::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 CcAccess - * @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 = CcAccessPeer::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 CcAccessPeer::populateObjects(CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcAccessPeer::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 CcAccess $value A CcAccess object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcAccess $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcAccess object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcAccess) { - $key = (string) $value->getId(); - } 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 CcAccess 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 CcAccess 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_access - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcAccessPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcAccessPeer::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; - CcAccessPeer::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 (CcAccess object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcAccessPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcAccessPeer::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 + CcAccessPeer::NUM_COLUMNS; - } else { - $cls = CcAccessPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcAccessPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::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 CcAccess objects pre-filled with their CcSubjs 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 CcAccess objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcAccessPeer::addSelectColumns($criteria); - $startcol = (CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcAccessPeer::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 = CcAccessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcAccessPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcAccess) to $obj2 (CcSubjs) - $obj2->addCcAccess($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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::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 CcAccess 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 CcAccess 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); - } - - CcAccessPeer::addSelectColumns($criteria); - $startcol2 = (CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcAccessPeer::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 = CcAccessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcAccessPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcAccess) to the collection in $obj2 (CcSubjs) - $obj2->addCcAccess($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(BaseCcAccessPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcAccessPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcAccessTableMap()); - } - } - - /** - * 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 ? CcAccessPeer::CLASS_DEFAULT : CcAccessPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcAccess or Criteria object. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcAccess object - } - - if ($criteria->containsKey(CcAccessPeer::ID) && $criteria->keyContainsValue(CcAccessPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcAccessPeer::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 CcAccess or Criteria object. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcAccessPeer::ID); - $value = $criteria->remove(CcAccessPeer::ID); - if ($value) { - $selectCriteria->add(CcAccessPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcAccessPeer::TABLE_NAME); - } - - } else { // $values is CcAccess 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_access 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(CcAccessPeer::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(CcAccessPeer::TABLE_NAME, $con, CcAccessPeer::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). - CcAccessPeer::clearInstancePool(); - CcAccessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcAccess or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::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. - CcAccessPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcAccess) { // it's a model object - // invalidate the cache for this single object - CcAccessPeer::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(CcAccessPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcAccessPeer::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); - CcAccessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcAccess 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 CcAccess $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(CcAccess $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcAccessPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, CcAccessPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcAccess - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcAccessPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $pk); - - $v = CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $pks, Criteria::IN); - $objs = CcAccessPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcAccessPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcAccessPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessQuery.php deleted file mode 100644 index 652550f18..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcAccessQuery.php +++ /dev/null @@ -1,477 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcAccess|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcAccessPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcAccessQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcAccessPeer::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 CcAccessQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcAccessPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcAccessQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcAccessPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $gunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByGunid($gunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($gunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $gunid)) { - $gunid = str_replace('*', '%', $gunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::GUNID, $gunid, $comparison); - } - - /** - * Filter the query on the token column - * - * @param string|array $token 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByToken($token = null, $comparison = null) - { - if (is_array($token)) { - $useMinMax = false; - if (isset($token['min'])) { - $this->addUsingAlias(CcAccessPeer::TOKEN, $token['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($token['max'])) { - $this->addUsingAlias(CcAccessPeer::TOKEN, $token['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::TOKEN, $token, $comparison); - } - - /** - * Filter the query on the chsum column - * - * @param string $chsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByChsum($chsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($chsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $chsum)) { - $chsum = str_replace('*', '%', $chsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::CHSUM, $chsum, $comparison); - } - - /** - * Filter the query on the ext column - * - * @param string $ext The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByExt($ext = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($ext)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $ext)) { - $ext = str_replace('*', '%', $ext); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::EXT, $ext, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query on the parent column - * - * @param string|array $parent 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByParent($parent = null, $comparison = null) - { - if (is_array($parent)) { - $useMinMax = false; - if (isset($parent['min'])) { - $this->addUsingAlias(CcAccessPeer::PARENT, $parent['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($parent['max'])) { - $this->addUsingAlias(CcAccessPeer::PARENT, $parent['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::PARENT, $parent, $comparison); - } - - /** - * Filter the query on the owner column - * - * @param int|array $owner 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByOwner($owner = null, $comparison = null) - { - if (is_array($owner)) { - $useMinMax = false; - if (isset($owner['min'])) { - $this->addUsingAlias(CcAccessPeer::OWNER, $owner['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($owner['max'])) { - $this->addUsingAlias(CcAccessPeer::OWNER, $owner['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::OWNER, $owner, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcAccessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcAccessPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::TS, $ts, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcAccess $ccAccess Object to remove from the list of results - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function prune($ccAccess = null) - { - if ($ccAccess) { - $this->addUsingAlias(CcAccessPeer::ID, $ccAccess->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcAccessQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackup.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackup.php deleted file mode 100644 index 41be024bb..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackup.php +++ /dev/null @@ -1,956 +0,0 @@ -token; - } - - /** - * Get the [sessionid] column value. - * - * @return string - */ - public function getSessionid() - { - return $this->sessionid; - } - - /** - * Get the [status] column value. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Get the [optionally formatted] temporal [fromtime] 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 getFromtime($format = 'Y-m-d H:i:s') - { - if ($this->fromtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fromtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fromtime, 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 [optionally formatted] temporal [totime] 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 getTotime($format = 'Y-m-d H:i:s') - { - if ($this->totime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->totime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->totime, 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); - } - } - - /** - * Set the value of [token] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setToken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->token !== $v) { - $this->token = $v; - $this->modifiedColumns[] = CcBackupPeer::TOKEN; - } - - return $this; - } // setToken() - - /** - * Set the value of [sessionid] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setSessionid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sessionid !== $v) { - $this->sessionid = $v; - $this->modifiedColumns[] = CcBackupPeer::SESSIONID; - } - - return $this; - } // setSessionid() - - /** - * Set the value of [status] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setStatus($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->status !== $v) { - $this->status = $v; - $this->modifiedColumns[] = CcBackupPeer::STATUS; - } - - return $this; - } // setStatus() - - /** - * Sets the value of [fromtime] 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 CcBackup The current object (for fluent API support) - */ - public function setFromtime($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->fromtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fromtime !== null && $tmpDt = new DateTime($this->fromtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->fromtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcBackupPeer::FROMTIME; - } - } // if either are not null - - return $this; - } // setFromtime() - - /** - * Sets the value of [totime] 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 CcBackup The current object (for fluent API support) - */ - public function setTotime($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->totime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->totime !== null && $tmpDt = new DateTime($this->totime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->totime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcBackupPeer::TOTIME; - } - } // if either are not null - - return $this; - } // setTotime() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->token = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->sessionid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->status = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->fromtime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->totime = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcBackupPeer::NUM_COLUMNS - CcBackupPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcBackup object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcBackupPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcBackupQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcBackupPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcBackupPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcBackupPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcBackupPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getToken(); - break; - case 1: - return $this->getSessionid(); - break; - case 2: - return $this->getStatus(); - break; - case 3: - return $this->getFromtime(); - break; - case 4: - return $this->getTotime(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcBackupPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getToken(), - $keys[1] => $this->getSessionid(), - $keys[2] => $this->getStatus(), - $keys[3] => $this->getFromtime(), - $keys[4] => $this->getTotime(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcBackupPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setToken($value); - break; - case 1: - $this->setSessionid($value); - break; - case 2: - $this->setStatus($value); - break; - case 3: - $this->setFromtime($value); - break; - case 4: - $this->setTotime($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcBackupPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setToken($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSessionid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setStatus($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setFromtime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTotime($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcBackupPeer::TOKEN)) $criteria->add(CcBackupPeer::TOKEN, $this->token); - if ($this->isColumnModified(CcBackupPeer::SESSIONID)) $criteria->add(CcBackupPeer::SESSIONID, $this->sessionid); - if ($this->isColumnModified(CcBackupPeer::STATUS)) $criteria->add(CcBackupPeer::STATUS, $this->status); - if ($this->isColumnModified(CcBackupPeer::FROMTIME)) $criteria->add(CcBackupPeer::FROMTIME, $this->fromtime); - if ($this->isColumnModified(CcBackupPeer::TOTIME)) $criteria->add(CcBackupPeer::TOTIME, $this->totime); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $this->token); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getToken(); - } - - /** - * Generic method to set the primary key (token column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setToken($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getToken(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcBackup (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setToken($this->token); - $copyObj->setSessionid($this->sessionid); - $copyObj->setStatus($this->status); - $copyObj->setFromtime($this->fromtime); - $copyObj->setTotime($this->totime); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcBackup Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcBackupPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcBackupPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->token = null; - $this->sessionid = null; - $this->status = null; - $this->fromtime = null; - $this->totime = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcBackup diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupPeer.php deleted file mode 100644 index 304acc302..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupPeer.php +++ /dev/null @@ -1,750 +0,0 @@ - array ('Token', 'Sessionid', 'Status', 'Fromtime', 'Totime', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ), - BasePeer::TYPE_COLNAME => array (self::TOKEN, self::SESSIONID, self::STATUS, self::FROMTIME, self::TOTIME, ), - BasePeer::TYPE_RAW_COLNAME => array ('TOKEN', 'SESSIONID', 'STATUS', 'FROMTIME', 'TOTIME', ), - BasePeer::TYPE_FIELDNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Token' => 0, 'Sessionid' => 1, 'Status' => 2, 'Fromtime' => 3, 'Totime' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ), - BasePeer::TYPE_COLNAME => array (self::TOKEN => 0, self::SESSIONID => 1, self::STATUS => 2, self::FROMTIME => 3, self::TOTIME => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('TOKEN' => 0, 'SESSIONID' => 1, 'STATUS' => 2, 'FROMTIME' => 3, 'TOTIME' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcBackupPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcBackupPeer::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(CcBackupPeer::TOKEN); - $criteria->addSelectColumn(CcBackupPeer::SESSIONID); - $criteria->addSelectColumn(CcBackupPeer::STATUS); - $criteria->addSelectColumn(CcBackupPeer::FROMTIME); - $criteria->addSelectColumn(CcBackupPeer::TOTIME); - } else { - $criteria->addSelectColumn($alias . '.TOKEN'); - $criteria->addSelectColumn($alias . '.SESSIONID'); - $criteria->addSelectColumn($alias . '.STATUS'); - $criteria->addSelectColumn($alias . '.FROMTIME'); - $criteria->addSelectColumn($alias . '.TOTIME'); - } - } - - /** - * 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(CcBackupPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcBackupPeer::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(CcBackupPeer::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 CcBackup - * @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 = CcBackupPeer::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 CcBackupPeer::populateObjects(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcBackupPeer::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 CcBackup $value A CcBackup object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcBackup $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getToken(); - } // 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 CcBackup object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcBackup) { - $key = (string) $value->getToken(); - } 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 CcBackup 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 CcBackup 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_backup - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcBackupPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcBackupPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcBackupPeer::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; - CcBackupPeer::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 (CcBackup object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcBackupPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcBackupPeer::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 + CcBackupPeer::NUM_COLUMNS; - } else { - $cls = CcBackupPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcBackupPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcBackupPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcBackupPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcBackupTableMap()); - } - } - - /** - * 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 ? CcBackupPeer::CLASS_DEFAULT : CcBackupPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcBackup or Criteria object. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcBackup object - } - - - // 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 CcBackup or Criteria object. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcBackupPeer::TOKEN); - $value = $criteria->remove(CcBackupPeer::TOKEN); - if ($value) { - $selectCriteria->add(CcBackupPeer::TOKEN, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcBackupPeer::TABLE_NAME); - } - - } else { // $values is CcBackup 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_backup 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(CcBackupPeer::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(CcBackupPeer::TABLE_NAME, $con, CcBackupPeer::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). - CcBackupPeer::clearInstancePool(); - CcBackupPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcBackup or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::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. - CcBackupPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcBackup) { // it's a model object - // invalidate the cache for this single object - CcBackupPeer::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(CcBackupPeer::TOKEN, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcBackupPeer::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); - CcBackupPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcBackup 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 CcBackup $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(CcBackup $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcBackupPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, CcBackupPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcBackup - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcBackupPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $pk); - - $v = CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $pks, Criteria::IN); - $objs = CcBackupPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcBackupPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcBackupPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupQuery.php deleted file mode 100644 index 2e80333fb..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcBackupQuery.php +++ /dev/null @@ -1,292 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcBackup|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcBackupPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcBackupQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcBackupPeer::TOKEN, $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 CcBackupQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcBackupPeer::TOKEN, $keys, Criteria::IN); - } - - /** - * Filter the query on the token column - * - * @param string $token The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterByToken($token = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($token)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $token)) { - $token = str_replace('*', '%', $token); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::TOKEN, $token, $comparison); - } - - /** - * Filter the query on the sessionid column - * - * @param string $sessionid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterBySessionid($sessionid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($sessionid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $sessionid)) { - $sessionid = str_replace('*', '%', $sessionid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::SESSIONID, $sessionid, $comparison); - } - - /** - * Filter the query on the status column - * - * @param string $status The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterByStatus($status = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($status)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $status)) { - $status = str_replace('*', '%', $status); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::STATUS, $status, $comparison); - } - - /** - * Filter the query on the fromtime column - * - * @param string|array $fromtime 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 CcBackupQuery The current query, for fluid interface - */ - public function filterByFromtime($fromtime = null, $comparison = null) - { - if (is_array($fromtime)) { - $useMinMax = false; - if (isset($fromtime['min'])) { - $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($fromtime['max'])) { - $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime, $comparison); - } - - /** - * Filter the query on the totime column - * - * @param string|array $totime 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 CcBackupQuery The current query, for fluid interface - */ - public function filterByTotime($totime = null, $comparison = null) - { - if (is_array($totime)) { - $useMinMax = false; - if (isset($totime['min'])) { - $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($totime['max'])) { - $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcBackupPeer::TOTIME, $totime, $comparison); - } - - /** - * Exclude object from result - * - * @param CcBackup $ccBackup Object to remove from the list of results - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function prune($ccBackup = null) - { - if ($ccBackup) { - $this->addUsingAlias(CcBackupPeer::TOKEN, $ccBackup->getToken(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcBackupQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountry.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountry.php deleted file mode 100644 index 3f92c5493..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountry.php +++ /dev/null @@ -1,708 +0,0 @@ -isocode; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Set the value of [isocode] column. - * - * @param string $v new value - * @return CcCountry The current object (for fluent API support) - */ - public function setDbIsoCode($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->isocode !== $v) { - $this->isocode = $v; - $this->modifiedColumns[] = CcCountryPeer::ISOCODE; - } - - return $this; - } // setDbIsoCode() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcCountry The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = CcCountryPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->isocode = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcCountryPeer::NUM_COLUMNS - CcCountryPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcCountry object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcCountryPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcCountryQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcCountryPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcCountryPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcCountryPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbIsoCode(); - break; - case 1: - return $this->getDbName(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcCountryPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbIsoCode(), - $keys[1] => $this->getDbName(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbIsoCode($value); - break; - case 1: - $this->setDbName($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcCountryPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbIsoCode($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcCountryPeer::ISOCODE)) $criteria->add(CcCountryPeer::ISOCODE, $this->isocode); - if ($this->isColumnModified(CcCountryPeer::NAME)) $criteria->add(CcCountryPeer::NAME, $this->name); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $this->isocode); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbIsoCode(); - } - - /** - * Generic method to set the primary key (isocode column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbIsoCode($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbIsoCode(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcCountry (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbIsoCode($this->isocode); - $copyObj->setDbName($this->name); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcCountry Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcCountryPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcCountryPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->isocode = null; - $this->name = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcCountry diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryPeer.php deleted file mode 100644 index ee16e55bf..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbIsoCode', 'DbName', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode', 'dbName', ), - BasePeer::TYPE_COLNAME => array (self::ISOCODE, self::NAME, ), - BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE', 'NAME', ), - BasePeer::TYPE_FIELDNAME => array ('isocode', 'name', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbIsoCode' => 0, 'DbName' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode' => 0, 'dbName' => 1, ), - BasePeer::TYPE_COLNAME => array (self::ISOCODE => 0, self::NAME => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE' => 0, 'NAME' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('isocode' => 0, 'name' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcCountryPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcCountryPeer::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(CcCountryPeer::ISOCODE); - $criteria->addSelectColumn(CcCountryPeer::NAME); - } else { - $criteria->addSelectColumn($alias . '.ISOCODE'); - $criteria->addSelectColumn($alias . '.NAME'); - } - } - - /** - * 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(CcCountryPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcCountryPeer::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(CcCountryPeer::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 CcCountry - * @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 = CcCountryPeer::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 CcCountryPeer::populateObjects(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcCountryPeer::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 CcCountry $value A CcCountry object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcCountry $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbIsoCode(); - } // 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 CcCountry object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcCountry) { - $key = (string) $value->getDbIsoCode(); - } 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 CcCountry 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 CcCountry 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_country - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcCountryPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcCountryPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcCountryPeer::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; - CcCountryPeer::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 (CcCountry object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcCountryPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcCountryPeer::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 + CcCountryPeer::NUM_COLUMNS; - } else { - $cls = CcCountryPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcCountryPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcCountryPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcCountryPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcCountryTableMap()); - } - } - - /** - * 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 ? CcCountryPeer::CLASS_DEFAULT : CcCountryPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcCountry or Criteria object. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcCountry object - } - - - // 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 CcCountry or Criteria object. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcCountryPeer::ISOCODE); - $value = $criteria->remove(CcCountryPeer::ISOCODE); - if ($value) { - $selectCriteria->add(CcCountryPeer::ISOCODE, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcCountryPeer::TABLE_NAME); - } - - } else { // $values is CcCountry 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_country 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(CcCountryPeer::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(CcCountryPeer::TABLE_NAME, $con, CcCountryPeer::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). - CcCountryPeer::clearInstancePool(); - CcCountryPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcCountry or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::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. - CcCountryPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcCountry) { // it's a model object - // invalidate the cache for this single object - CcCountryPeer::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(CcCountryPeer::ISOCODE, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcCountryPeer::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); - CcCountryPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcCountry 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 CcCountry $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(CcCountry $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcCountryPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, CcCountryPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcCountry - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcCountryPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $pk); - - $v = CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $pks, Criteria::IN); - $objs = CcCountryPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcCountryPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcCountryPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryQuery.php deleted file mode 100644 index 4e634ea19..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcCountryQuery.php +++ /dev/null @@ -1,196 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcCountry|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcCountryPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcCountryQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $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 CcCountryQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $keys, Criteria::IN); - } - - /** - * Filter the query on the isocode column - * - * @param string $dbIsoCode The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function filterByDbIsoCode($dbIsoCode = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIsoCode)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIsoCode)) { - $dbIsoCode = str_replace('*', '%', $dbIsoCode); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $dbIsoCode, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcCountryPeer::NAME, $dbName, $comparison); - } - - /** - * Exclude object from result - * - * @param CcCountry $ccCountry Object to remove from the list of results - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function prune($ccCountry = null) - { - if ($ccCountry) { - $this->addUsingAlias(CcCountryPeer::ISOCODE, $ccCountry->getDbIsoCode(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcCountryQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFiles.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFiles.php deleted file mode 100644 index 0882018d1..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFiles.php +++ /dev/null @@ -1,4325 +0,0 @@ -name = ''; - $this->mime = ''; - $this->ftype = ''; - $this->filepath = ''; - $this->state = 'empty'; - $this->currentlyaccessing = 0; - } - - /** - * Initializes internal state of BaseCcFiles object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getDbGunid() - { - return $this->gunid; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [mime] column value. - * - * @return string - */ - public function getDbMime() - { - return $this->mime; - } - - /** - * Get the [ftype] column value. - * - * @return string - */ - public function getDbFtype() - { - return $this->ftype; - } - - /** - * Get the [directory] column value. - * - * @return int - */ - public function getDbDirectory() - { - return $this->directory; - } - - /** - * Get the [filepath] column value. - * - * @return string - */ - public function getDbFilepath() - { - return $this->filepath; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getDbState() - { - return $this->state; - } - - /** - * Get the [currentlyaccessing] column value. - * - * @return int - */ - public function getDbCurrentlyaccessing() - { - return $this->currentlyaccessing; - } - - /** - * Get the [editedby] column value. - * - * @return int - */ - public function getDbEditedby() - { - return $this->editedby; - } - - /** - * Get the [optionally formatted] temporal [mtime] 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 getDbMtime($format = 'Y-m-d H:i:s') - { - if ($this->mtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->mtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->mtime, 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 [md5] column value. - * - * @return string - */ - public function getDbMd5() - { - return $this->md5; - } - - /** - * Get the [track_title] column value. - * - * @return string - */ - public function getDbTrackTitle() - { - return $this->track_title; - } - - /** - * Get the [artist_name] column value. - * - * @return string - */ - public function getDbArtistName() - { - return $this->artist_name; - } - - /** - * Get the [bit_rate] column value. - * - * @return string - */ - public function getDbBitRate() - { - return $this->bit_rate; - } - - /** - * Get the [sample_rate] column value. - * - * @return string - */ - public function getDbSampleRate() - { - return $this->sample_rate; - } - - /** - * Get the [format] column value. - * - * @return string - */ - public function getDbFormat() - { - return $this->format; - } - - /** - * Get the [optionally formatted] temporal [length] 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 getDbLength($format = '%X') - { - if ($this->length === null) { - return null; - } - - - - try { - $dt = new DateTime($this->length); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->length, 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 [album_title] column value. - * - * @return string - */ - public function getDbAlbumTitle() - { - return $this->album_title; - } - - /** - * Get the [genre] column value. - * - * @return string - */ - public function getDbGenre() - { - return $this->genre; - } - - /** - * Get the [comments] column value. - * - * @return string - */ - public function getDbComments() - { - return $this->comments; - } - - /** - * Get the [year] column value. - * - * @return string - */ - public function getDbYear() - { - return $this->year; - } - - /** - * Get the [track_number] column value. - * - * @return int - */ - public function getDbTrackNumber() - { - return $this->track_number; - } - - /** - * Get the [channels] column value. - * - * @return int - */ - public function getDbChannels() - { - return $this->channels; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getDbUrl() - { - return $this->url; - } - - /** - * Get the [bpm] column value. - * - * @return string - */ - public function getDbBpm() - { - return $this->bpm; - } - - /** - * Get the [rating] column value. - * - * @return string - */ - public function getDbRating() - { - return $this->rating; - } - - /** - * Get the [encoded_by] column value. - * - * @return string - */ - public function getDbEncodedBy() - { - return $this->encoded_by; - } - - /** - * Get the [disc_number] column value. - * - * @return string - */ - public function getDbDiscNumber() - { - return $this->disc_number; - } - - /** - * Get the [mood] column value. - * - * @return string - */ - public function getDbMood() - { - return $this->mood; - } - - /** - * Get the [label] column value. - * - * @return string - */ - public function getDbLabel() - { - return $this->label; - } - - /** - * Get the [composer] column value. - * - * @return string - */ - public function getDbComposer() - { - return $this->composer; - } - - /** - * Get the [encoder] column value. - * - * @return string - */ - public function getDbEncoder() - { - return $this->encoder; - } - - /** - * Get the [checksum] column value. - * - * @return string - */ - public function getDbChecksum() - { - return $this->checksum; - } - - /** - * Get the [lyrics] column value. - * - * @return string - */ - public function getDbLyrics() - { - return $this->lyrics; - } - - /** - * Get the [orchestra] column value. - * - * @return string - */ - public function getDbOrchestra() - { - return $this->orchestra; - } - - /** - * Get the [conductor] column value. - * - * @return string - */ - public function getDbConductor() - { - return $this->conductor; - } - - /** - * Get the [lyricist] column value. - * - * @return string - */ - public function getDbLyricist() - { - return $this->lyricist; - } - - /** - * Get the [original_lyricist] column value. - * - * @return string - */ - public function getDbOriginalLyricist() - { - return $this->original_lyricist; - } - - /** - * Get the [radio_station_name] column value. - * - * @return string - */ - public function getDbRadioStationName() - { - return $this->radio_station_name; - } - - /** - * Get the [info_url] column value. - * - * @return string - */ - public function getDbInfoUrl() - { - return $this->info_url; - } - - /** - * Get the [artist_url] column value. - * - * @return string - */ - public function getDbArtistUrl() - { - return $this->artist_url; - } - - /** - * Get the [audio_source_url] column value. - * - * @return string - */ - public function getDbAudioSourceUrl() - { - return $this->audio_source_url; - } - - /** - * Get the [radio_station_url] column value. - * - * @return string - */ - public function getDbRadioStationUrl() - { - return $this->radio_station_url; - } - - /** - * Get the [buy_this_url] column value. - * - * @return string - */ - public function getDbBuyThisUrl() - { - return $this->buy_this_url; - } - - /** - * Get the [isrc_number] column value. - * - * @return string - */ - public function getDbIsrcNumber() - { - return $this->isrc_number; - } - - /** - * Get the [catalog_number] column value. - * - * @return string - */ - public function getDbCatalogNumber() - { - return $this->catalog_number; - } - - /** - * Get the [original_artist] column value. - * - * @return string - */ - public function getDbOriginalArtist() - { - return $this->original_artist; - } - - /** - * Get the [copyright] column value. - * - * @return string - */ - public function getDbCopyright() - { - return $this->copyright; - } - - /** - * Get the [report_datetime] column value. - * - * @return string - */ - public function getDbReportDatetime() - { - return $this->report_datetime; - } - - /** - * Get the [report_location] column value. - * - * @return string - */ - public function getDbReportLocation() - { - return $this->report_location; - } - - /** - * Get the [report_organization] column value. - * - * @return string - */ - public function getDbReportOrganization() - { - return $this->report_organization; - } - - /** - * Get the [subject] column value. - * - * @return string - */ - public function getDbSubject() - { - return $this->subject; - } - - /** - * Get the [contributor] column value. - * - * @return string - */ - public function getDbContributor() - { - return $this->contributor; - } - - /** - * Get the [language] column value. - * - * @return string - */ - public function getDbLanguage() - { - return $this->language; - } - - /** - * Get the [soundcloud_id] column value. - * - * @return int - */ - public function getDbSoundcloudId() - { - return $this->soundcloud_id; - } - - /** - * Get the [soundcloud_error_code] column value. - * - * @return int - */ - public function getDbSoundcloudErrorCode() - { - return $this->soundcloud_error_code; - } - - /** - * Get the [soundcloud_error_msg] column value. - * - * @return string - */ - public function getDbSoundcloudErrorMsg() - { - return $this->soundcloud_error_msg; - } - - /** - * Get the [soundcloud_link_to_file] column value. - * - * @return string - */ - public function getDbSoundcloudLinkToFile() - { - return $this->soundcloud_link_to_file; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcFilesPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcFilesPeer::GUNID; - } - - return $this; - } // setDbGunid() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcFilesPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [mime] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMime($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mime !== $v || $this->isNew()) { - $this->mime = $v; - $this->modifiedColumns[] = CcFilesPeer::MIME; - } - - return $this; - } // setDbMime() - - /** - * Set the value of [ftype] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFtype($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ftype !== $v || $this->isNew()) { - $this->ftype = $v; - $this->modifiedColumns[] = CcFilesPeer::FTYPE; - } - - return $this; - } // setDbFtype() - - /** - * Set the value of [directory] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbDirectory($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->directory !== $v) { - $this->directory = $v; - $this->modifiedColumns[] = CcFilesPeer::DIRECTORY; - } - - if ($this->aCcMusicDirs !== null && $this->aCcMusicDirs->getId() !== $v) { - $this->aCcMusicDirs = null; - } - - return $this; - } // setDbDirectory() - - /** - * Set the value of [filepath] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFilepath($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->filepath !== $v || $this->isNew()) { - $this->filepath = $v; - $this->modifiedColumns[] = CcFilesPeer::FILEPATH; - } - - return $this; - } // setDbFilepath() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v || $this->isNew()) { - $this->state = $v; - $this->modifiedColumns[] = CcFilesPeer::STATE; - } - - return $this; - } // setDbState() - - /** - * Set the value of [currentlyaccessing] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCurrentlyaccessing($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->currentlyaccessing !== $v || $this->isNew()) { - $this->currentlyaccessing = $v; - $this->modifiedColumns[] = CcFilesPeer::CURRENTLYACCESSING; - } - - return $this; - } // setDbCurrentlyaccessing() - - /** - * Set the value of [editedby] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEditedby($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->editedby !== $v) { - $this->editedby = $v; - $this->modifiedColumns[] = CcFilesPeer::EDITEDBY; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbEditedby() - - /** - * Sets the value of [mtime] 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 CcFiles The current object (for fluent API support) - */ - public function setDbMtime($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->mtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->mtime !== null && $tmpDt = new DateTime($this->mtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->mtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcFilesPeer::MTIME; - } - } // if either are not null - - return $this; - } // setDbMtime() - - /** - * Set the value of [md5] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMd5($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->md5 !== $v) { - $this->md5 = $v; - $this->modifiedColumns[] = CcFilesPeer::MD5; - } - - return $this; - } // setDbMd5() - - /** - * Set the value of [track_title] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbTrackTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->track_title !== $v) { - $this->track_title = $v; - $this->modifiedColumns[] = CcFilesPeer::TRACK_TITLE; - } - - return $this; - } // setDbTrackTitle() - - /** - * Set the value of [artist_name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbArtistName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->artist_name !== $v) { - $this->artist_name = $v; - $this->modifiedColumns[] = CcFilesPeer::ARTIST_NAME; - } - - return $this; - } // setDbArtistName() - - /** - * Set the value of [bit_rate] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBitRate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->bit_rate !== $v) { - $this->bit_rate = $v; - $this->modifiedColumns[] = CcFilesPeer::BIT_RATE; - } - - return $this; - } // setDbBitRate() - - /** - * Set the value of [sample_rate] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSampleRate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sample_rate !== $v) { - $this->sample_rate = $v; - $this->modifiedColumns[] = CcFilesPeer::SAMPLE_RATE; - } - - return $this; - } // setDbSampleRate() - - /** - * Set the value of [format] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFormat($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->format !== $v) { - $this->format = $v; - $this->modifiedColumns[] = CcFilesPeer::FORMAT; - } - - return $this; - } // setDbFormat() - - /** - * Sets the value of [length] 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 CcFiles The current object (for fluent API support) - */ - public function setDbLength($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->length !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->length !== null && $tmpDt = new DateTime($this->length)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->length = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcFilesPeer::LENGTH; - } - } // if either are not null - - return $this; - } // setDbLength() - - /** - * Set the value of [album_title] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbAlbumTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->album_title !== $v) { - $this->album_title = $v; - $this->modifiedColumns[] = CcFilesPeer::ALBUM_TITLE; - } - - return $this; - } // setDbAlbumTitle() - - /** - * Set the value of [genre] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbGenre($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->genre !== $v) { - $this->genre = $v; - $this->modifiedColumns[] = CcFilesPeer::GENRE; - } - - return $this; - } // setDbGenre() - - /** - * Set the value of [comments] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbComments($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->comments !== $v) { - $this->comments = $v; - $this->modifiedColumns[] = CcFilesPeer::COMMENTS; - } - - return $this; - } // setDbComments() - - /** - * Set the value of [year] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbYear($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->year !== $v) { - $this->year = $v; - $this->modifiedColumns[] = CcFilesPeer::YEAR; - } - - return $this; - } // setDbYear() - - /** - * Set the value of [track_number] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbTrackNumber($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->track_number !== $v) { - $this->track_number = $v; - $this->modifiedColumns[] = CcFilesPeer::TRACK_NUMBER; - } - - return $this; - } // setDbTrackNumber() - - /** - * Set the value of [channels] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbChannels($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->channels !== $v) { - $this->channels = $v; - $this->modifiedColumns[] = CcFilesPeer::CHANNELS; - } - - return $this; - } // setDbChannels() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v) { - $this->url = $v; - $this->modifiedColumns[] = CcFilesPeer::URL; - } - - return $this; - } // setDbUrl() - - /** - * Set the value of [bpm] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBpm($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->bpm !== $v) { - $this->bpm = $v; - $this->modifiedColumns[] = CcFilesPeer::BPM; - } - - return $this; - } // setDbBpm() - - /** - * Set the value of [rating] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRating($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->rating !== $v) { - $this->rating = $v; - $this->modifiedColumns[] = CcFilesPeer::RATING; - } - - return $this; - } // setDbRating() - - /** - * Set the value of [encoded_by] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEncodedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->encoded_by !== $v) { - $this->encoded_by = $v; - $this->modifiedColumns[] = CcFilesPeer::ENCODED_BY; - } - - return $this; - } // setDbEncodedBy() - - /** - * Set the value of [disc_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbDiscNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->disc_number !== $v) { - $this->disc_number = $v; - $this->modifiedColumns[] = CcFilesPeer::DISC_NUMBER; - } - - return $this; - } // setDbDiscNumber() - - /** - * Set the value of [mood] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMood($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mood !== $v) { - $this->mood = $v; - $this->modifiedColumns[] = CcFilesPeer::MOOD; - } - - return $this; - } // setDbMood() - - /** - * Set the value of [label] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLabel($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->label !== $v) { - $this->label = $v; - $this->modifiedColumns[] = CcFilesPeer::LABEL; - } - - return $this; - } // setDbLabel() - - /** - * Set the value of [composer] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbComposer($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->composer !== $v) { - $this->composer = $v; - $this->modifiedColumns[] = CcFilesPeer::COMPOSER; - } - - return $this; - } // setDbComposer() - - /** - * Set the value of [encoder] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEncoder($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->encoder !== $v) { - $this->encoder = $v; - $this->modifiedColumns[] = CcFilesPeer::ENCODER; - } - - return $this; - } // setDbEncoder() - - /** - * Set the value of [checksum] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbChecksum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->checksum !== $v) { - $this->checksum = $v; - $this->modifiedColumns[] = CcFilesPeer::CHECKSUM; - } - - return $this; - } // setDbChecksum() - - /** - * Set the value of [lyrics] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLyrics($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lyrics !== $v) { - $this->lyrics = $v; - $this->modifiedColumns[] = CcFilesPeer::LYRICS; - } - - return $this; - } // setDbLyrics() - - /** - * Set the value of [orchestra] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOrchestra($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->orchestra !== $v) { - $this->orchestra = $v; - $this->modifiedColumns[] = CcFilesPeer::ORCHESTRA; - } - - return $this; - } // setDbOrchestra() - - /** - * Set the value of [conductor] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbConductor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->conductor !== $v) { - $this->conductor = $v; - $this->modifiedColumns[] = CcFilesPeer::CONDUCTOR; - } - - return $this; - } // setDbConductor() - - /** - * Set the value of [lyricist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLyricist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lyricist !== $v) { - $this->lyricist = $v; - $this->modifiedColumns[] = CcFilesPeer::LYRICIST; - } - - return $this; - } // setDbLyricist() - - /** - * Set the value of [original_lyricist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOriginalLyricist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->original_lyricist !== $v) { - $this->original_lyricist = $v; - $this->modifiedColumns[] = CcFilesPeer::ORIGINAL_LYRICIST; - } - - return $this; - } // setDbOriginalLyricist() - - /** - * Set the value of [radio_station_name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRadioStationName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->radio_station_name !== $v) { - $this->radio_station_name = $v; - $this->modifiedColumns[] = CcFilesPeer::RADIO_STATION_NAME; - } - - return $this; - } // setDbRadioStationName() - - /** - * Set the value of [info_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbInfoUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->info_url !== $v) { - $this->info_url = $v; - $this->modifiedColumns[] = CcFilesPeer::INFO_URL; - } - - return $this; - } // setDbInfoUrl() - - /** - * Set the value of [artist_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbArtistUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->artist_url !== $v) { - $this->artist_url = $v; - $this->modifiedColumns[] = CcFilesPeer::ARTIST_URL; - } - - return $this; - } // setDbArtistUrl() - - /** - * Set the value of [audio_source_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbAudioSourceUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->audio_source_url !== $v) { - $this->audio_source_url = $v; - $this->modifiedColumns[] = CcFilesPeer::AUDIO_SOURCE_URL; - } - - return $this; - } // setDbAudioSourceUrl() - - /** - * Set the value of [radio_station_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRadioStationUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->radio_station_url !== $v) { - $this->radio_station_url = $v; - $this->modifiedColumns[] = CcFilesPeer::RADIO_STATION_URL; - } - - return $this; - } // setDbRadioStationUrl() - - /** - * Set the value of [buy_this_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBuyThisUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->buy_this_url !== $v) { - $this->buy_this_url = $v; - $this->modifiedColumns[] = CcFilesPeer::BUY_THIS_URL; - } - - return $this; - } // setDbBuyThisUrl() - - /** - * Set the value of [isrc_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbIsrcNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->isrc_number !== $v) { - $this->isrc_number = $v; - $this->modifiedColumns[] = CcFilesPeer::ISRC_NUMBER; - } - - return $this; - } // setDbIsrcNumber() - - /** - * Set the value of [catalog_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCatalogNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->catalog_number !== $v) { - $this->catalog_number = $v; - $this->modifiedColumns[] = CcFilesPeer::CATALOG_NUMBER; - } - - return $this; - } // setDbCatalogNumber() - - /** - * Set the value of [original_artist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOriginalArtist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->original_artist !== $v) { - $this->original_artist = $v; - $this->modifiedColumns[] = CcFilesPeer::ORIGINAL_ARTIST; - } - - return $this; - } // setDbOriginalArtist() - - /** - * Set the value of [copyright] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCopyright($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->copyright !== $v) { - $this->copyright = $v; - $this->modifiedColumns[] = CcFilesPeer::COPYRIGHT; - } - - return $this; - } // setDbCopyright() - - /** - * Set the value of [report_datetime] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportDatetime($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_datetime !== $v) { - $this->report_datetime = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_DATETIME; - } - - return $this; - } // setDbReportDatetime() - - /** - * Set the value of [report_location] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportLocation($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_location !== $v) { - $this->report_location = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_LOCATION; - } - - return $this; - } // setDbReportLocation() - - /** - * Set the value of [report_organization] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportOrganization($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_organization !== $v) { - $this->report_organization = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_ORGANIZATION; - } - - return $this; - } // setDbReportOrganization() - - /** - * Set the value of [subject] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSubject($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->subject !== $v) { - $this->subject = $v; - $this->modifiedColumns[] = CcFilesPeer::SUBJECT; - } - - return $this; - } // setDbSubject() - - /** - * Set the value of [contributor] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbContributor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->contributor !== $v) { - $this->contributor = $v; - $this->modifiedColumns[] = CcFilesPeer::CONTRIBUTOR; - } - - return $this; - } // setDbContributor() - - /** - * Set the value of [language] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLanguage($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->language !== $v) { - $this->language = $v; - $this->modifiedColumns[] = CcFilesPeer::LANGUAGE; - } - - return $this; - } // setDbLanguage() - - /** - * Set the value of [soundcloud_id] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->soundcloud_id !== $v) { - $this->soundcloud_id = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ID; - } - - return $this; - } // setDbSoundcloudId() - - /** - * Set the value of [soundcloud_error_code] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudErrorCode($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->soundcloud_error_code !== $v) { - $this->soundcloud_error_code = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_CODE; - } - - return $this; - } // setDbSoundcloudErrorCode() - - /** - * Set the value of [soundcloud_error_msg] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudErrorMsg($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->soundcloud_error_msg !== $v) { - $this->soundcloud_error_msg = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_MSG; - } - - return $this; - } // setDbSoundcloudErrorMsg() - - /** - * Set the value of [soundcloud_link_to_file] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudLinkToFile($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->soundcloud_link_to_file !== $v) { - $this->soundcloud_link_to_file = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE; - } - - return $this; - } // setDbSoundcloudLinkToFile() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->mime !== '') { - return false; - } - - if ($this->ftype !== '') { - return false; - } - - if ($this->filepath !== '') { - return false; - } - - if ($this->state !== 'empty') { - return false; - } - - if ($this->currentlyaccessing !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->gunid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->mime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->ftype = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->directory = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->filepath = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->state = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->currentlyaccessing = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null; - $this->editedby = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null; - $this->mtime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->md5 = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; - $this->track_title = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; - $this->artist_name = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null; - $this->bit_rate = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null; - $this->sample_rate = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null; - $this->format = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null; - $this->length = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null; - $this->album_title = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null; - $this->genre = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null; - $this->comments = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null; - $this->year = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null; - $this->track_number = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null; - $this->channels = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null; - $this->url = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null; - $this->bpm = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null; - $this->rating = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null; - $this->encoded_by = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null; - $this->disc_number = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null; - $this->mood = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null; - $this->label = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null; - $this->composer = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null; - $this->encoder = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null; - $this->checksum = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null; - $this->lyrics = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null; - $this->orchestra = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null; - $this->conductor = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null; - $this->lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null; - $this->original_lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null; - $this->radio_station_name = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null; - $this->info_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null; - $this->artist_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null; - $this->audio_source_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null; - $this->radio_station_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null; - $this->buy_this_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null; - $this->isrc_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null; - $this->catalog_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null; - $this->original_artist = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null; - $this->copyright = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null; - $this->report_datetime = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null; - $this->report_location = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null; - $this->report_organization = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null; - $this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null; - $this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null; - $this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null; - $this->soundcloud_id = ($row[$startcol + 55] !== null) ? (int) $row[$startcol + 55] : null; - $this->soundcloud_error_code = ($row[$startcol + 56] !== null) ? (int) $row[$startcol + 56] : null; - $this->soundcloud_error_msg = ($row[$startcol + 57] !== null) ? (string) $row[$startcol + 57] : null; - $this->soundcloud_link_to_file = ($row[$startcol + 58] !== null) ? (string) $row[$startcol + 58] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 59; // 59 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcFiles object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcMusicDirs !== null && $this->directory !== $this->aCcMusicDirs->getId()) { - $this->aCcMusicDirs = null; - } - if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcFilesPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - $this->aCcMusicDirs = null; - $this->collCcShowInstancess = null; - - $this->collCcPlaylistcontentss = null; - - $this->collCcSchedules = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcFilesQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcFilesPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->aCcMusicDirs !== null) { - if ($this->aCcMusicDirs->isModified() || $this->aCcMusicDirs->isNew()) { - $affectedRows += $this->aCcMusicDirs->save($con); - } - $this->setCcMusicDirs($this->aCcMusicDirs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcFilesPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcFilesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcFilesPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcFilesPeer::doUpdate($this, $con); - } - - $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->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - if ($this->aCcMusicDirs !== null) { - if (!$this->aCcMusicDirs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcMusicDirs->getValidationFailures()); - } - } - - - if (($retval = CcFilesPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancess !== null) { - foreach ($this->collCcShowInstancess as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcFilesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbGunid(); - break; - case 2: - return $this->getDbName(); - break; - case 3: - return $this->getDbMime(); - break; - case 4: - return $this->getDbFtype(); - break; - case 5: - return $this->getDbDirectory(); - break; - case 6: - return $this->getDbFilepath(); - break; - case 7: - return $this->getDbState(); - break; - case 8: - return $this->getDbCurrentlyaccessing(); - break; - case 9: - return $this->getDbEditedby(); - break; - case 10: - return $this->getDbMtime(); - break; - case 11: - return $this->getDbMd5(); - break; - case 12: - return $this->getDbTrackTitle(); - break; - case 13: - return $this->getDbArtistName(); - break; - case 14: - return $this->getDbBitRate(); - break; - case 15: - return $this->getDbSampleRate(); - break; - case 16: - return $this->getDbFormat(); - break; - case 17: - return $this->getDbLength(); - break; - case 18: - return $this->getDbAlbumTitle(); - break; - case 19: - return $this->getDbGenre(); - break; - case 20: - return $this->getDbComments(); - break; - case 21: - return $this->getDbYear(); - break; - case 22: - return $this->getDbTrackNumber(); - break; - case 23: - return $this->getDbChannels(); - break; - case 24: - return $this->getDbUrl(); - break; - case 25: - return $this->getDbBpm(); - break; - case 26: - return $this->getDbRating(); - break; - case 27: - return $this->getDbEncodedBy(); - break; - case 28: - return $this->getDbDiscNumber(); - break; - case 29: - return $this->getDbMood(); - break; - case 30: - return $this->getDbLabel(); - break; - case 31: - return $this->getDbComposer(); - break; - case 32: - return $this->getDbEncoder(); - break; - case 33: - return $this->getDbChecksum(); - break; - case 34: - return $this->getDbLyrics(); - break; - case 35: - return $this->getDbOrchestra(); - break; - case 36: - return $this->getDbConductor(); - break; - case 37: - return $this->getDbLyricist(); - break; - case 38: - return $this->getDbOriginalLyricist(); - break; - case 39: - return $this->getDbRadioStationName(); - break; - case 40: - return $this->getDbInfoUrl(); - break; - case 41: - return $this->getDbArtistUrl(); - break; - case 42: - return $this->getDbAudioSourceUrl(); - break; - case 43: - return $this->getDbRadioStationUrl(); - break; - case 44: - return $this->getDbBuyThisUrl(); - break; - case 45: - return $this->getDbIsrcNumber(); - break; - case 46: - return $this->getDbCatalogNumber(); - break; - case 47: - return $this->getDbOriginalArtist(); - break; - case 48: - return $this->getDbCopyright(); - break; - case 49: - return $this->getDbReportDatetime(); - break; - case 50: - return $this->getDbReportLocation(); - break; - case 51: - return $this->getDbReportOrganization(); - break; - case 52: - return $this->getDbSubject(); - break; - case 53: - return $this->getDbContributor(); - break; - case 54: - return $this->getDbLanguage(); - break; - case 55: - return $this->getDbSoundcloudId(); - break; - case 56: - return $this->getDbSoundcloudErrorCode(); - break; - case 57: - return $this->getDbSoundcloudErrorMsg(); - break; - case 58: - return $this->getDbSoundcloudLinkToFile(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcFilesPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbGunid(), - $keys[2] => $this->getDbName(), - $keys[3] => $this->getDbMime(), - $keys[4] => $this->getDbFtype(), - $keys[5] => $this->getDbDirectory(), - $keys[6] => $this->getDbFilepath(), - $keys[7] => $this->getDbState(), - $keys[8] => $this->getDbCurrentlyaccessing(), - $keys[9] => $this->getDbEditedby(), - $keys[10] => $this->getDbMtime(), - $keys[11] => $this->getDbMd5(), - $keys[12] => $this->getDbTrackTitle(), - $keys[13] => $this->getDbArtistName(), - $keys[14] => $this->getDbBitRate(), - $keys[15] => $this->getDbSampleRate(), - $keys[16] => $this->getDbFormat(), - $keys[17] => $this->getDbLength(), - $keys[18] => $this->getDbAlbumTitle(), - $keys[19] => $this->getDbGenre(), - $keys[20] => $this->getDbComments(), - $keys[21] => $this->getDbYear(), - $keys[22] => $this->getDbTrackNumber(), - $keys[23] => $this->getDbChannels(), - $keys[24] => $this->getDbUrl(), - $keys[25] => $this->getDbBpm(), - $keys[26] => $this->getDbRating(), - $keys[27] => $this->getDbEncodedBy(), - $keys[28] => $this->getDbDiscNumber(), - $keys[29] => $this->getDbMood(), - $keys[30] => $this->getDbLabel(), - $keys[31] => $this->getDbComposer(), - $keys[32] => $this->getDbEncoder(), - $keys[33] => $this->getDbChecksum(), - $keys[34] => $this->getDbLyrics(), - $keys[35] => $this->getDbOrchestra(), - $keys[36] => $this->getDbConductor(), - $keys[37] => $this->getDbLyricist(), - $keys[38] => $this->getDbOriginalLyricist(), - $keys[39] => $this->getDbRadioStationName(), - $keys[40] => $this->getDbInfoUrl(), - $keys[41] => $this->getDbArtistUrl(), - $keys[42] => $this->getDbAudioSourceUrl(), - $keys[43] => $this->getDbRadioStationUrl(), - $keys[44] => $this->getDbBuyThisUrl(), - $keys[45] => $this->getDbIsrcNumber(), - $keys[46] => $this->getDbCatalogNumber(), - $keys[47] => $this->getDbOriginalArtist(), - $keys[48] => $this->getDbCopyright(), - $keys[49] => $this->getDbReportDatetime(), - $keys[50] => $this->getDbReportLocation(), - $keys[51] => $this->getDbReportOrganization(), - $keys[52] => $this->getDbSubject(), - $keys[53] => $this->getDbContributor(), - $keys[54] => $this->getDbLanguage(), - $keys[55] => $this->getDbSoundcloudId(), - $keys[56] => $this->getDbSoundcloudErrorCode(), - $keys[57] => $this->getDbSoundcloudErrorMsg(), - $keys[58] => $this->getDbSoundcloudLinkToFile(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcMusicDirs) { - $result['CcMusicDirs'] = $this->aCcMusicDirs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcFilesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbGunid($value); - break; - case 2: - $this->setDbName($value); - break; - case 3: - $this->setDbMime($value); - break; - case 4: - $this->setDbFtype($value); - break; - case 5: - $this->setDbDirectory($value); - break; - case 6: - $this->setDbFilepath($value); - break; - case 7: - $this->setDbState($value); - break; - case 8: - $this->setDbCurrentlyaccessing($value); - break; - case 9: - $this->setDbEditedby($value); - break; - case 10: - $this->setDbMtime($value); - break; - case 11: - $this->setDbMd5($value); - break; - case 12: - $this->setDbTrackTitle($value); - break; - case 13: - $this->setDbArtistName($value); - break; - case 14: - $this->setDbBitRate($value); - break; - case 15: - $this->setDbSampleRate($value); - break; - case 16: - $this->setDbFormat($value); - break; - case 17: - $this->setDbLength($value); - break; - case 18: - $this->setDbAlbumTitle($value); - break; - case 19: - $this->setDbGenre($value); - break; - case 20: - $this->setDbComments($value); - break; - case 21: - $this->setDbYear($value); - break; - case 22: - $this->setDbTrackNumber($value); - break; - case 23: - $this->setDbChannels($value); - break; - case 24: - $this->setDbUrl($value); - break; - case 25: - $this->setDbBpm($value); - break; - case 26: - $this->setDbRating($value); - break; - case 27: - $this->setDbEncodedBy($value); - break; - case 28: - $this->setDbDiscNumber($value); - break; - case 29: - $this->setDbMood($value); - break; - case 30: - $this->setDbLabel($value); - break; - case 31: - $this->setDbComposer($value); - break; - case 32: - $this->setDbEncoder($value); - break; - case 33: - $this->setDbChecksum($value); - break; - case 34: - $this->setDbLyrics($value); - break; - case 35: - $this->setDbOrchestra($value); - break; - case 36: - $this->setDbConductor($value); - break; - case 37: - $this->setDbLyricist($value); - break; - case 38: - $this->setDbOriginalLyricist($value); - break; - case 39: - $this->setDbRadioStationName($value); - break; - case 40: - $this->setDbInfoUrl($value); - break; - case 41: - $this->setDbArtistUrl($value); - break; - case 42: - $this->setDbAudioSourceUrl($value); - break; - case 43: - $this->setDbRadioStationUrl($value); - break; - case 44: - $this->setDbBuyThisUrl($value); - break; - case 45: - $this->setDbIsrcNumber($value); - break; - case 46: - $this->setDbCatalogNumber($value); - break; - case 47: - $this->setDbOriginalArtist($value); - break; - case 48: - $this->setDbCopyright($value); - break; - case 49: - $this->setDbReportDatetime($value); - break; - case 50: - $this->setDbReportLocation($value); - break; - case 51: - $this->setDbReportOrganization($value); - break; - case 52: - $this->setDbSubject($value); - break; - case 53: - $this->setDbContributor($value); - break; - case 54: - $this->setDbLanguage($value); - break; - case 55: - $this->setDbSoundcloudId($value); - break; - case 56: - $this->setDbSoundcloudErrorCode($value); - break; - case 57: - $this->setDbSoundcloudErrorMsg($value); - break; - case 58: - $this->setDbSoundcloudLinkToFile($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcFilesPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbGunid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbName($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbMime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbFtype($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbDirectory($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbFilepath($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbState($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbEditedby($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbMtime($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDbMd5($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setDbTrackTitle($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setDbArtistName($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setDbBitRate($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setDbSampleRate($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setDbFormat($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setDbLength($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setDbAlbumTitle($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setDbGenre($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setDbComments($arr[$keys[20]]); - if (array_key_exists($keys[21], $arr)) $this->setDbYear($arr[$keys[21]]); - if (array_key_exists($keys[22], $arr)) $this->setDbTrackNumber($arr[$keys[22]]); - if (array_key_exists($keys[23], $arr)) $this->setDbChannels($arr[$keys[23]]); - if (array_key_exists($keys[24], $arr)) $this->setDbUrl($arr[$keys[24]]); - if (array_key_exists($keys[25], $arr)) $this->setDbBpm($arr[$keys[25]]); - if (array_key_exists($keys[26], $arr)) $this->setDbRating($arr[$keys[26]]); - if (array_key_exists($keys[27], $arr)) $this->setDbEncodedBy($arr[$keys[27]]); - if (array_key_exists($keys[28], $arr)) $this->setDbDiscNumber($arr[$keys[28]]); - if (array_key_exists($keys[29], $arr)) $this->setDbMood($arr[$keys[29]]); - if (array_key_exists($keys[30], $arr)) $this->setDbLabel($arr[$keys[30]]); - if (array_key_exists($keys[31], $arr)) $this->setDbComposer($arr[$keys[31]]); - if (array_key_exists($keys[32], $arr)) $this->setDbEncoder($arr[$keys[32]]); - if (array_key_exists($keys[33], $arr)) $this->setDbChecksum($arr[$keys[33]]); - if (array_key_exists($keys[34], $arr)) $this->setDbLyrics($arr[$keys[34]]); - if (array_key_exists($keys[35], $arr)) $this->setDbOrchestra($arr[$keys[35]]); - if (array_key_exists($keys[36], $arr)) $this->setDbConductor($arr[$keys[36]]); - if (array_key_exists($keys[37], $arr)) $this->setDbLyricist($arr[$keys[37]]); - if (array_key_exists($keys[38], $arr)) $this->setDbOriginalLyricist($arr[$keys[38]]); - if (array_key_exists($keys[39], $arr)) $this->setDbRadioStationName($arr[$keys[39]]); - if (array_key_exists($keys[40], $arr)) $this->setDbInfoUrl($arr[$keys[40]]); - if (array_key_exists($keys[41], $arr)) $this->setDbArtistUrl($arr[$keys[41]]); - if (array_key_exists($keys[42], $arr)) $this->setDbAudioSourceUrl($arr[$keys[42]]); - if (array_key_exists($keys[43], $arr)) $this->setDbRadioStationUrl($arr[$keys[43]]); - if (array_key_exists($keys[44], $arr)) $this->setDbBuyThisUrl($arr[$keys[44]]); - if (array_key_exists($keys[45], $arr)) $this->setDbIsrcNumber($arr[$keys[45]]); - if (array_key_exists($keys[46], $arr)) $this->setDbCatalogNumber($arr[$keys[46]]); - if (array_key_exists($keys[47], $arr)) $this->setDbOriginalArtist($arr[$keys[47]]); - if (array_key_exists($keys[48], $arr)) $this->setDbCopyright($arr[$keys[48]]); - if (array_key_exists($keys[49], $arr)) $this->setDbReportDatetime($arr[$keys[49]]); - if (array_key_exists($keys[50], $arr)) $this->setDbReportLocation($arr[$keys[50]]); - if (array_key_exists($keys[51], $arr)) $this->setDbReportOrganization($arr[$keys[51]]); - if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]); - if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]); - if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]); - if (array_key_exists($keys[55], $arr)) $this->setDbSoundcloudId($arr[$keys[55]]); - if (array_key_exists($keys[56], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[56]]); - if (array_key_exists($keys[57], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[57]]); - if (array_key_exists($keys[58], $arr)) $this->setDbSoundcloudLinkToFile($arr[$keys[58]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcFilesPeer::ID)) $criteria->add(CcFilesPeer::ID, $this->id); - if ($this->isColumnModified(CcFilesPeer::GUNID)) $criteria->add(CcFilesPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcFilesPeer::NAME)) $criteria->add(CcFilesPeer::NAME, $this->name); - if ($this->isColumnModified(CcFilesPeer::MIME)) $criteria->add(CcFilesPeer::MIME, $this->mime); - if ($this->isColumnModified(CcFilesPeer::FTYPE)) $criteria->add(CcFilesPeer::FTYPE, $this->ftype); - if ($this->isColumnModified(CcFilesPeer::DIRECTORY)) $criteria->add(CcFilesPeer::DIRECTORY, $this->directory); - if ($this->isColumnModified(CcFilesPeer::FILEPATH)) $criteria->add(CcFilesPeer::FILEPATH, $this->filepath); - if ($this->isColumnModified(CcFilesPeer::STATE)) $criteria->add(CcFilesPeer::STATE, $this->state); - if ($this->isColumnModified(CcFilesPeer::CURRENTLYACCESSING)) $criteria->add(CcFilesPeer::CURRENTLYACCESSING, $this->currentlyaccessing); - if ($this->isColumnModified(CcFilesPeer::EDITEDBY)) $criteria->add(CcFilesPeer::EDITEDBY, $this->editedby); - if ($this->isColumnModified(CcFilesPeer::MTIME)) $criteria->add(CcFilesPeer::MTIME, $this->mtime); - if ($this->isColumnModified(CcFilesPeer::MD5)) $criteria->add(CcFilesPeer::MD5, $this->md5); - if ($this->isColumnModified(CcFilesPeer::TRACK_TITLE)) $criteria->add(CcFilesPeer::TRACK_TITLE, $this->track_title); - if ($this->isColumnModified(CcFilesPeer::ARTIST_NAME)) $criteria->add(CcFilesPeer::ARTIST_NAME, $this->artist_name); - if ($this->isColumnModified(CcFilesPeer::BIT_RATE)) $criteria->add(CcFilesPeer::BIT_RATE, $this->bit_rate); - if ($this->isColumnModified(CcFilesPeer::SAMPLE_RATE)) $criteria->add(CcFilesPeer::SAMPLE_RATE, $this->sample_rate); - if ($this->isColumnModified(CcFilesPeer::FORMAT)) $criteria->add(CcFilesPeer::FORMAT, $this->format); - if ($this->isColumnModified(CcFilesPeer::LENGTH)) $criteria->add(CcFilesPeer::LENGTH, $this->length); - if ($this->isColumnModified(CcFilesPeer::ALBUM_TITLE)) $criteria->add(CcFilesPeer::ALBUM_TITLE, $this->album_title); - if ($this->isColumnModified(CcFilesPeer::GENRE)) $criteria->add(CcFilesPeer::GENRE, $this->genre); - if ($this->isColumnModified(CcFilesPeer::COMMENTS)) $criteria->add(CcFilesPeer::COMMENTS, $this->comments); - if ($this->isColumnModified(CcFilesPeer::YEAR)) $criteria->add(CcFilesPeer::YEAR, $this->year); - if ($this->isColumnModified(CcFilesPeer::TRACK_NUMBER)) $criteria->add(CcFilesPeer::TRACK_NUMBER, $this->track_number); - if ($this->isColumnModified(CcFilesPeer::CHANNELS)) $criteria->add(CcFilesPeer::CHANNELS, $this->channels); - if ($this->isColumnModified(CcFilesPeer::URL)) $criteria->add(CcFilesPeer::URL, $this->url); - if ($this->isColumnModified(CcFilesPeer::BPM)) $criteria->add(CcFilesPeer::BPM, $this->bpm); - if ($this->isColumnModified(CcFilesPeer::RATING)) $criteria->add(CcFilesPeer::RATING, $this->rating); - if ($this->isColumnModified(CcFilesPeer::ENCODED_BY)) $criteria->add(CcFilesPeer::ENCODED_BY, $this->encoded_by); - if ($this->isColumnModified(CcFilesPeer::DISC_NUMBER)) $criteria->add(CcFilesPeer::DISC_NUMBER, $this->disc_number); - if ($this->isColumnModified(CcFilesPeer::MOOD)) $criteria->add(CcFilesPeer::MOOD, $this->mood); - if ($this->isColumnModified(CcFilesPeer::LABEL)) $criteria->add(CcFilesPeer::LABEL, $this->label); - if ($this->isColumnModified(CcFilesPeer::COMPOSER)) $criteria->add(CcFilesPeer::COMPOSER, $this->composer); - if ($this->isColumnModified(CcFilesPeer::ENCODER)) $criteria->add(CcFilesPeer::ENCODER, $this->encoder); - if ($this->isColumnModified(CcFilesPeer::CHECKSUM)) $criteria->add(CcFilesPeer::CHECKSUM, $this->checksum); - if ($this->isColumnModified(CcFilesPeer::LYRICS)) $criteria->add(CcFilesPeer::LYRICS, $this->lyrics); - if ($this->isColumnModified(CcFilesPeer::ORCHESTRA)) $criteria->add(CcFilesPeer::ORCHESTRA, $this->orchestra); - if ($this->isColumnModified(CcFilesPeer::CONDUCTOR)) $criteria->add(CcFilesPeer::CONDUCTOR, $this->conductor); - if ($this->isColumnModified(CcFilesPeer::LYRICIST)) $criteria->add(CcFilesPeer::LYRICIST, $this->lyricist); - if ($this->isColumnModified(CcFilesPeer::ORIGINAL_LYRICIST)) $criteria->add(CcFilesPeer::ORIGINAL_LYRICIST, $this->original_lyricist); - if ($this->isColumnModified(CcFilesPeer::RADIO_STATION_NAME)) $criteria->add(CcFilesPeer::RADIO_STATION_NAME, $this->radio_station_name); - if ($this->isColumnModified(CcFilesPeer::INFO_URL)) $criteria->add(CcFilesPeer::INFO_URL, $this->info_url); - if ($this->isColumnModified(CcFilesPeer::ARTIST_URL)) $criteria->add(CcFilesPeer::ARTIST_URL, $this->artist_url); - if ($this->isColumnModified(CcFilesPeer::AUDIO_SOURCE_URL)) $criteria->add(CcFilesPeer::AUDIO_SOURCE_URL, $this->audio_source_url); - if ($this->isColumnModified(CcFilesPeer::RADIO_STATION_URL)) $criteria->add(CcFilesPeer::RADIO_STATION_URL, $this->radio_station_url); - if ($this->isColumnModified(CcFilesPeer::BUY_THIS_URL)) $criteria->add(CcFilesPeer::BUY_THIS_URL, $this->buy_this_url); - if ($this->isColumnModified(CcFilesPeer::ISRC_NUMBER)) $criteria->add(CcFilesPeer::ISRC_NUMBER, $this->isrc_number); - if ($this->isColumnModified(CcFilesPeer::CATALOG_NUMBER)) $criteria->add(CcFilesPeer::CATALOG_NUMBER, $this->catalog_number); - if ($this->isColumnModified(CcFilesPeer::ORIGINAL_ARTIST)) $criteria->add(CcFilesPeer::ORIGINAL_ARTIST, $this->original_artist); - if ($this->isColumnModified(CcFilesPeer::COPYRIGHT)) $criteria->add(CcFilesPeer::COPYRIGHT, $this->copyright); - if ($this->isColumnModified(CcFilesPeer::REPORT_DATETIME)) $criteria->add(CcFilesPeer::REPORT_DATETIME, $this->report_datetime); - if ($this->isColumnModified(CcFilesPeer::REPORT_LOCATION)) $criteria->add(CcFilesPeer::REPORT_LOCATION, $this->report_location); - if ($this->isColumnModified(CcFilesPeer::REPORT_ORGANIZATION)) $criteria->add(CcFilesPeer::REPORT_ORGANIZATION, $this->report_organization); - if ($this->isColumnModified(CcFilesPeer::SUBJECT)) $criteria->add(CcFilesPeer::SUBJECT, $this->subject); - if ($this->isColumnModified(CcFilesPeer::CONTRIBUTOR)) $criteria->add(CcFilesPeer::CONTRIBUTOR, $this->contributor); - if ($this->isColumnModified(CcFilesPeer::LANGUAGE)) $criteria->add(CcFilesPeer::LANGUAGE, $this->language); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ID)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ID, $this->soundcloud_id); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_CODE)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $this->soundcloud_error_code); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_MSG)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $this->soundcloud_error_msg); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE)) $criteria->add(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, $this->soundcloud_link_to_file); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcFiles (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbGunid($this->gunid); - $copyObj->setDbName($this->name); - $copyObj->setDbMime($this->mime); - $copyObj->setDbFtype($this->ftype); - $copyObj->setDbDirectory($this->directory); - $copyObj->setDbFilepath($this->filepath); - $copyObj->setDbState($this->state); - $copyObj->setDbCurrentlyaccessing($this->currentlyaccessing); - $copyObj->setDbEditedby($this->editedby); - $copyObj->setDbMtime($this->mtime); - $copyObj->setDbMd5($this->md5); - $copyObj->setDbTrackTitle($this->track_title); - $copyObj->setDbArtistName($this->artist_name); - $copyObj->setDbBitRate($this->bit_rate); - $copyObj->setDbSampleRate($this->sample_rate); - $copyObj->setDbFormat($this->format); - $copyObj->setDbLength($this->length); - $copyObj->setDbAlbumTitle($this->album_title); - $copyObj->setDbGenre($this->genre); - $copyObj->setDbComments($this->comments); - $copyObj->setDbYear($this->year); - $copyObj->setDbTrackNumber($this->track_number); - $copyObj->setDbChannels($this->channels); - $copyObj->setDbUrl($this->url); - $copyObj->setDbBpm($this->bpm); - $copyObj->setDbRating($this->rating); - $copyObj->setDbEncodedBy($this->encoded_by); - $copyObj->setDbDiscNumber($this->disc_number); - $copyObj->setDbMood($this->mood); - $copyObj->setDbLabel($this->label); - $copyObj->setDbComposer($this->composer); - $copyObj->setDbEncoder($this->encoder); - $copyObj->setDbChecksum($this->checksum); - $copyObj->setDbLyrics($this->lyrics); - $copyObj->setDbOrchestra($this->orchestra); - $copyObj->setDbConductor($this->conductor); - $copyObj->setDbLyricist($this->lyricist); - $copyObj->setDbOriginalLyricist($this->original_lyricist); - $copyObj->setDbRadioStationName($this->radio_station_name); - $copyObj->setDbInfoUrl($this->info_url); - $copyObj->setDbArtistUrl($this->artist_url); - $copyObj->setDbAudioSourceUrl($this->audio_source_url); - $copyObj->setDbRadioStationUrl($this->radio_station_url); - $copyObj->setDbBuyThisUrl($this->buy_this_url); - $copyObj->setDbIsrcNumber($this->isrc_number); - $copyObj->setDbCatalogNumber($this->catalog_number); - $copyObj->setDbOriginalArtist($this->original_artist); - $copyObj->setDbCopyright($this->copyright); - $copyObj->setDbReportDatetime($this->report_datetime); - $copyObj->setDbReportLocation($this->report_location); - $copyObj->setDbReportOrganization($this->report_organization); - $copyObj->setDbSubject($this->subject); - $copyObj->setDbContributor($this->contributor); - $copyObj->setDbLanguage($this->language); - $copyObj->setDbSoundcloudId($this->soundcloud_id); - $copyObj->setDbSoundcloudErrorCode($this->soundcloud_error_code); - $copyObj->setDbSoundcloudErrorMsg($this->soundcloud_error_msg); - $copyObj->setDbSoundcloudLinkToFile($this->soundcloud_link_to_file); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $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->getCcPlaylistcontentss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylistcontents($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSchedules() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSchedule($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcFiles Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcFilesPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcFilesPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcFiles The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbEditedby(NULL); - } else { - $this->setDbEditedby($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcFiles($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->editedby !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->editedby, $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->aCcSubjs->addCcFiless($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Declares an association between this object and a CcMusicDirs object. - * - * @param CcMusicDirs $v - * @return CcFiles The current object (for fluent API support) - * @throws PropelException - */ - public function setCcMusicDirs(CcMusicDirs $v = null) - { - if ($v === null) { - $this->setDbDirectory(NULL); - } else { - $this->setDbDirectory($v->getId()); - } - - $this->aCcMusicDirs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcMusicDirs object, it will not be re-added. - if ($v !== null) { - $v->addCcFiles($this); - } - - return $this; - } - - - /** - * Get the associated CcMusicDirs object - * - * @param PropelPDO Optional Connection object. - * @return CcMusicDirs The associated CcMusicDirs object. - * @throws PropelException - */ - public function getCcMusicDirs(PropelPDO $con = null) - { - if ($this->aCcMusicDirs === null && ($this->directory !== null)) { - $this->aCcMusicDirs = CcMusicDirsQuery::create()->findPk($this->directory, $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->aCcMusicDirs->addCcFiless($this); - */ - } - return $this->aCcMusicDirs; - } - - /** - * 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 CcFiles 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) - ->filterByCcFiles($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 - ->filterByCcFiles($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->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShowInstancesRelatedByDbOriginalShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShowInstancesRelatedByDbOriginalShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - /** - * Clears out the collCcPlaylistcontentss 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 addCcPlaylistcontentss() - */ - public function clearCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylistcontentss collection. - * - * By default this just sets the collCcPlaylistcontentss collection to an empty array (like clearcollCcPlaylistcontentss()); - * 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 initCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = new PropelObjectCollection(); - $this->collCcPlaylistcontentss->setModel('CcPlaylistcontents'); - } - - /** - * Gets an array of CcPlaylistcontents 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 CcFiles 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 CcPlaylistcontents[] List of CcPlaylistcontents objects - * @throws PropelException - */ - public function getCcPlaylistcontentss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - // return empty collection - $this->initCcPlaylistcontentss(); - } else { - $collCcPlaylistcontentss = CcPlaylistcontentsQuery::create(null, $criteria) - ->filterByCcFiles($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylistcontentss; - } - $this->collCcPlaylistcontentss = $collCcPlaylistcontentss; - } - } - return $this->collCcPlaylistcontentss; - } - - /** - * Returns the number of related CcPlaylistcontents objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylistcontents objects. - * @throws PropelException - */ - public function countCcPlaylistcontentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - return 0; - } else { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcFiles($this) - ->count($con); - } - } else { - return count($this->collCcPlaylistcontentss); - } - } - - /** - * Method called to associate a CcPlaylistcontents object to this object - * through the CcPlaylistcontents foreign key attribute. - * - * @param CcPlaylistcontents $l CcPlaylistcontents - * @return void - * @throws PropelException - */ - public function addCcPlaylistcontents(CcPlaylistcontents $l) - { - if ($this->collCcPlaylistcontentss === null) { - $this->initCcPlaylistcontentss(); - } - if (!$this->collCcPlaylistcontentss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylistcontentss[]= $l; - $l->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcPlaylistcontentss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects - */ - public function getCcPlaylistcontentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - $query->joinWith('CcPlaylist', $join_behavior); - - return $this->getCcPlaylistcontentss($query, $con); - } - - /** - * Clears out the collCcSchedules 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 addCcSchedules() - */ - public function clearCcSchedules() - { - $this->collCcSchedules = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSchedules collection. - * - * By default this just sets the collCcSchedules collection to an empty array (like clearcollCcSchedules()); - * 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 initCcSchedules() - { - $this->collCcSchedules = new PropelObjectCollection(); - $this->collCcSchedules->setModel('CcSchedule'); - } - - /** - * Gets an array of CcSchedule 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 CcFiles 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 CcSchedule[] List of CcSchedule objects - * @throws PropelException - */ - public function getCcSchedules($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - // return empty collection - $this->initCcSchedules(); - } else { - $collCcSchedules = CcScheduleQuery::create(null, $criteria) - ->filterByCcFiles($this) - ->find($con); - if (null !== $criteria) { - return $collCcSchedules; - } - $this->collCcSchedules = $collCcSchedules; - } - } - return $this->collCcSchedules; - } - - /** - * Returns the number of related CcSchedule objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSchedule objects. - * @throws PropelException - */ - public function countCcSchedules(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - return 0; - } else { - $query = CcScheduleQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcFiles($this) - ->count($con); - } - } else { - return count($this->collCcSchedules); - } - } - - /** - * Method called to associate a CcSchedule object to this object - * through the CcSchedule foreign key attribute. - * - * @param CcSchedule $l CcSchedule - * @return void - * @throws PropelException - */ - public function addCcSchedule(CcSchedule $l) - { - if ($this->collCcSchedules === null) { - $this->initCcSchedules(); - } - if (!$this->collCcSchedules->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSchedules[]= $l; - $l->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcSchedules from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcSchedule[] List of CcSchedule objects - */ - public function getCcSchedulesJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcScheduleQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcSchedules($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->gunid = null; - $this->name = null; - $this->mime = null; - $this->ftype = null; - $this->directory = null; - $this->filepath = null; - $this->state = null; - $this->currentlyaccessing = null; - $this->editedby = null; - $this->mtime = null; - $this->md5 = null; - $this->track_title = null; - $this->artist_name = null; - $this->bit_rate = null; - $this->sample_rate = null; - $this->format = null; - $this->length = null; - $this->album_title = null; - $this->genre = null; - $this->comments = null; - $this->year = null; - $this->track_number = null; - $this->channels = null; - $this->url = null; - $this->bpm = null; - $this->rating = null; - $this->encoded_by = null; - $this->disc_number = null; - $this->mood = null; - $this->label = null; - $this->composer = null; - $this->encoder = null; - $this->checksum = null; - $this->lyrics = null; - $this->orchestra = null; - $this->conductor = null; - $this->lyricist = null; - $this->original_lyricist = null; - $this->radio_station_name = null; - $this->info_url = null; - $this->artist_url = null; - $this->audio_source_url = null; - $this->radio_station_url = null; - $this->buy_this_url = null; - $this->isrc_number = null; - $this->catalog_number = null; - $this->original_artist = null; - $this->copyright = null; - $this->report_datetime = null; - $this->report_location = null; - $this->report_organization = null; - $this->subject = null; - $this->contributor = null; - $this->language = null; - $this->soundcloud_id = null; - $this->soundcloud_error_code = null; - $this->soundcloud_error_msg = null; - $this->soundcloud_link_to_file = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancess) { - foreach ((array) $this->collCcShowInstancess as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPlaylistcontentss) { - foreach ((array) $this->collCcPlaylistcontentss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSchedules) { - foreach ((array) $this->collCcSchedules as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancess = null; - $this->collCcPlaylistcontentss = null; - $this->collCcSchedules = null; - $this->aCcSubjs = null; - $this->aCcMusicDirs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcFiles diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesPeer.php deleted file mode 100644 index e08728cfd..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesPeer.php +++ /dev/null @@ -1,1654 +0,0 @@ - array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, ) - ); - - /** - * 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, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, 'DbSoundcloudId' => 55, 'DbSoundcloudErrorCode' => 56, 'DbSoundcloudErrorMsg' => 57, 'DbSoundcloudLinkToFile' => 58, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, 'dbSoundcloudId' => 55, 'dbSoundcloudErrorCode' => 56, 'dbSoundcloudErrorMsg' => 57, 'dbSoundcloudLinkToFile' => 58, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, self::SOUNDCLOUD_ID => 55, self::SOUNDCLOUD_ERROR_CODE => 56, self::SOUNDCLOUD_ERROR_MSG => 57, self::SOUNDCLOUD_LINK_TO_FILE => 58, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, 'SOUNDCLOUD_ID' => 55, 'SOUNDCLOUD_ERROR_CODE' => 56, 'SOUNDCLOUD_ERROR_MSG' => 57, 'SOUNDCLOUD_LINK_TO_FILE' => 58, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, 'soundcloud_id' => 55, 'soundcloud_error_code' => 56, 'soundcloud_error_msg' => 57, 'soundcloud_link_to_file' => 58, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcFilesPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcFilesPeer::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(CcFilesPeer::ID); - $criteria->addSelectColumn(CcFilesPeer::GUNID); - $criteria->addSelectColumn(CcFilesPeer::NAME); - $criteria->addSelectColumn(CcFilesPeer::MIME); - $criteria->addSelectColumn(CcFilesPeer::FTYPE); - $criteria->addSelectColumn(CcFilesPeer::DIRECTORY); - $criteria->addSelectColumn(CcFilesPeer::FILEPATH); - $criteria->addSelectColumn(CcFilesPeer::STATE); - $criteria->addSelectColumn(CcFilesPeer::CURRENTLYACCESSING); - $criteria->addSelectColumn(CcFilesPeer::EDITEDBY); - $criteria->addSelectColumn(CcFilesPeer::MTIME); - $criteria->addSelectColumn(CcFilesPeer::MD5); - $criteria->addSelectColumn(CcFilesPeer::TRACK_TITLE); - $criteria->addSelectColumn(CcFilesPeer::ARTIST_NAME); - $criteria->addSelectColumn(CcFilesPeer::BIT_RATE); - $criteria->addSelectColumn(CcFilesPeer::SAMPLE_RATE); - $criteria->addSelectColumn(CcFilesPeer::FORMAT); - $criteria->addSelectColumn(CcFilesPeer::LENGTH); - $criteria->addSelectColumn(CcFilesPeer::ALBUM_TITLE); - $criteria->addSelectColumn(CcFilesPeer::GENRE); - $criteria->addSelectColumn(CcFilesPeer::COMMENTS); - $criteria->addSelectColumn(CcFilesPeer::YEAR); - $criteria->addSelectColumn(CcFilesPeer::TRACK_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::CHANNELS); - $criteria->addSelectColumn(CcFilesPeer::URL); - $criteria->addSelectColumn(CcFilesPeer::BPM); - $criteria->addSelectColumn(CcFilesPeer::RATING); - $criteria->addSelectColumn(CcFilesPeer::ENCODED_BY); - $criteria->addSelectColumn(CcFilesPeer::DISC_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::MOOD); - $criteria->addSelectColumn(CcFilesPeer::LABEL); - $criteria->addSelectColumn(CcFilesPeer::COMPOSER); - $criteria->addSelectColumn(CcFilesPeer::ENCODER); - $criteria->addSelectColumn(CcFilesPeer::CHECKSUM); - $criteria->addSelectColumn(CcFilesPeer::LYRICS); - $criteria->addSelectColumn(CcFilesPeer::ORCHESTRA); - $criteria->addSelectColumn(CcFilesPeer::CONDUCTOR); - $criteria->addSelectColumn(CcFilesPeer::LYRICIST); - $criteria->addSelectColumn(CcFilesPeer::ORIGINAL_LYRICIST); - $criteria->addSelectColumn(CcFilesPeer::RADIO_STATION_NAME); - $criteria->addSelectColumn(CcFilesPeer::INFO_URL); - $criteria->addSelectColumn(CcFilesPeer::ARTIST_URL); - $criteria->addSelectColumn(CcFilesPeer::AUDIO_SOURCE_URL); - $criteria->addSelectColumn(CcFilesPeer::RADIO_STATION_URL); - $criteria->addSelectColumn(CcFilesPeer::BUY_THIS_URL); - $criteria->addSelectColumn(CcFilesPeer::ISRC_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::CATALOG_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::ORIGINAL_ARTIST); - $criteria->addSelectColumn(CcFilesPeer::COPYRIGHT); - $criteria->addSelectColumn(CcFilesPeer::REPORT_DATETIME); - $criteria->addSelectColumn(CcFilesPeer::REPORT_LOCATION); - $criteria->addSelectColumn(CcFilesPeer::REPORT_ORGANIZATION); - $criteria->addSelectColumn(CcFilesPeer::SUBJECT); - $criteria->addSelectColumn(CcFilesPeer::CONTRIBUTOR); - $criteria->addSelectColumn(CcFilesPeer::LANGUAGE); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ID); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_CODE); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_MSG); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.MIME'); - $criteria->addSelectColumn($alias . '.FTYPE'); - $criteria->addSelectColumn($alias . '.DIRECTORY'); - $criteria->addSelectColumn($alias . '.FILEPATH'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.CURRENTLYACCESSING'); - $criteria->addSelectColumn($alias . '.EDITEDBY'); - $criteria->addSelectColumn($alias . '.MTIME'); - $criteria->addSelectColumn($alias . '.MD5'); - $criteria->addSelectColumn($alias . '.TRACK_TITLE'); - $criteria->addSelectColumn($alias . '.ARTIST_NAME'); - $criteria->addSelectColumn($alias . '.BIT_RATE'); - $criteria->addSelectColumn($alias . '.SAMPLE_RATE'); - $criteria->addSelectColumn($alias . '.FORMAT'); - $criteria->addSelectColumn($alias . '.LENGTH'); - $criteria->addSelectColumn($alias . '.ALBUM_TITLE'); - $criteria->addSelectColumn($alias . '.GENRE'); - $criteria->addSelectColumn($alias . '.COMMENTS'); - $criteria->addSelectColumn($alias . '.YEAR'); - $criteria->addSelectColumn($alias . '.TRACK_NUMBER'); - $criteria->addSelectColumn($alias . '.CHANNELS'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.BPM'); - $criteria->addSelectColumn($alias . '.RATING'); - $criteria->addSelectColumn($alias . '.ENCODED_BY'); - $criteria->addSelectColumn($alias . '.DISC_NUMBER'); - $criteria->addSelectColumn($alias . '.MOOD'); - $criteria->addSelectColumn($alias . '.LABEL'); - $criteria->addSelectColumn($alias . '.COMPOSER'); - $criteria->addSelectColumn($alias . '.ENCODER'); - $criteria->addSelectColumn($alias . '.CHECKSUM'); - $criteria->addSelectColumn($alias . '.LYRICS'); - $criteria->addSelectColumn($alias . '.ORCHESTRA'); - $criteria->addSelectColumn($alias . '.CONDUCTOR'); - $criteria->addSelectColumn($alias . '.LYRICIST'); - $criteria->addSelectColumn($alias . '.ORIGINAL_LYRICIST'); - $criteria->addSelectColumn($alias . '.RADIO_STATION_NAME'); - $criteria->addSelectColumn($alias . '.INFO_URL'); - $criteria->addSelectColumn($alias . '.ARTIST_URL'); - $criteria->addSelectColumn($alias . '.AUDIO_SOURCE_URL'); - $criteria->addSelectColumn($alias . '.RADIO_STATION_URL'); - $criteria->addSelectColumn($alias . '.BUY_THIS_URL'); - $criteria->addSelectColumn($alias . '.ISRC_NUMBER'); - $criteria->addSelectColumn($alias . '.CATALOG_NUMBER'); - $criteria->addSelectColumn($alias . '.ORIGINAL_ARTIST'); - $criteria->addSelectColumn($alias . '.COPYRIGHT'); - $criteria->addSelectColumn($alias . '.REPORT_DATETIME'); - $criteria->addSelectColumn($alias . '.REPORT_LOCATION'); - $criteria->addSelectColumn($alias . '.REPORT_ORGANIZATION'); - $criteria->addSelectColumn($alias . '.SUBJECT'); - $criteria->addSelectColumn($alias . '.CONTRIBUTOR'); - $criteria->addSelectColumn($alias . '.LANGUAGE'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_CODE'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_MSG'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_LINK_TO_FILE'); - } - } - - /** - * 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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::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 CcFiles - * @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 = CcFilesPeer::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 CcFilesPeer::populateObjects(CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcFilesPeer::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 CcFiles $value A CcFiles object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcFiles $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 CcFiles object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcFiles) { - $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 CcFiles 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 CcFiles 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_files - * by a foreign key with ON DELETE CASCADE - */ - 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 CcPlaylistcontentsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPlaylistcontentsPeer::clearInstancePool(); - // 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 = CcFilesPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcFilesPeer::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; - CcFilesPeer::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 (CcFiles object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcFilesPeer::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 + CcFilesPeer::NUM_COLUMNS; - } else { - $cls = CcFilesPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcMusicDirs 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 doCountJoinCcMusicDirs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcFiles objects pre-filled with their CcSubjs 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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcFiles) to $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcFiles objects pre-filled with their CcMusicDirs 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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcMusicDirs(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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - CcMusicDirsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcMusicDirsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcFiles) to $obj2 (CcMusicDirs) - $obj2->addCcFiles($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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcFiles 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 CcFiles 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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcMusicDirsPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - } // if joined row not null - - // Add objects for joined CcMusicDirs rows - - $key3 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcMusicDirsPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcMusicDirsPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcFiles) to the collection in $obj3 (CcMusicDirs) - $obj3->addCcFiles($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinAllExceptCcSubjs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcMusicDirs 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 doCountJoinAllExceptCcMusicDirs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::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 CcFiles objects pre-filled with all related objects except CcSubjs. - * - * @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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcMusicDirsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcMusicDirs rows - - $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcMusicDirsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcMusicDirs) - $obj2->addCcFiles($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcFiles objects pre-filled with all related objects except CcMusicDirs. - * - * @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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcMusicDirs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - - } // if joined row is 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(BaseCcFilesPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcFilesPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcFilesTableMap()); - } - } - - /** - * 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 ? CcFilesPeer::CLASS_DEFAULT : CcFilesPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcFiles or Criteria object. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcFiles object - } - - if ($criteria->containsKey(CcFilesPeer::ID) && $criteria->keyContainsValue(CcFilesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcFilesPeer::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 CcFiles or Criteria object. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcFilesPeer::ID); - $value = $criteria->remove(CcFilesPeer::ID); - if ($value) { - $selectCriteria->add(CcFilesPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcFilesPeer::TABLE_NAME); - } - - } else { // $values is CcFiles 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_files 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(CcFilesPeer::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(CcFilesPeer::TABLE_NAME, $con, CcFilesPeer::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). - CcFilesPeer::clearInstancePool(); - CcFilesPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcFiles or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::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. - CcFilesPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcFiles) { // it's a model object - // invalidate the cache for this single object - CcFilesPeer::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(CcFilesPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcFilesPeer::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); - CcFilesPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcFiles 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 CcFiles $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(CcFiles $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcFilesPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, CcFilesPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcFiles - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcFilesPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $pk); - - $v = CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $pks, Criteria::IN); - $objs = CcFilesPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcFilesPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcFilesPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesQuery.php deleted file mode 100644 index 36c5f71ed..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcFilesQuery.php +++ /dev/null @@ -1,2094 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcFiles|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcFilesPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcFilesQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcFilesPeer::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 CcFilesQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcFilesPeer::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 CcFilesQuery 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(CcFilesPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $dbGunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbGunid($dbGunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGunid)) { - $dbGunid = str_replace('*', '%', $dbGunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::GUNID, $dbGunid, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the mime column - * - * @param string $dbMime The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMime($dbMime = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMime)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMime)) { - $dbMime = str_replace('*', '%', $dbMime); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MIME, $dbMime, $comparison); - } - - /** - * Filter the query on the ftype column - * - * @param string $dbFtype The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFtype($dbFtype = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFtype)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFtype)) { - $dbFtype = str_replace('*', '%', $dbFtype); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FTYPE, $dbFtype, $comparison); - } - - /** - * Filter the query on the directory column - * - * @param int|array $dbDirectory 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbDirectory($dbDirectory = null, $comparison = null) - { - if (is_array($dbDirectory)) { - $useMinMax = false; - if (isset($dbDirectory['min'])) { - $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbDirectory['max'])) { - $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory, $comparison); - } - - /** - * Filter the query on the filepath column - * - * @param string $dbFilepath The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFilepath($dbFilepath = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFilepath)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFilepath)) { - $dbFilepath = str_replace('*', '%', $dbFilepath); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FILEPATH, $dbFilepath, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $dbState The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbState($dbState = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbState)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbState)) { - $dbState = str_replace('*', '%', $dbState); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::STATE, $dbState, $comparison); - } - - /** - * Filter the query on the currentlyaccessing column - * - * @param int|array $dbCurrentlyaccessing 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCurrentlyaccessing($dbCurrentlyaccessing = null, $comparison = null) - { - if (is_array($dbCurrentlyaccessing)) { - $useMinMax = false; - if (isset($dbCurrentlyaccessing['min'])) { - $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCurrentlyaccessing['max'])) { - $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing, $comparison); - } - - /** - * Filter the query on the editedby column - * - * @param int|array $dbEditedby 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEditedby($dbEditedby = null, $comparison = null) - { - if (is_array($dbEditedby)) { - $useMinMax = false; - if (isset($dbEditedby['min'])) { - $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEditedby['max'])) { - $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby, $comparison); - } - - /** - * Filter the query on the mtime column - * - * @param string|array $dbMtime 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMtime($dbMtime = null, $comparison = null) - { - if (is_array($dbMtime)) { - $useMinMax = false; - if (isset($dbMtime['min'])) { - $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbMtime['max'])) { - $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime, $comparison); - } - - /** - * Filter the query on the md5 column - * - * @param string $dbMd5 The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMd5($dbMd5 = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMd5)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMd5)) { - $dbMd5 = str_replace('*', '%', $dbMd5); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MD5, $dbMd5, $comparison); - } - - /** - * Filter the query on the track_title column - * - * @param string $dbTrackTitle The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbTrackTitle($dbTrackTitle = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbTrackTitle)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbTrackTitle)) { - $dbTrackTitle = str_replace('*', '%', $dbTrackTitle); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::TRACK_TITLE, $dbTrackTitle, $comparison); - } - - /** - * Filter the query on the artist_name column - * - * @param string $dbArtistName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbArtistName($dbArtistName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbArtistName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbArtistName)) { - $dbArtistName = str_replace('*', '%', $dbArtistName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ARTIST_NAME, $dbArtistName, $comparison); - } - - /** - * Filter the query on the bit_rate column - * - * @param string $dbBitRate The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBitRate($dbBitRate = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBitRate)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBitRate)) { - $dbBitRate = str_replace('*', '%', $dbBitRate); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BIT_RATE, $dbBitRate, $comparison); - } - - /** - * Filter the query on the sample_rate column - * - * @param string $dbSampleRate The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSampleRate($dbSampleRate = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSampleRate)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSampleRate)) { - $dbSampleRate = str_replace('*', '%', $dbSampleRate); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SAMPLE_RATE, $dbSampleRate, $comparison); - } - - /** - * Filter the query on the format column - * - * @param string $dbFormat The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFormat($dbFormat = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFormat)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFormat)) { - $dbFormat = str_replace('*', '%', $dbFormat); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FORMAT, $dbFormat, $comparison); - } - - /** - * Filter the query on the length column - * - * @param string|array $dbLength 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLength($dbLength = null, $comparison = null) - { - if (is_array($dbLength)) { - $useMinMax = false; - if (isset($dbLength['min'])) { - $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLength['max'])) { - $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength, $comparison); - } - - /** - * Filter the query on the album_title column - * - * @param string $dbAlbumTitle The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbAlbumTitle($dbAlbumTitle = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbAlbumTitle)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbAlbumTitle)) { - $dbAlbumTitle = str_replace('*', '%', $dbAlbumTitle); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ALBUM_TITLE, $dbAlbumTitle, $comparison); - } - - /** - * Filter the query on the genre column - * - * @param string $dbGenre The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbGenre($dbGenre = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGenre)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGenre)) { - $dbGenre = str_replace('*', '%', $dbGenre); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::GENRE, $dbGenre, $comparison); - } - - /** - * Filter the query on the comments column - * - * @param string $dbComments The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbComments($dbComments = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbComments)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbComments)) { - $dbComments = str_replace('*', '%', $dbComments); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COMMENTS, $dbComments, $comparison); - } - - /** - * Filter the query on the year column - * - * @param string $dbYear The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbYear($dbYear = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbYear)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbYear)) { - $dbYear = str_replace('*', '%', $dbYear); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::YEAR, $dbYear, $comparison); - } - - /** - * Filter the query on the track_number column - * - * @param int|array $dbTrackNumber 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbTrackNumber($dbTrackNumber = null, $comparison = null) - { - if (is_array($dbTrackNumber)) { - $useMinMax = false; - if (isset($dbTrackNumber['min'])) { - $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbTrackNumber['max'])) { - $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber, $comparison); - } - - /** - * Filter the query on the channels column - * - * @param int|array $dbChannels 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbChannels($dbChannels = null, $comparison = null) - { - if (is_array($dbChannels)) { - $useMinMax = false; - if (isset($dbChannels['min'])) { - $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbChannels['max'])) { - $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $dbUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbUrl($dbUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbUrl)) { - $dbUrl = str_replace('*', '%', $dbUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::URL, $dbUrl, $comparison); - } - - /** - * Filter the query on the bpm column - * - * @param string $dbBpm The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBpm($dbBpm = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBpm)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBpm)) { - $dbBpm = str_replace('*', '%', $dbBpm); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BPM, $dbBpm, $comparison); - } - - /** - * Filter the query on the rating column - * - * @param string $dbRating The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRating($dbRating = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRating)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRating)) { - $dbRating = str_replace('*', '%', $dbRating); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RATING, $dbRating, $comparison); - } - - /** - * Filter the query on the encoded_by column - * - * @param string $dbEncodedBy The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEncodedBy($dbEncodedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEncodedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEncodedBy)) { - $dbEncodedBy = str_replace('*', '%', $dbEncodedBy); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ENCODED_BY, $dbEncodedBy, $comparison); - } - - /** - * Filter the query on the disc_number column - * - * @param string $dbDiscNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbDiscNumber($dbDiscNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDiscNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDiscNumber)) { - $dbDiscNumber = str_replace('*', '%', $dbDiscNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::DISC_NUMBER, $dbDiscNumber, $comparison); - } - - /** - * Filter the query on the mood column - * - * @param string $dbMood The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMood($dbMood = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMood)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMood)) { - $dbMood = str_replace('*', '%', $dbMood); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MOOD, $dbMood, $comparison); - } - - /** - * Filter the query on the label column - * - * @param string $dbLabel The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLabel($dbLabel = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLabel)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLabel)) { - $dbLabel = str_replace('*', '%', $dbLabel); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LABEL, $dbLabel, $comparison); - } - - /** - * Filter the query on the composer column - * - * @param string $dbComposer The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbComposer($dbComposer = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbComposer)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbComposer)) { - $dbComposer = str_replace('*', '%', $dbComposer); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COMPOSER, $dbComposer, $comparison); - } - - /** - * Filter the query on the encoder column - * - * @param string $dbEncoder The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEncoder($dbEncoder = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEncoder)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEncoder)) { - $dbEncoder = str_replace('*', '%', $dbEncoder); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ENCODER, $dbEncoder, $comparison); - } - - /** - * Filter the query on the checksum column - * - * @param string $dbChecksum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbChecksum($dbChecksum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbChecksum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbChecksum)) { - $dbChecksum = str_replace('*', '%', $dbChecksum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CHECKSUM, $dbChecksum, $comparison); - } - - /** - * Filter the query on the lyrics column - * - * @param string $dbLyrics The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLyrics($dbLyrics = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLyrics)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLyrics)) { - $dbLyrics = str_replace('*', '%', $dbLyrics); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LYRICS, $dbLyrics, $comparison); - } - - /** - * Filter the query on the orchestra column - * - * @param string $dbOrchestra The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOrchestra($dbOrchestra = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOrchestra)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOrchestra)) { - $dbOrchestra = str_replace('*', '%', $dbOrchestra); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORCHESTRA, $dbOrchestra, $comparison); - } - - /** - * Filter the query on the conductor column - * - * @param string $dbConductor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbConductor($dbConductor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbConductor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbConductor)) { - $dbConductor = str_replace('*', '%', $dbConductor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CONDUCTOR, $dbConductor, $comparison); - } - - /** - * Filter the query on the lyricist column - * - * @param string $dbLyricist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLyricist($dbLyricist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLyricist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLyricist)) { - $dbLyricist = str_replace('*', '%', $dbLyricist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LYRICIST, $dbLyricist, $comparison); - } - - /** - * Filter the query on the original_lyricist column - * - * @param string $dbOriginalLyricist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOriginalLyricist($dbOriginalLyricist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOriginalLyricist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOriginalLyricist)) { - $dbOriginalLyricist = str_replace('*', '%', $dbOriginalLyricist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORIGINAL_LYRICIST, $dbOriginalLyricist, $comparison); - } - - /** - * Filter the query on the radio_station_name column - * - * @param string $dbRadioStationName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRadioStationName($dbRadioStationName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRadioStationName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRadioStationName)) { - $dbRadioStationName = str_replace('*', '%', $dbRadioStationName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RADIO_STATION_NAME, $dbRadioStationName, $comparison); - } - - /** - * Filter the query on the info_url column - * - * @param string $dbInfoUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbInfoUrl($dbInfoUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbInfoUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbInfoUrl)) { - $dbInfoUrl = str_replace('*', '%', $dbInfoUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::INFO_URL, $dbInfoUrl, $comparison); - } - - /** - * Filter the query on the artist_url column - * - * @param string $dbArtistUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbArtistUrl($dbArtistUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbArtistUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbArtistUrl)) { - $dbArtistUrl = str_replace('*', '%', $dbArtistUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ARTIST_URL, $dbArtistUrl, $comparison); - } - - /** - * Filter the query on the audio_source_url column - * - * @param string $dbAudioSourceUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbAudioSourceUrl($dbAudioSourceUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbAudioSourceUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbAudioSourceUrl)) { - $dbAudioSourceUrl = str_replace('*', '%', $dbAudioSourceUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::AUDIO_SOURCE_URL, $dbAudioSourceUrl, $comparison); - } - - /** - * Filter the query on the radio_station_url column - * - * @param string $dbRadioStationUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRadioStationUrl($dbRadioStationUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRadioStationUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRadioStationUrl)) { - $dbRadioStationUrl = str_replace('*', '%', $dbRadioStationUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RADIO_STATION_URL, $dbRadioStationUrl, $comparison); - } - - /** - * Filter the query on the buy_this_url column - * - * @param string $dbBuyThisUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBuyThisUrl($dbBuyThisUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBuyThisUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBuyThisUrl)) { - $dbBuyThisUrl = str_replace('*', '%', $dbBuyThisUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BUY_THIS_URL, $dbBuyThisUrl, $comparison); - } - - /** - * Filter the query on the isrc_number column - * - * @param string $dbIsrcNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbIsrcNumber($dbIsrcNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIsrcNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIsrcNumber)) { - $dbIsrcNumber = str_replace('*', '%', $dbIsrcNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ISRC_NUMBER, $dbIsrcNumber, $comparison); - } - - /** - * Filter the query on the catalog_number column - * - * @param string $dbCatalogNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCatalogNumber($dbCatalogNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCatalogNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCatalogNumber)) { - $dbCatalogNumber = str_replace('*', '%', $dbCatalogNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CATALOG_NUMBER, $dbCatalogNumber, $comparison); - } - - /** - * Filter the query on the original_artist column - * - * @param string $dbOriginalArtist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOriginalArtist($dbOriginalArtist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOriginalArtist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOriginalArtist)) { - $dbOriginalArtist = str_replace('*', '%', $dbOriginalArtist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORIGINAL_ARTIST, $dbOriginalArtist, $comparison); - } - - /** - * Filter the query on the copyright column - * - * @param string $dbCopyright The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCopyright($dbCopyright = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCopyright)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCopyright)) { - $dbCopyright = str_replace('*', '%', $dbCopyright); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COPYRIGHT, $dbCopyright, $comparison); - } - - /** - * Filter the query on the report_datetime column - * - * @param string $dbReportDatetime The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportDatetime($dbReportDatetime = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportDatetime)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportDatetime)) { - $dbReportDatetime = str_replace('*', '%', $dbReportDatetime); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_DATETIME, $dbReportDatetime, $comparison); - } - - /** - * Filter the query on the report_location column - * - * @param string $dbReportLocation The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportLocation($dbReportLocation = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportLocation)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportLocation)) { - $dbReportLocation = str_replace('*', '%', $dbReportLocation); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_LOCATION, $dbReportLocation, $comparison); - } - - /** - * Filter the query on the report_organization column - * - * @param string $dbReportOrganization The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportOrganization($dbReportOrganization = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportOrganization)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportOrganization)) { - $dbReportOrganization = str_replace('*', '%', $dbReportOrganization); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_ORGANIZATION, $dbReportOrganization, $comparison); - } - - /** - * Filter the query on the subject column - * - * @param string $dbSubject The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSubject($dbSubject = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSubject)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSubject)) { - $dbSubject = str_replace('*', '%', $dbSubject); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SUBJECT, $dbSubject, $comparison); - } - - /** - * Filter the query on the contributor column - * - * @param string $dbContributor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbContributor($dbContributor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbContributor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbContributor)) { - $dbContributor = str_replace('*', '%', $dbContributor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CONTRIBUTOR, $dbContributor, $comparison); - } - - /** - * Filter the query on the language column - * - * @param string $dbLanguage The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLanguage($dbLanguage = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLanguage)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLanguage)) { - $dbLanguage = str_replace('*', '%', $dbLanguage); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LANGUAGE, $dbLanguage, $comparison); - } - - /** - * Filter the query on the soundcloud_id column - * - * @param int|array $dbSoundcloudId 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudId($dbSoundcloudId = null, $comparison = null) - { - if (is_array($dbSoundcloudId)) { - $useMinMax = false; - if (isset($dbSoundcloudId['min'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbSoundcloudId['max'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId, $comparison); - } - - /** - * Filter the query on the soundcloud_error_code column - * - * @param int|array $dbSoundcloudErrorCode 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudErrorCode($dbSoundcloudErrorCode = null, $comparison = null) - { - if (is_array($dbSoundcloudErrorCode)) { - $useMinMax = false; - if (isset($dbSoundcloudErrorCode['min'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbSoundcloudErrorCode['max'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode, $comparison); - } - - /** - * Filter the query on the soundcloud_error_msg column - * - * @param string $dbSoundcloudErrorMsg The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudErrorMsg($dbSoundcloudErrorMsg = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSoundcloudErrorMsg)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSoundcloudErrorMsg)) { - $dbSoundcloudErrorMsg = str_replace('*', '%', $dbSoundcloudErrorMsg); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $dbSoundcloudErrorMsg, $comparison); - } - - /** - * Filter the query on the soundcloud_link_to_file column - * - * @param string $dbSoundcloudLinkToFile The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudLinkToFile($dbSoundcloudLinkToFile = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSoundcloudLinkToFile)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSoundcloudLinkToFile)) { - $dbSoundcloudLinkToFile = str_replace('*', '%', $dbSoundcloudLinkToFile); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, $dbSoundcloudLinkToFile, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Filter the query by a related CcMusicDirs object - * - * @param CcMusicDirs $ccMusicDirs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcMusicDirs($ccMusicDirs, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->getId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcMusicDirs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcMusicDirs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcMusicDirs'); - - // 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, 'CcMusicDirs'); - } - - return $this; - } - - /** - * Use the CcMusicDirs relation CcMusicDirs 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 CcMusicDirsQuery A secondary query class using the current class as primary query - */ - public function useCcMusicDirsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcMusicDirs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcMusicDirs', 'CcMusicDirsQuery'); - } - - /** - * 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByCcShowInstances($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccShowInstances->getDbRecordedFile(), $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 CcFilesQuery The current query, for fluid interface - */ - public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) - { - return $this - ->joinCcShowInstances($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery'); - } - - /** - * Filter the query by a related CcPlaylistcontents object - * - * @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccPlaylistcontents->getDbFileId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylistcontents relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylistcontents'); - - // 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, 'CcPlaylistcontents'); - } - - return $this; - } - - /** - * Use the CcPlaylistcontents relation CcPlaylistcontents 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 CcPlaylistcontentsQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylistcontents($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery'); - } - - /** - * 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByCcSchedule($ccSchedule, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccSchedule->getDbFileId(), $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 CcFilesQuery The current query, for fluid interface - */ - public function joinCcSchedule($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) - { - return $this - ->joinCcSchedule($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSchedule', 'CcScheduleQuery'); - } - - /** - * Exclude object from result - * - * @param CcFiles $ccFiles Object to remove from the list of results - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function prune($ccFiles = null) - { - if ($ccFiles) { - $this->addUsingAlias(CcFilesPeer::ID, $ccFiles->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcFilesQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttempts.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttempts.php deleted file mode 100644 index b529e12d5..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttempts.php +++ /dev/null @@ -1,735 +0,0 @@ -attempts = 0; - } - - /** - * Initializes internal state of BaseCcLoginAttempts object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [ip] column value. - * - * @return string - */ - public function getDbIP() - { - return $this->ip; - } - - /** - * Get the [attempts] column value. - * - * @return int - */ - public function getDbAttempts() - { - return $this->attempts; - } - - /** - * Set the value of [ip] column. - * - * @param string $v new value - * @return CcLoginAttempts The current object (for fluent API support) - */ - public function setDbIP($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ip !== $v) { - $this->ip = $v; - $this->modifiedColumns[] = CcLoginAttemptsPeer::IP; - } - - return $this; - } // setDbIP() - - /** - * Set the value of [attempts] column. - * - * @param int $v new value - * @return CcLoginAttempts The current object (for fluent API support) - */ - public function setDbAttempts($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->attempts !== $v || $this->isNew()) { - $this->attempts = $v; - $this->modifiedColumns[] = CcLoginAttemptsPeer::ATTEMPTS; - } - - return $this; - } // setDbAttempts() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->attempts !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->ip = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->attempts = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcLoginAttemptsPeer::NUM_COLUMNS - CcLoginAttemptsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcLoginAttempts object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcLoginAttemptsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcLoginAttemptsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcLoginAttemptsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcLoginAttemptsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcLoginAttemptsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcLoginAttemptsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbIP(); - break; - case 1: - return $this->getDbAttempts(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcLoginAttemptsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbIP(), - $keys[1] => $this->getDbAttempts(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcLoginAttemptsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbIP($value); - break; - case 1: - $this->setDbAttempts($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcLoginAttemptsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbIP($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbAttempts($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcLoginAttemptsPeer::IP)) $criteria->add(CcLoginAttemptsPeer::IP, $this->ip); - if ($this->isColumnModified(CcLoginAttemptsPeer::ATTEMPTS)) $criteria->add(CcLoginAttemptsPeer::ATTEMPTS, $this->attempts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $this->ip); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbIP(); - } - - /** - * Generic method to set the primary key (ip column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbIP($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbIP(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcLoginAttempts (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbIP($this->ip); - $copyObj->setDbAttempts($this->attempts); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcLoginAttempts Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcLoginAttemptsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcLoginAttemptsPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->ip = null; - $this->attempts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcLoginAttempts diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsPeer.php deleted file mode 100644 index 27b4cd90c..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbIP', 'DbAttempts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIP', 'dbAttempts', ), - BasePeer::TYPE_COLNAME => array (self::IP, self::ATTEMPTS, ), - BasePeer::TYPE_RAW_COLNAME => array ('IP', 'ATTEMPTS', ), - BasePeer::TYPE_FIELDNAME => array ('ip', 'attempts', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbIP' => 0, 'DbAttempts' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIP' => 0, 'dbAttempts' => 1, ), - BasePeer::TYPE_COLNAME => array (self::IP => 0, self::ATTEMPTS => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('IP' => 0, 'ATTEMPTS' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('ip' => 0, 'attempts' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcLoginAttemptsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::IP); - $criteria->addSelectColumn(CcLoginAttemptsPeer::ATTEMPTS); - } else { - $criteria->addSelectColumn($alias . '.IP'); - $criteria->addSelectColumn($alias . '.ATTEMPTS'); - } - } - - /** - * 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(CcLoginAttemptsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::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 CcLoginAttempts - * @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 = CcLoginAttemptsPeer::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 CcLoginAttemptsPeer::populateObjects(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcLoginAttemptsPeer::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 CcLoginAttempts $value A CcLoginAttempts object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcLoginAttempts $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbIP(); - } // 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 CcLoginAttempts object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcLoginAttempts) { - $key = (string) $value->getDbIP(); - } 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 CcLoginAttempts 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 CcLoginAttempts 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_login_attempts - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcLoginAttemptsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcLoginAttemptsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcLoginAttemptsPeer::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; - CcLoginAttemptsPeer::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 (CcLoginAttempts object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcLoginAttemptsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcLoginAttemptsPeer::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 + CcLoginAttemptsPeer::NUM_COLUMNS; - } else { - $cls = CcLoginAttemptsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcLoginAttemptsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcLoginAttemptsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcLoginAttemptsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcLoginAttemptsTableMap()); - } - } - - /** - * 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 ? CcLoginAttemptsPeer::CLASS_DEFAULT : CcLoginAttemptsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcLoginAttempts or Criteria object. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcLoginAttempts object - } - - - // 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 CcLoginAttempts or Criteria object. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcLoginAttemptsPeer::IP); - $value = $criteria->remove(CcLoginAttemptsPeer::IP); - if ($value) { - $selectCriteria->add(CcLoginAttemptsPeer::IP, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcLoginAttemptsPeer::TABLE_NAME); - } - - } else { // $values is CcLoginAttempts 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_login_attempts 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(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::TABLE_NAME, $con, CcLoginAttemptsPeer::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). - CcLoginAttemptsPeer::clearInstancePool(); - CcLoginAttemptsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcLoginAttempts or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::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. - CcLoginAttemptsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcLoginAttempts) { // it's a model object - // invalidate the cache for this single object - CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::IP, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcLoginAttemptsPeer::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); - CcLoginAttemptsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcLoginAttempts 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 CcLoginAttempts $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(CcLoginAttempts $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcLoginAttemptsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, CcLoginAttemptsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcLoginAttempts - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcLoginAttemptsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $pk); - - $v = CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $pks, Criteria::IN); - $objs = CcLoginAttemptsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcLoginAttemptsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcLoginAttemptsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsQuery.php deleted file mode 100644 index 930f32eda..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcLoginAttemptsQuery.php +++ /dev/null @@ -1,205 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcLoginAttempts|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcLoginAttemptsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $keys, Criteria::IN); - } - - /** - * Filter the query on the ip column - * - * @param string $dbIP The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByDbIP($dbIP = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIP)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIP)) { - $dbIP = str_replace('*', '%', $dbIP); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $dbIP, $comparison); - } - - /** - * Filter the query on the attempts column - * - * @param int|array $dbAttempts 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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByDbAttempts($dbAttempts = null, $comparison = null) - { - if (is_array($dbAttempts)) { - $useMinMax = false; - if (isset($dbAttempts['min'])) { - $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbAttempts['max'])) { - $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts, $comparison); - } - - /** - * Exclude object from result - * - * @param CcLoginAttempts $ccLoginAttempts Object to remove from the list of results - * - * @return CcLoginAttemptsQuery The current query, for fluid interface - */ - public function prune($ccLoginAttempts = null) - { - if ($ccLoginAttempts) { - $this->addUsingAlias(CcLoginAttemptsPeer::IP, $ccLoginAttempts->getDbIP(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcLoginAttemptsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirs.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirs.php deleted file mode 100644 index 8458eed2f..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirs.php +++ /dev/null @@ -1,941 +0,0 @@ -id; - } - - /** - * Get the [directory] column value. - * - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [directory] column. - * - * @param string $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setDirectory($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->directory !== $v) { - $this->directory = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::DIRECTORY; - } - - return $this; - } // setDirectory() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->directory = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcMusicDirs object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcMusicDirsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcFiless = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcMusicDirsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcMusicDirsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcMusicDirsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcMusicDirsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcMusicDirsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcMusicDirsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getDirectory(); - break; - case 2: - return $this->getType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcMusicDirsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getDirectory(), - $keys[2] => $this->getType(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setDirectory($value); - break; - case 2: - $this->setType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcMusicDirsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDirectory($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcMusicDirsPeer::ID)) $criteria->add(CcMusicDirsPeer::ID, $this->id); - if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) $criteria->add(CcMusicDirsPeer::DIRECTORY, $this->directory); - if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) $criteria->add(CcMusicDirsPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcMusicDirs (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDirectory($this->directory); - $copyObj->setType($this->type); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcFiless() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcFiles($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcMusicDirs Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcMusicDirsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcMusicDirsPeer(); - } - return self::$peer; - } - - /** - * Clears out the collCcFiless 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 addCcFiless() - */ - public function clearCcFiless() - { - $this->collCcFiless = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcFiless collection. - * - * By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless()); - * 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 initCcFiless() - { - $this->collCcFiless = new PropelObjectCollection(); - $this->collCcFiless->setModel('CcFiles'); - } - - /** - * Gets an array of CcFiles 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 CcMusicDirs 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 CcFiles[] List of CcFiles objects - * @throws PropelException - */ - public function getCcFiless($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - // return empty collection - $this->initCcFiless(); - } else { - $collCcFiless = CcFilesQuery::create(null, $criteria) - ->filterByCcMusicDirs($this) - ->find($con); - if (null !== $criteria) { - return $collCcFiless; - } - $this->collCcFiless = $collCcFiless; - } - } - return $this->collCcFiless; - } - - /** - * Returns the number of related CcFiles objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcFiles objects. - * @throws PropelException - */ - public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - return 0; - } else { - $query = CcFilesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcMusicDirs($this) - ->count($con); - } - } else { - return count($this->collCcFiless); - } - } - - /** - * Method called to associate a CcFiles object to this object - * through the CcFiles foreign key attribute. - * - * @param CcFiles $l CcFiles - * @return void - * @throws PropelException - */ - public function addCcFiles(CcFiles $l) - { - if ($this->collCcFiless === null) { - $this->initCcFiless(); - } - if (!$this->collCcFiless->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcFiless[]= $l; - $l->setCcMusicDirs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcMusicDirs is new, it will return - * an empty collection; or if this CcMusicDirs has previously - * been saved, it will retrieve related CcFiless from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcMusicDirs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcFiles[] List of CcFiles objects - */ - public function getCcFilessJoinCcSubjs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcFilesQuery::create(null, $criteria); - $query->joinWith('CcSubjs', $join_behavior); - - return $this->getCcFiless($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->directory = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcFiless) { - foreach ((array) $this->collCcFiless as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcFiless = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcMusicDirs diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsPeer.php deleted file mode 100644 index 5d06e270d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsPeer.php +++ /dev/null @@ -1,747 +0,0 @@ - array ('Id', 'Directory', 'Type', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::DIRECTORY, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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 ('Id' => 0, 'Directory' => 1, 'Type' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DIRECTORY => 1, self::TYPE => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcMusicDirsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcMusicDirsPeer::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(CcMusicDirsPeer::ID); - $criteria->addSelectColumn(CcMusicDirsPeer::DIRECTORY); - $criteria->addSelectColumn(CcMusicDirsPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.DIRECTORY'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcMusicDirsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcMusicDirsPeer::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(CcMusicDirsPeer::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 CcMusicDirs - * @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 = CcMusicDirsPeer::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 CcMusicDirsPeer::populateObjects(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcMusicDirsPeer::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 CcMusicDirs $value A CcMusicDirs object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcMusicDirs $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcMusicDirs object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcMusicDirs) { - $key = (string) $value->getId(); - } 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 CcMusicDirs 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 CcMusicDirs 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_music_dirs - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcFilesPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcFilesPeer::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 = CcMusicDirsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcMusicDirsPeer::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; - CcMusicDirsPeer::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 (CcMusicDirs object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcMusicDirsPeer::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 + CcMusicDirsPeer::NUM_COLUMNS; - } else { - $cls = CcMusicDirsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcMusicDirsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcMusicDirsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcMusicDirsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcMusicDirsTableMap()); - } - } - - /** - * 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 ? CcMusicDirsPeer::CLASS_DEFAULT : CcMusicDirsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcMusicDirs or Criteria object. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcMusicDirs object - } - - if ($criteria->containsKey(CcMusicDirsPeer::ID) && $criteria->keyContainsValue(CcMusicDirsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::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 CcMusicDirs or Criteria object. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcMusicDirsPeer::ID); - $value = $criteria->remove(CcMusicDirsPeer::ID); - if ($value) { - $selectCriteria->add(CcMusicDirsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcMusicDirsPeer::TABLE_NAME); - } - - } else { // $values is CcMusicDirs 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_music_dirs 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(CcMusicDirsPeer::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(CcMusicDirsPeer::TABLE_NAME, $con, CcMusicDirsPeer::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). - CcMusicDirsPeer::clearInstancePool(); - CcMusicDirsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcMusicDirs or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::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. - CcMusicDirsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcMusicDirs) { // it's a model object - // invalidate the cache for this single object - CcMusicDirsPeer::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(CcMusicDirsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcMusicDirsPeer::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); - CcMusicDirsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcMusicDirs 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 CcMusicDirs $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(CcMusicDirs $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcMusicDirsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, CcMusicDirsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcMusicDirs - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $pk); - - $v = CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $pks, Criteria::IN); - $objs = CcMusicDirsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcMusicDirsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcMusicDirsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsQuery.php deleted file mode 100644 index 71b5f0f57..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcMusicDirsQuery.php +++ /dev/null @@ -1,285 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcMusicDirs|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcMusicDirsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcMusicDirsPeer::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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcMusicDirsPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcMusicDirsPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the directory column - * - * @param string $directory The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByDirectory($directory = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($directory)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $directory)) { - $directory = str_replace('*', '%', $directory); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcMusicDirsPeer::DIRECTORY, $directory, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcMusicDirsPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcMusicDirsPeer::ID, $ccFiles->getDbDirectory(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Exclude object from result - * - * @param CcMusicDirs $ccMusicDirs Object to remove from the list of results - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function prune($ccMusicDirs = null) - { - if ($ccMusicDirs) { - $this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcMusicDirsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPerms.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPerms.php deleted file mode 100644 index a86413fc1..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPerms.php +++ /dev/null @@ -1,945 +0,0 @@ -permid; - } - - /** - * Get the [subj] column value. - * - * @return int - */ - public function getSubj() - { - return $this->subj; - } - - /** - * Get the [action] column value. - * - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Get the [obj] column value. - * - * @return int - */ - public function getObj() - { - return $this->obj; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Set the value of [permid] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setPermid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->permid !== $v) { - $this->permid = $v; - $this->modifiedColumns[] = CcPermsPeer::PERMID; - } - - return $this; - } // setPermid() - - /** - * Set the value of [subj] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setSubj($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subj !== $v) { - $this->subj = $v; - $this->modifiedColumns[] = CcPermsPeer::SUBJ; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setSubj() - - /** - * Set the value of [action] column. - * - * @param string $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setAction($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->action !== $v) { - $this->action = $v; - $this->modifiedColumns[] = CcPermsPeer::ACTION; - } - - return $this; - } // setAction() - - /** - * Set the value of [obj] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setObj($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->obj !== $v) { - $this->obj = $v; - $this->modifiedColumns[] = CcPermsPeer::OBJ; - } - - return $this; - } // setObj() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcPermsPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->permid = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->subj = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->action = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->obj = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->type = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPerms object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPermsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPermsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPermsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setNew(false); - } else { - $affectedRows += CcPermsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPermsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getPermid(); - break; - case 1: - return $this->getSubj(); - break; - case 2: - return $this->getAction(); - break; - case 3: - return $this->getObj(); - break; - case 4: - return $this->getType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPermsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getPermid(), - $keys[1] => $this->getSubj(), - $keys[2] => $this->getAction(), - $keys[3] => $this->getObj(), - $keys[4] => $this->getType(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setPermid($value); - break; - case 1: - $this->setSubj($value); - break; - case 2: - $this->setAction($value); - break; - case 3: - $this->setObj($value); - break; - case 4: - $this->setType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPermsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setPermid($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSubj($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setAction($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setObj($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setType($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPermsPeer::PERMID)) $criteria->add(CcPermsPeer::PERMID, $this->permid); - if ($this->isColumnModified(CcPermsPeer::SUBJ)) $criteria->add(CcPermsPeer::SUBJ, $this->subj); - if ($this->isColumnModified(CcPermsPeer::ACTION)) $criteria->add(CcPermsPeer::ACTION, $this->action); - if ($this->isColumnModified(CcPermsPeer::OBJ)) $criteria->add(CcPermsPeer::OBJ, $this->obj); - if ($this->isColumnModified(CcPermsPeer::TYPE)) $criteria->add(CcPermsPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $this->permid); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getPermid(); - } - - /** - * Generic method to set the primary key (permid column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setPermid($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getPermid(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPerms (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setPermid($this->permid); - $copyObj->setSubj($this->subj); - $copyObj->setAction($this->action); - $copyObj->setObj($this->obj); - $copyObj->setType($this->type); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPerms Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPermsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPermsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPerms The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setSubj(NULL); - } else { - $this->setSubj($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPerms($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subj !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subj, $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->aCcSubjs->addCcPermss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->permid = null; - $this->subj = null; - $this->action = null; - $this->obj = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPerms diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsPeer.php deleted file mode 100644 index 4bd4c07ea..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsPeer.php +++ /dev/null @@ -1,984 +0,0 @@ - array ('Permid', 'Subj', 'Action', 'Obj', 'Type', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('permid', 'subj', 'action', 'obj', 'type', ), - BasePeer::TYPE_COLNAME => array (self::PERMID, self::SUBJ, self::ACTION, self::OBJ, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('PERMID', 'SUBJ', 'ACTION', 'OBJ', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('permid', 'subj', 'action', 'obj', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Permid' => 0, 'Subj' => 1, 'Action' => 2, 'Obj' => 3, 'Type' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ), - BasePeer::TYPE_COLNAME => array (self::PERMID => 0, self::SUBJ => 1, self::ACTION => 2, self::OBJ => 3, self::TYPE => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('PERMID' => 0, 'SUBJ' => 1, 'ACTION' => 2, 'OBJ' => 3, 'TYPE' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPermsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPermsPeer::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(CcPermsPeer::PERMID); - $criteria->addSelectColumn(CcPermsPeer::SUBJ); - $criteria->addSelectColumn(CcPermsPeer::ACTION); - $criteria->addSelectColumn(CcPermsPeer::OBJ); - $criteria->addSelectColumn(CcPermsPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.PERMID'); - $criteria->addSelectColumn($alias . '.SUBJ'); - $criteria->addSelectColumn($alias . '.ACTION'); - $criteria->addSelectColumn($alias . '.OBJ'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::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 CcPerms - * @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 = CcPermsPeer::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 CcPermsPeer::populateObjects(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPermsPeer::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 CcPerms $value A CcPerms object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPerms $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getPermid(); - } // 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 CcPerms object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPerms) { - $key = (string) $value->getPermid(); - } 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 CcPerms 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 CcPerms 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_perms - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPermsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPermsPeer::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; - CcPermsPeer::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 (CcPerms object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPermsPeer::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 + CcPermsPeer::NUM_COLUMNS; - } else { - $cls = CcPermsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPermsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::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 CcPerms objects pre-filled with their CcSubjs 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 CcPerms objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPermsPeer::addSelectColumns($criteria); - $startcol = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPermsPeer::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 = CcPermsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPermsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPerms) to $obj2 (CcSubjs) - $obj2->addCcPerms($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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::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 CcPerms 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 CcPerms 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); - } - - CcPermsPeer::addSelectColumns($criteria); - $startcol2 = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPermsPeer::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 = CcPermsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPermsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPerms) to the collection in $obj2 (CcSubjs) - $obj2->addCcPerms($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(BaseCcPermsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPermsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPermsTableMap()); - } - } - - /** - * 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 ? CcPermsPeer::CLASS_DEFAULT : CcPermsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPerms or Criteria object. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPerms object - } - - - // 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 CcPerms or Criteria object. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPermsPeer::PERMID); - $value = $criteria->remove(CcPermsPeer::PERMID); - if ($value) { - $selectCriteria->add(CcPermsPeer::PERMID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME); - } - - } else { // $values is CcPerms 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_perms 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(CcPermsPeer::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(CcPermsPeer::TABLE_NAME, $con, CcPermsPeer::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). - CcPermsPeer::clearInstancePool(); - CcPermsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPerms or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::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. - CcPermsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPerms) { // it's a model object - // invalidate the cache for this single object - CcPermsPeer::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(CcPermsPeer::PERMID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPermsPeer::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); - CcPermsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPerms 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 CcPerms $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(CcPerms $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPermsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, CcPermsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPerms - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPermsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $pk); - - $v = CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $pks, Criteria::IN); - $objs = CcPermsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPermsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPermsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsQuery.php deleted file mode 100644 index 5866aa488..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPermsQuery.php +++ /dev/null @@ -1,355 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPerms|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPermsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPermsPeer::PERMID, $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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPermsPeer::PERMID, $keys, Criteria::IN); - } - - /** - * Filter the query on the permid column - * - * @param int|array $permid 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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPermid($permid = null, $comparison = null) - { - if (is_array($permid) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcPermsPeer::PERMID, $permid, $comparison); - } - - /** - * Filter the query on the subj column - * - * @param int|array $subj 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 CcPermsQuery The current query, for fluid interface - */ - public function filterBySubj($subj = null, $comparison = null) - { - if (is_array($subj)) { - $useMinMax = false; - if (isset($subj['min'])) { - $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($subj['max'])) { - $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPermsPeer::SUBJ, $subj, $comparison); - } - - /** - * Filter the query on the action column - * - * @param string $action The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByAction($action = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($action)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $action)) { - $action = str_replace('*', '%', $action); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPermsPeer::ACTION, $action, $comparison); - } - - /** - * Filter the query on the obj column - * - * @param int|array $obj 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 CcPermsQuery The current query, for fluid interface - */ - public function filterByObj($obj = null, $comparison = null) - { - if (is_array($obj)) { - $useMinMax = false; - if (isset($obj['min'])) { - $this->addUsingAlias(CcPermsPeer::OBJ, $obj['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($obj['max'])) { - $this->addUsingAlias(CcPermsPeer::OBJ, $obj['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPermsPeer::OBJ, $obj, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPermsPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPerms $ccPerms Object to remove from the list of results - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function prune($ccPerms = null) - { - if ($ccPerms) { - $this->addUsingAlias(CcPermsPeer::PERMID, $ccPerms->getPermid(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPermsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylist.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylist.php deleted file mode 100644 index 222c1c6f4..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylist.php +++ /dev/null @@ -1,1365 +0,0 @@ -name = ''; - $this->state = 'empty'; - $this->currentlyaccessing = 0; - } - - /** - * Initializes internal state of BaseCcPlaylist object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getDbState() - { - return $this->state; - } - - /** - * Get the [currentlyaccessing] column value. - * - * @return int - */ - public function getDbCurrentlyaccessing() - { - return $this->currentlyaccessing; - } - - /** - * Get the [editedby] column value. - * - * @return int - */ - public function getDbEditedby() - { - return $this->editedby; - } - - /** - * Get the [optionally formatted] temporal [mtime] 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 getDbMtime($format = 'Y-m-d H:i:s') - { - if ($this->mtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->mtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->mtime, 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 [creator] column value. - * - * @return string - */ - public function getDbCreator() - { - return $this->creator; - } - - /** - * Get the [description] column value. - * - * @return string - */ - public function getDbDescription() - { - return $this->description; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPlaylistPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcPlaylistPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v || $this->isNew()) { - $this->state = $v; - $this->modifiedColumns[] = CcPlaylistPeer::STATE; - } - - return $this; - } // setDbState() - - /** - * Set the value of [currentlyaccessing] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbCurrentlyaccessing($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->currentlyaccessing !== $v || $this->isNew()) { - $this->currentlyaccessing = $v; - $this->modifiedColumns[] = CcPlaylistPeer::CURRENTLYACCESSING; - } - - return $this; - } // setDbCurrentlyaccessing() - - /** - * Set the value of [editedby] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbEditedby($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->editedby !== $v) { - $this->editedby = $v; - $this->modifiedColumns[] = CcPlaylistPeer::EDITEDBY; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbEditedby() - - /** - * Sets the value of [mtime] 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 CcPlaylist The current object (for fluent API support) - */ - public function setDbMtime($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->mtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->mtime !== null && $tmpDt = new DateTime($this->mtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->mtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcPlaylistPeer::MTIME; - } - } // if either are not null - - return $this; - } // setDbMtime() - - /** - * Set the value of [creator] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbCreator($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->creator !== $v) { - $this->creator = $v; - $this->modifiedColumns[] = CcPlaylistPeer::CREATOR; - } - - return $this; - } // setDbCreator() - - /** - * Set the value of [description] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->description !== $v) { - $this->description = $v; - $this->modifiedColumns[] = CcPlaylistPeer::DESCRIPTION; - } - - return $this; - } // setDbDescription() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->state !== 'empty') { - return false; - } - - if ($this->currentlyaccessing !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->state = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->currentlyaccessing = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->editedby = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->mtime = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->creator = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->description = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 8; // 8 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPlaylist object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPlaylistPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - $this->collCcPlaylistcontentss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPlaylistQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPlaylistPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPlaylistPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPlaylistPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPlaylistPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPlaylistPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbName(); - break; - case 2: - return $this->getDbState(); - break; - case 3: - return $this->getDbCurrentlyaccessing(); - break; - case 4: - return $this->getDbEditedby(); - break; - case 5: - return $this->getDbMtime(); - break; - case 6: - return $this->getDbCreator(); - break; - case 7: - return $this->getDbDescription(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPlaylistPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbName(), - $keys[2] => $this->getDbState(), - $keys[3] => $this->getDbCurrentlyaccessing(), - $keys[4] => $this->getDbEditedby(), - $keys[5] => $this->getDbMtime(), - $keys[6] => $this->getDbCreator(), - $keys[7] => $this->getDbDescription(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbName($value); - break; - case 2: - $this->setDbState($value); - break; - case 3: - $this->setDbCurrentlyaccessing($value); - break; - case 4: - $this->setDbEditedby($value); - break; - case 5: - $this->setDbMtime($value); - break; - case 6: - $this->setDbCreator($value); - break; - case 7: - $this->setDbDescription($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPlaylistPeer::getFieldNames($keyType); - - 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[2], $arr)) $this->setDbState($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbEditedby($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbMtime($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbCreator($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbDescription($arr[$keys[7]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPlaylistPeer::ID)) $criteria->add(CcPlaylistPeer::ID, $this->id); - if ($this->isColumnModified(CcPlaylistPeer::NAME)) $criteria->add(CcPlaylistPeer::NAME, $this->name); - if ($this->isColumnModified(CcPlaylistPeer::STATE)) $criteria->add(CcPlaylistPeer::STATE, $this->state); - if ($this->isColumnModified(CcPlaylistPeer::CURRENTLYACCESSING)) $criteria->add(CcPlaylistPeer::CURRENTLYACCESSING, $this->currentlyaccessing); - if ($this->isColumnModified(CcPlaylistPeer::EDITEDBY)) $criteria->add(CcPlaylistPeer::EDITEDBY, $this->editedby); - if ($this->isColumnModified(CcPlaylistPeer::MTIME)) $criteria->add(CcPlaylistPeer::MTIME, $this->mtime); - if ($this->isColumnModified(CcPlaylistPeer::CREATOR)) $criteria->add(CcPlaylistPeer::CREATOR, $this->creator); - if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPlaylist (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbState($this->state); - $copyObj->setDbCurrentlyaccessing($this->currentlyaccessing); - $copyObj->setDbEditedby($this->editedby); - $copyObj->setDbMtime($this->mtime); - $copyObj->setDbCreator($this->creator); - $copyObj->setDbDescription($this->description); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcPlaylistcontentss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylistcontents($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPlaylist Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPlaylistPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPlaylistPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPlaylist The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbEditedby(NULL); - } else { - $this->setDbEditedby($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylist($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->editedby !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->editedby, $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->aCcSubjs->addCcPlaylists($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears out the collCcPlaylistcontentss 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 addCcPlaylistcontentss() - */ - public function clearCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylistcontentss collection. - * - * By default this just sets the collCcPlaylistcontentss collection to an empty array (like clearcollCcPlaylistcontentss()); - * 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 initCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = new PropelObjectCollection(); - $this->collCcPlaylistcontentss->setModel('CcPlaylistcontents'); - } - - /** - * Gets an array of CcPlaylistcontents 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 CcPlaylist 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 CcPlaylistcontents[] List of CcPlaylistcontents objects - * @throws PropelException - */ - public function getCcPlaylistcontentss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - // return empty collection - $this->initCcPlaylistcontentss(); - } else { - $collCcPlaylistcontentss = CcPlaylistcontentsQuery::create(null, $criteria) - ->filterByCcPlaylist($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylistcontentss; - } - $this->collCcPlaylistcontentss = $collCcPlaylistcontentss; - } - } - return $this->collCcPlaylistcontentss; - } - - /** - * Returns the number of related CcPlaylistcontents objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylistcontents objects. - * @throws PropelException - */ - public function countCcPlaylistcontentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - return 0; - } else { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcPlaylist($this) - ->count($con); - } - } else { - return count($this->collCcPlaylistcontentss); - } - } - - /** - * Method called to associate a CcPlaylistcontents object to this object - * through the CcPlaylistcontents foreign key attribute. - * - * @param CcPlaylistcontents $l CcPlaylistcontents - * @return void - * @throws PropelException - */ - public function addCcPlaylistcontents(CcPlaylistcontents $l) - { - if ($this->collCcPlaylistcontentss === null) { - $this->initCcPlaylistcontentss(); - } - if (!$this->collCcPlaylistcontentss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylistcontentss[]= $l; - $l->setCcPlaylist($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcPlaylist is new, it will return - * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcPlaylistcontentss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcPlaylist. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects - */ - public function getCcPlaylistcontentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcPlaylistcontentss($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->state = null; - $this->currentlyaccessing = null; - $this->editedby = null; - $this->mtime = null; - $this->creator = null; - $this->description = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcPlaylistcontentss) { - foreach ((array) $this->collCcPlaylistcontentss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcPlaylistcontentss = null; - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistPeer.php deleted file mode 100644 index 0e338bc39..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistPeer.php +++ /dev/null @@ -1,1006 +0,0 @@ - array ('DbId', 'DbName', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbCreator', 'DbDescription', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbCreator', 'dbDescription', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::CREATOR, self::DESCRIPTION, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'CREATOR', 'DESCRIPTION', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'creator', 'description', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) - ); - - /** - * 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, 'DbName' => 1, 'DbState' => 2, 'DbCurrentlyaccessing' => 3, 'DbEditedby' => 4, 'DbMtime' => 5, 'DbCreator' => 6, 'DbDescription' => 7, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbState' => 2, 'dbCurrentlyaccessing' => 3, 'dbEditedby' => 4, 'dbMtime' => 5, 'dbCreator' => 6, 'dbDescription' => 7, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::STATE => 2, self::CURRENTLYACCESSING => 3, self::EDITEDBY => 4, self::MTIME => 5, self::CREATOR => 6, self::DESCRIPTION => 7, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'STATE' => 2, 'CURRENTLYACCESSING' => 3, 'EDITEDBY' => 4, 'MTIME' => 5, 'CREATOR' => 6, 'DESCRIPTION' => 7, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'state' => 2, 'currentlyaccessing' => 3, 'editedby' => 4, 'mtime' => 5, 'creator' => 6, 'description' => 7, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPlaylistPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPlaylistPeer::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(CcPlaylistPeer::ID); - $criteria->addSelectColumn(CcPlaylistPeer::NAME); - $criteria->addSelectColumn(CcPlaylistPeer::STATE); - $criteria->addSelectColumn(CcPlaylistPeer::CURRENTLYACCESSING); - $criteria->addSelectColumn(CcPlaylistPeer::EDITEDBY); - $criteria->addSelectColumn(CcPlaylistPeer::MTIME); - $criteria->addSelectColumn(CcPlaylistPeer::CREATOR); - $criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.CURRENTLYACCESSING'); - $criteria->addSelectColumn($alias . '.EDITEDBY'); - $criteria->addSelectColumn($alias . '.MTIME'); - $criteria->addSelectColumn($alias . '.CREATOR'); - $criteria->addSelectColumn($alias . '.DESCRIPTION'); - } - } - - /** - * 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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::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 CcPlaylist - * @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 = CcPlaylistPeer::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 CcPlaylistPeer::populateObjects(CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPlaylistPeer::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 CcPlaylist $value A CcPlaylist object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPlaylist $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 CcPlaylist object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPlaylist) { - $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 CcPlaylist 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 CcPlaylist 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_playlist - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcPlaylistcontentsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPlaylistcontentsPeer::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 = CcPlaylistPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPlaylistPeer::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; - CcPlaylistPeer::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 (CcPlaylist object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPlaylistPeer::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 + CcPlaylistPeer::NUM_COLUMNS; - } else { - $cls = CcPlaylistPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPlaylistPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::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 CcPlaylist objects pre-filled with their CcSubjs 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 CcPlaylist objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistPeer::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 = CcPlaylistPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylist) to $obj2 (CcSubjs) - $obj2->addCcPlaylist($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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::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 CcPlaylist 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 CcPlaylist 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); - } - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistPeer::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 = CcPlaylistPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPlaylist) to the collection in $obj2 (CcSubjs) - $obj2->addCcPlaylist($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(BaseCcPlaylistPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPlaylistPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPlaylistTableMap()); - } - } - - /** - * 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 ? CcPlaylistPeer::CLASS_DEFAULT : CcPlaylistPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPlaylist or Criteria object. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPlaylist object - } - - if ($criteria->containsKey(CcPlaylistPeer::ID) && $criteria->keyContainsValue(CcPlaylistPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistPeer::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 CcPlaylist or Criteria object. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPlaylistPeer::ID); - $value = $criteria->remove(CcPlaylistPeer::ID); - if ($value) { - $selectCriteria->add(CcPlaylistPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPlaylistPeer::TABLE_NAME); - } - - } else { // $values is CcPlaylist 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_playlist 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(CcPlaylistPeer::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(CcPlaylistPeer::TABLE_NAME, $con, CcPlaylistPeer::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). - CcPlaylistPeer::clearInstancePool(); - CcPlaylistPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPlaylist or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::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. - CcPlaylistPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPlaylist) { // it's a model object - // invalidate the cache for this single object - CcPlaylistPeer::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(CcPlaylistPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPlaylistPeer::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); - CcPlaylistPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPlaylist 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 CcPlaylist $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(CcPlaylist $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPlaylistPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, CcPlaylistPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPlaylist - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPlaylistPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $pk); - - $v = CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $pks, Criteria::IN); - $objs = CcPlaylistPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPlaylistPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPlaylistPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistQuery.php deleted file mode 100644 index 0ab594b7a..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistQuery.php +++ /dev/null @@ -1,510 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPlaylist|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPlaylistPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery 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(CcPlaylistPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $dbState The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbState($dbState = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbState)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbState)) { - $dbState = str_replace('*', '%', $dbState); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::STATE, $dbState, $comparison); - } - - /** - * Filter the query on the currentlyaccessing column - * - * @param int|array $dbCurrentlyaccessing 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbCurrentlyaccessing($dbCurrentlyaccessing = null, $comparison = null) - { - if (is_array($dbCurrentlyaccessing)) { - $useMinMax = false; - if (isset($dbCurrentlyaccessing['min'])) { - $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCurrentlyaccessing['max'])) { - $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing, $comparison); - } - - /** - * Filter the query on the editedby column - * - * @param int|array $dbEditedby 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbEditedby($dbEditedby = null, $comparison = null) - { - if (is_array($dbEditedby)) { - $useMinMax = false; - if (isset($dbEditedby['min'])) { - $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEditedby['max'])) { - $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby, $comparison); - } - - /** - * Filter the query on the mtime column - * - * @param string|array $dbMtime 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbMtime($dbMtime = null, $comparison = null) - { - if (is_array($dbMtime)) { - $useMinMax = false; - if (isset($dbMtime['min'])) { - $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbMtime['max'])) { - $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime, $comparison); - } - - /** - * Filter the query on the creator column - * - * @param string $dbCreator The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbCreator($dbCreator = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCreator)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCreator)) { - $dbCreator = str_replace('*', '%', $dbCreator); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::CREATOR, $dbCreator, $comparison); - } - - /** - * Filter the query on the description column - * - * @param string $dbDescription The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbDescription($dbDescription = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDescription)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDescription)) { - $dbDescription = str_replace('*', '%', $dbDescription); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::DESCRIPTION, $dbDescription, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Filter the query by a related CcPlaylistcontents object - * - * @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylistcontents->getDbPlaylistId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylistcontents relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylistcontents'); - - // 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, 'CcPlaylistcontents'); - } - - return $this; - } - - /** - * Use the CcPlaylistcontents relation CcPlaylistcontents 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 CcPlaylistcontentsQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylistcontents($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPlaylist $ccPlaylist Object to remove from the list of results - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function prune($ccPlaylist = null) - { - if ($ccPlaylist) { - $this->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylist->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPlaylistQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontents.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontents.php deleted file mode 100644 index 0118d5038..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontents.php +++ /dev/null @@ -1,1540 +0,0 @@ -cliplength = '00:00:00'; - $this->cuein = '00:00:00'; - $this->cueout = '00:00:00'; - $this->fadein = '00:00:00'; - $this->fadeout = '00:00:00'; - } - - /** - * Initializes internal state of BaseCcPlaylistcontents object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [playlist_id] column value. - * - * @return int - */ - public function getDbPlaylistId() - { - return $this->playlist_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbFileId() - { - return $this->file_id; - } - - /** - * Get the [position] column value. - * - * @return int - */ - public function getDbPosition() - { - return $this->position; - } - - /** - * Get the [optionally formatted] temporal [cliplength] 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 getDbCliplength($format = '%X') - { - if ($this->cliplength === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cliplength); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cliplength, 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 [optionally formatted] temporal [cuein] 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 getDbCuein($format = '%X') - { - if ($this->cuein === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cuein); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cuein, 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 [optionally formatted] temporal [cueout] 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 getDbCueout($format = '%X') - { - if ($this->cueout === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cueout); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cueout, 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 [optionally formatted] temporal [fadein] 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 getDbFadein($format = '%X') - { - if ($this->fadein === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fadein); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadein, 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 [optionally formatted] temporal [fadeout] 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 getDbFadeout($format = '%X') - { - if ($this->fadeout === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fadeout); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadeout, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [playlist_id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbPlaylistId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->playlist_id !== $v) { - $this->playlist_id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::PLAYLIST_ID; - } - - if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { - $this->aCcPlaylist = null; - } - - return $this; - } // setDbPlaylistId() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFileId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbFileId() - - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::POSITION; - } - - return $this; - } // setDbPosition() - - /** - * Sets the value of [cliplength] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCliplength($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->cliplength !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cliplength !== null && $tmpDt = new DateTime($this->cliplength)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cliplength = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - } - } // if either are not null - - return $this; - } // setDbCliplength() - - /** - * Sets the value of [cuein] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCuein($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->cuein !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cuein !== null && $tmpDt = new DateTime($this->cuein)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cuein = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - } - } // if either are not null - - return $this; - } // setDbCuein() - - /** - * Sets the value of [cueout] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCueout($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->cueout !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cueout !== null && $tmpDt = new DateTime($this->cueout)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cueout = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - } - } // if either are not null - - return $this; - } // setDbCueout() - - /** - * Sets the value of [fadein] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFadein($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->fadein !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fadein !== null && $tmpDt = new DateTime($this->fadein)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fadein = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - } - } // if either are not null - - return $this; - } // setDbFadein() - - /** - * Sets the value of [fadeout] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFadeout($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->fadeout !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fadeout !== null && $tmpDt = new DateTime($this->fadeout)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fadeout = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - } - } // if either are not null - - return $this; - } // setDbFadeout() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->cliplength !== '00:00:00') { - return false; - } - - if ($this->cuein !== '00:00:00') { - return false; - } - - if ($this->cueout !== '00:00:00') { - return false; - } - - if ($this->fadein !== '00:00:00') { - return false; - } - - if ($this->fadeout !== '00:00:00') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->file_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->position = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->cliplength = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->cuein = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->cueout = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->fadein = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->fadeout = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 9; // 9 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPlaylistcontents object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcPlaylist !== null && $this->playlist_id !== $this->aCcPlaylist->getDbId()) { - $this->aCcPlaylist = null; - } - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPlaylistcontentsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcFiles = null; - $this->aCcPlaylist = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPlaylistcontentsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPlaylistcontentsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->aCcPlaylist !== null) { - if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { - $affectedRows += $this->aCcPlaylist->save($con); - } - $this->setCcPlaylist($this->aCcPlaylist); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPlaylistcontentsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPlaylistcontentsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistcontentsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPlaylistcontentsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - if ($this->aCcPlaylist !== null) { - if (!$this->aCcPlaylist->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); - } - } - - - if (($retval = CcPlaylistcontentsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistcontentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbPlaylistId(); - break; - case 2: - return $this->getDbFileId(); - break; - case 3: - return $this->getDbPosition(); - break; - case 4: - return $this->getDbCliplength(); - break; - case 5: - return $this->getDbCuein(); - break; - case 6: - return $this->getDbCueout(); - break; - case 7: - return $this->getDbFadein(); - break; - case 8: - return $this->getDbFadeout(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPlaylistcontentsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbPlaylistId(), - $keys[2] => $this->getDbFileId(), - $keys[3] => $this->getDbPosition(), - $keys[4] => $this->getDbCliplength(), - $keys[5] => $this->getDbCuein(), - $keys[6] => $this->getDbCueout(), - $keys[7] => $this->getDbFadein(), - $keys[8] => $this->getDbFadeout(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcPlaylist) { - $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistcontentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbPlaylistId($value); - break; - case 2: - $this->setDbFileId($value); - break; - case 3: - $this->setDbPosition($value); - break; - case 4: - $this->setDbCliplength($value); - break; - case 5: - $this->setDbCuein($value); - break; - case 6: - $this->setDbCueout($value); - break; - case 7: - $this->setDbFadein($value); - break; - case 8: - $this->setDbFadeout($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPlaylistcontentsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbFileId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbPosition($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbCliplength($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbCuein($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbCueout($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbFadein($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbFadeout($arr[$keys[8]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPlaylistcontentsPeer::ID)) $criteria->add(CcPlaylistcontentsPeer::ID, $this->id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::PLAYLIST_ID)) $criteria->add(CcPlaylistcontentsPeer::PLAYLIST_ID, $this->playlist_id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FILE_ID)) $criteria->add(CcPlaylistcontentsPeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::POSITION)) $criteria->add(CcPlaylistcontentsPeer::POSITION, $this->position); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CLIPLENGTH)) $criteria->add(CcPlaylistcontentsPeer::CLIPLENGTH, $this->cliplength); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEIN)) $criteria->add(CcPlaylistcontentsPeer::CUEIN, $this->cuein); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEOUT)) $criteria->add(CcPlaylistcontentsPeer::CUEOUT, $this->cueout); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FADEIN)) $criteria->add(CcPlaylistcontentsPeer::FADEIN, $this->fadein); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FADEOUT)) $criteria->add(CcPlaylistcontentsPeer::FADEOUT, $this->fadeout); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPlaylistcontents (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbPlaylistId($this->playlist_id); - $copyObj->setDbFileId($this->file_id); - $copyObj->setDbPosition($this->position); - $copyObj->setDbCliplength($this->cliplength); - $copyObj->setDbCuein($this->cuein); - $copyObj->setDbCueout($this->cueout); - $copyObj->setDbFadein($this->fadein); - $copyObj->setDbFadeout($this->fadeout); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPlaylistcontents Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPlaylistcontentsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPlaylistcontentsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcPlaylistcontents The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbFileId(NULL); - } else { - $this->setDbFileId($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylistcontents($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcPlaylistcontentss($this); - */ - } - return $this->aCcFiles; - } - - /** - * Declares an association between this object and a CcPlaylist object. - * - * @param CcPlaylist $v - * @return CcPlaylistcontents The current object (for fluent API support) - * @throws PropelException - */ - public function setCcPlaylist(CcPlaylist $v = null) - { - if ($v === null) { - $this->setDbPlaylistId(NULL); - } else { - $this->setDbPlaylistId($v->getDbId()); - } - - $this->aCcPlaylist = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcPlaylist object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylistcontents($this); - } - - return $this; - } - - - /** - * Get the associated CcPlaylist object - * - * @param PropelPDO Optional Connection object. - * @return CcPlaylist The associated CcPlaylist object. - * @throws PropelException - */ - public function getCcPlaylist(PropelPDO $con = null) - { - if ($this->aCcPlaylist === null && ($this->playlist_id !== null)) { - $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->playlist_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->aCcPlaylist->addCcPlaylistcontentss($this); - */ - } - return $this->aCcPlaylist; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->playlist_id = null; - $this->file_id = null; - $this->position = null; - $this->cliplength = null; - $this->cuein = null; - $this->cueout = null; - $this->fadein = null; - $this->fadeout = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcFiles = null; - $this->aCcPlaylist = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsPeer.php deleted file mode 100644 index 0bb899b67..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsPeer.php +++ /dev/null @@ -1,1395 +0,0 @@ - array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbPosition' => 3, 'DbCliplength' => 4, 'DbCuein' => 5, 'DbCueout' => 6, 'DbFadein' => 7, 'DbFadeout' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbPosition' => 3, 'dbCliplength' => 4, 'dbCuein' => 5, 'dbCueout' => 6, 'dbFadein' => 7, 'dbFadeout' => 8, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::POSITION => 3, self::CLIPLENGTH => 4, self::CUEIN => 5, self::CUEOUT => 6, self::FADEIN => 7, self::FADEOUT => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'POSITION' => 3, 'CLIPLENGTH' => 4, 'CUEIN' => 5, 'CUEOUT' => 6, 'FADEIN' => 7, 'FADEOUT' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'position' => 3, 'cliplength' => 4, 'cuein' => 5, 'cueout' => 6, 'fadein' => 7, 'fadeout' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPlaylistcontentsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::PLAYLIST_ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FILE_ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::POSITION); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CLIPLENGTH); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEIN); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEOUT); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FADEIN); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FADEOUT); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.CLIPLENGTH'); - $criteria->addSelectColumn($alias . '.CUEIN'); - $criteria->addSelectColumn($alias . '.CUEOUT'); - $criteria->addSelectColumn($alias . '.FADEIN'); - $criteria->addSelectColumn($alias . '.FADEOUT'); - } - } - - /** - * 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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::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 CcPlaylistcontents - * @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 = CcPlaylistcontentsPeer::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 CcPlaylistcontentsPeer::populateObjects(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPlaylistcontentsPeer::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 CcPlaylistcontents $value A CcPlaylistcontents object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPlaylistcontents $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 CcPlaylistcontents object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPlaylistcontents) { - $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 CcPlaylistcontents 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 CcPlaylistcontents 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_playlistcontents - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPlaylistcontentsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPlaylistcontentsPeer::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; - CcPlaylistcontentsPeer::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 (CcPlaylistcontents object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPlaylistcontentsPeer::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 + CcPlaylistcontentsPeer::NUM_COLUMNS; - } else { - $cls = CcPlaylistcontentsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPlaylistcontentsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinCcPlaylist(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcPlaylistcontents objects pre-filled with their CcFiles 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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcFiles(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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcPlaylistcontents objects pre-filled with their CcPlaylist 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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcPlaylist(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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - CcPlaylistPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcPlaylistPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to $obj2 (CcPlaylist) - $obj2->addCcPlaylistcontents($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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcPlaylistcontents 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 CcPlaylistcontents 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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - } // if joined row not null - - // Add objects for joined CcPlaylist rows - - $key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcPlaylistPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcPlaylistPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcPlaylist) - $obj3->addCcPlaylistcontents($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinAllExceptCcPlaylist(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::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 CcPlaylistcontents objects pre-filled with all related objects except CcFiles. - * - * @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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcPlaylist rows - - $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcPlaylistPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcPlaylist) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcPlaylistcontents objects pre-filled with all related objects except CcPlaylist. - * - * @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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row is 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(BaseCcPlaylistcontentsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPlaylistcontentsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPlaylistcontentsTableMap()); - } - } - - /** - * 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 ? CcPlaylistcontentsPeer::CLASS_DEFAULT : CcPlaylistcontentsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPlaylistcontents or Criteria object. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPlaylistcontents object - } - - if ($criteria->containsKey(CcPlaylistcontentsPeer::ID) && $criteria->keyContainsValue(CcPlaylistcontentsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistcontentsPeer::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 CcPlaylistcontents or Criteria object. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPlaylistcontentsPeer::ID); - $value = $criteria->remove(CcPlaylistcontentsPeer::ID); - if ($value) { - $selectCriteria->add(CcPlaylistcontentsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPlaylistcontentsPeer::TABLE_NAME); - } - - } else { // $values is CcPlaylistcontents 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_playlistcontents 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(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::TABLE_NAME, $con, CcPlaylistcontentsPeer::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). - CcPlaylistcontentsPeer::clearInstancePool(); - CcPlaylistcontentsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPlaylistcontents or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::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. - CcPlaylistcontentsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPlaylistcontents) { // it's a model object - // invalidate the cache for this single object - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPlaylistcontentsPeer::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); - CcPlaylistcontentsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPlaylistcontents 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 CcPlaylistcontents $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(CcPlaylistcontents $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPlaylistcontentsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, CcPlaylistcontentsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPlaylistcontents - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPlaylistcontentsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $pk); - - $v = CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $pks, Criteria::IN); - $objs = CcPlaylistcontentsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPlaylistcontentsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPlaylistcontentsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsQuery.php deleted file mode 100644 index 6c717c6c6..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPlaylistcontentsQuery.php +++ /dev/null @@ -1,581 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPlaylistcontents|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPlaylistcontentsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery 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(CcPlaylistcontentsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the playlist_id column - * - * @param int|array $dbPlaylistId 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) - { - if (is_array($dbPlaylistId)) { - $useMinMax = false; - if (isset($dbPlaylistId['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPlaylistId['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbFileId 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFileId($dbFileId = null, $comparison = null) - { - if (is_array($dbFileId)) { - $useMinMax = false; - if (isset($dbFileId['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFileId['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId, $comparison); - } - - /** - * Filter the query on the position column - * - * @param int|array $dbPosition The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbPosition($dbPosition = null, $comparison = null) - { - if (is_array($dbPosition)) { - $useMinMax = false; - if (isset($dbPosition['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPosition['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition, $comparison); - } - - /** - * Filter the query on the cliplength column - * - * @param string|array $dbCliplength 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCliplength($dbCliplength = null, $comparison = null) - { - if (is_array($dbCliplength)) { - $useMinMax = false; - if (isset($dbCliplength['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCliplength['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength, $comparison); - } - - /** - * Filter the query on the cuein column - * - * @param string|array $dbCuein 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCuein($dbCuein = null, $comparison = null) - { - if (is_array($dbCuein)) { - $useMinMax = false; - if (isset($dbCuein['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCuein['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein, $comparison); - } - - /** - * Filter the query on the cueout column - * - * @param string|array $dbCueout 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCueout($dbCueout = null, $comparison = null) - { - if (is_array($dbCueout)) { - $useMinMax = false; - if (isset($dbCueout['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueout['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout, $comparison); - } - - /** - * Filter the query on the fadein column - * - * @param string|array $dbFadein 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFadein($dbFadein = null, $comparison = null) - { - if (is_array($dbFadein)) { - $useMinMax = false; - if (isset($dbFadein['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadein['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein, $comparison); - } - - /** - * Filter the query on the fadeout column - * - * @param string|array $dbFadeout 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFadeout($dbFadeout = null, $comparison = null) - { - if (is_array($dbFadeout)) { - $useMinMax = false; - if (isset($dbFadeout['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeout['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout, $comparison); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Filter the query by a related CcPlaylist object - * - * @param CcPlaylist $ccPlaylist the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylist relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); - - // 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, 'CcPlaylist'); - } - - return $this; - } - - /** - * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); - } - - /** - * Exclude object from result - * - * @param CcPlaylistcontents $ccPlaylistcontents Object to remove from the list of results - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function prune($ccPlaylistcontents = null) - { - if ($ccPlaylistcontents) { - $this->addUsingAlias(CcPlaylistcontentsPeer::ID, $ccPlaylistcontents->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPlaylistcontentsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPref.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPref.php deleted file mode 100644 index b1d9a307e..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPref.php +++ /dev/null @@ -1,905 +0,0 @@ -id; - } - - /** - * Get the [subjid] column value. - * - * @return int - */ - public function getSubjid() - { - return $this->subjid; - } - - /** - * Get the [keystr] column value. - * - * @return string - */ - public function getKeystr() - { - return $this->keystr; - } - - /** - * Get the [valstr] column value. - * - * @return string - */ - public function getValstr() - { - return $this->valstr; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPrefPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [subjid] column. - * - * @param int $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setSubjid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subjid !== $v) { - $this->subjid = $v; - $this->modifiedColumns[] = CcPrefPeer::SUBJID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setSubjid() - - /** - * Set the value of [keystr] column. - * - * @param string $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setKeystr($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->keystr !== $v) { - $this->keystr = $v; - $this->modifiedColumns[] = CcPrefPeer::KEYSTR; - } - - return $this; - } // setKeystr() - - /** - * Set the value of [valstr] column. - * - * @param string $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setValstr($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->valstr !== $v) { - $this->valstr = $v; - $this->modifiedColumns[] = CcPrefPeer::VALSTR; - } - - return $this; - } // setValstr() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->subjid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->keystr = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->valstr = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPref object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->subjid !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPrefPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPrefQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPrefPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPrefPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPrefPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPrefPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPrefPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getSubjid(); - break; - case 2: - return $this->getKeystr(); - break; - case 3: - return $this->getValstr(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPrefPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getSubjid(), - $keys[2] => $this->getKeystr(), - $keys[3] => $this->getValstr(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setSubjid($value); - break; - case 2: - $this->setKeystr($value); - break; - case 3: - $this->setValstr($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPrefPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSubjid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setKeystr($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setValstr($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPrefPeer::ID)) $criteria->add(CcPrefPeer::ID, $this->id); - if ($this->isColumnModified(CcPrefPeer::SUBJID)) $criteria->add(CcPrefPeer::SUBJID, $this->subjid); - if ($this->isColumnModified(CcPrefPeer::KEYSTR)) $criteria->add(CcPrefPeer::KEYSTR, $this->keystr); - if ($this->isColumnModified(CcPrefPeer::VALSTR)) $criteria->add(CcPrefPeer::VALSTR, $this->valstr); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPref (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setSubjid($this->subjid); - $copyObj->setKeystr($this->keystr); - $copyObj->setValstr($this->valstr); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPref Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPrefPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPrefPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPref The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setSubjid(NULL); - } else { - $this->setSubjid($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPref($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subjid !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subjid, $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->aCcSubjs->addCcPrefs($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->subjid = null; - $this->keystr = null; - $this->valstr = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPref diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefPeer.php deleted file mode 100644 index cb6345eac..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefPeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('Id', 'Subjid', 'Keystr', 'Valstr', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'subjid', 'keystr', 'valstr', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SUBJID, self::KEYSTR, self::VALSTR, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SUBJID', 'KEYSTR', 'VALSTR', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'subjid', 'keystr', 'valstr', ), - 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 ('Id' => 0, 'Subjid' => 1, 'Keystr' => 2, 'Valstr' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 3, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SUBJID => 1, self::KEYSTR => 2, self::VALSTR => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SUBJID' => 1, 'KEYSTR' => 2, 'VALSTR' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPrefPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPrefPeer::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(CcPrefPeer::ID); - $criteria->addSelectColumn(CcPrefPeer::SUBJID); - $criteria->addSelectColumn(CcPrefPeer::KEYSTR); - $criteria->addSelectColumn(CcPrefPeer::VALSTR); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.SUBJID'); - $criteria->addSelectColumn($alias . '.KEYSTR'); - $criteria->addSelectColumn($alias . '.VALSTR'); - } - } - - /** - * 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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::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 CcPref - * @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 = CcPrefPeer::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 CcPrefPeer::populateObjects(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPrefPeer::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 CcPref $value A CcPref object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPref $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcPref object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPref) { - $key = (string) $value->getId(); - } 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 CcPref 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 CcPref 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_pref - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPrefPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPrefPeer::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; - CcPrefPeer::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 (CcPref object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPrefPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPrefPeer::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 + CcPrefPeer::NUM_COLUMNS; - } else { - $cls = CcPrefPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPrefPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::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 CcPref objects pre-filled with their CcSubjs 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 CcPref objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPrefPeer::addSelectColumns($criteria); - $startcol = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPrefPeer::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 = CcPrefPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPrefPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPref) to $obj2 (CcSubjs) - $obj2->addCcPref($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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::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 CcPref 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 CcPref 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); - } - - CcPrefPeer::addSelectColumns($criteria); - $startcol2 = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPrefPeer::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 = CcPrefPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPrefPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPref) to the collection in $obj2 (CcSubjs) - $obj2->addCcPref($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(BaseCcPrefPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPrefPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPrefTableMap()); - } - } - - /** - * 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 ? CcPrefPeer::CLASS_DEFAULT : CcPrefPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPref or Criteria object. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPref object - } - - if ($criteria->containsKey(CcPrefPeer::ID) && $criteria->keyContainsValue(CcPrefPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::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 CcPref or Criteria object. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPrefPeer::ID); - $value = $criteria->remove(CcPrefPeer::ID); - if ($value) { - $selectCriteria->add(CcPrefPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPrefPeer::TABLE_NAME); - } - - } else { // $values is CcPref 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_pref 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(CcPrefPeer::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(CcPrefPeer::TABLE_NAME, $con, CcPrefPeer::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). - CcPrefPeer::clearInstancePool(); - CcPrefPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPref or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::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. - CcPrefPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPref) { // it's a model object - // invalidate the cache for this single object - CcPrefPeer::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(CcPrefPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPrefPeer::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); - CcPrefPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPref 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 CcPref $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(CcPref $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPrefPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, CcPrefPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPref - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPrefPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $pk); - - $v = CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $pks, Criteria::IN); - $objs = CcPrefPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPrefPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPrefPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefQuery.php deleted file mode 100644 index 473bafc98..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcPrefQuery.php +++ /dev/null @@ -1,320 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPref|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPrefPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPrefQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPrefPeer::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 CcPrefQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPrefPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcPrefQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcPrefPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the subjid column - * - * @param int|array $subjid 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 CcPrefQuery The current query, for fluid interface - */ - public function filterBySubjid($subjid = null, $comparison = null) - { - if (is_array($subjid)) { - $useMinMax = false; - if (isset($subjid['min'])) { - $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($subjid['max'])) { - $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid, $comparison); - } - - /** - * Filter the query on the keystr column - * - * @param string $keystr The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByKeystr($keystr = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($keystr)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $keystr)) { - $keystr = str_replace('*', '%', $keystr); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPrefPeer::KEYSTR, $keystr, $comparison); - } - - /** - * Filter the query on the valstr column - * - * @param string $valstr The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByValstr($valstr = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($valstr)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $valstr)) { - $valstr = str_replace('*', '%', $valstr); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPrefPeer::VALSTR, $valstr, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPrefPeer::SUBJID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPref $ccPref Object to remove from the list of results - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function prune($ccPref = null) - { - if ($ccPref) { - $this->addUsingAlias(CcPrefPeer::ID, $ccPref->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPrefQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedule.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedule.php deleted file mode 100644 index 26a91778d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedule.php +++ /dev/null @@ -1,1923 +0,0 @@ -clip_length = '00:00:00'; - $this->fade_in = '00:00:00'; - $this->fade_out = '00:00:00'; - $this->cue_in = '00:00:00'; - $this->cue_out = '00:00:00'; - $this->schedule_group_played = false; - $this->media_item_played = false; - } - - /** - * Initializes internal state of BaseCcSchedule object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [playlist_id] column value. - * - * @return int - */ - public function getDbPlaylistId() - { - return $this->playlist_id; - } - - /** - * Get the [optionally formatted] temporal [starts] 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 getDbStarts($format = 'Y-m-d H:i:s') - { - if ($this->starts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->starts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, 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 [optionally formatted] temporal [ends] 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 getDbEnds($format = 'Y-m-d H:i:s') - { - if ($this->ends === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ends); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, 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 [group_id] column value. - * - * @return int - */ - public function getDbGroupId() - { - return $this->group_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbFileId() - { - return $this->file_id; - } - - /** - * Get the [optionally formatted] temporal [clip_length] 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 getDbClipLength($format = '%X') - { - if ($this->clip_length === null) { - return null; - } - - - - try { - $dt = new DateTime($this->clip_length); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->clip_length, 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 [optionally formatted] temporal [fade_in] 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 getDbFadeIn($format = '%X') - { - if ($this->fade_in === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fade_in); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fade_in, 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 [optionally formatted] temporal [fade_out] 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 getDbFadeOut($format = '%X') - { - if ($this->fade_out === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fade_out); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fade_out, 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 [optionally formatted] temporal [cue_in] 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 getDbCueIn($format = '%X') - { - if ($this->cue_in === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cue_in); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cue_in, 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 [optionally formatted] temporal [cue_out] 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 getDbCueOut($format = '%X') - { - if ($this->cue_out === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cue_out); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cue_out, 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 [schedule_group_played] column value. - * - * @return boolean - */ - public function getDbScheduleGroupPlayed() - { - return $this->schedule_group_played; - } - - /** - * Get the [media_item_played] column value. - * - * @return boolean - */ - public function getDbMediaItemPlayed() - { - 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. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSchedulePeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [playlist_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbPlaylistId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->playlist_id !== $v) { - $this->playlist_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::PLAYLIST_ID; - } - - return $this; - } // setDbPlaylistId() - - /** - * Sets the value of [starts] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbStarts($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->starts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->starts !== null && $tmpDt = new DateTime($this->starts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->starts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSchedulePeer::STARTS; - } - } // if either are not null - - return $this; - } // setDbStarts() - - /** - * Sets the value of [ends] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbEnds($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->ends !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ends !== null && $tmpDt = new DateTime($this->ends)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ends = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSchedulePeer::ENDS; - } - } // if either are not null - - return $this; - } // setDbEnds() - - /** - * Set the value of [group_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbGroupId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->group_id !== $v) { - $this->group_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::GROUP_ID; - } - - return $this; - } // setDbGroupId() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbFileId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbFileId() - - /** - * Sets the value of [clip_length] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbClipLength($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->clip_length !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->clip_length !== null && $tmpDt = new DateTime($this->clip_length)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->clip_length = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CLIP_LENGTH; - } - } // if either are not null - - return $this; - } // setDbClipLength() - - /** - * Sets the value of [fade_in] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbFadeIn($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->fade_in !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fade_in !== null && $tmpDt = new DateTime($this->fade_in)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fade_in = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::FADE_IN; - } - } // if either are not null - - return $this; - } // setDbFadeIn() - - /** - * Sets the value of [fade_out] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbFadeOut($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->fade_out !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fade_out !== null && $tmpDt = new DateTime($this->fade_out)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fade_out = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::FADE_OUT; - } - } // if either are not null - - return $this; - } // setDbFadeOut() - - /** - * Sets the value of [cue_in] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbCueIn($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->cue_in !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cue_in !== null && $tmpDt = new DateTime($this->cue_in)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cue_in = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CUE_IN; - } - } // if either are not null - - return $this; - } // setDbCueIn() - - /** - * Sets the value of [cue_out] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbCueOut($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->cue_out !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cue_out !== null && $tmpDt = new DateTime($this->cue_out)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cue_out = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CUE_OUT; - } - } // if either are not null - - return $this; - } // setDbCueOut() - - /** - * Set the value of [schedule_group_played] column. - * - * @param boolean $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbScheduleGroupPlayed($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->schedule_group_played !== $v || $this->isNew()) { - $this->schedule_group_played = $v; - $this->modifiedColumns[] = CcSchedulePeer::SCHEDULE_GROUP_PLAYED; - } - - return $this; - } // setDbScheduleGroupPlayed() - - /** - * Set the value of [media_item_played] column. - * - * @param boolean $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbMediaItemPlayed($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->media_item_played !== $v || $this->isNew()) { - $this->media_item_played = $v; - $this->modifiedColumns[] = CcSchedulePeer::MEDIA_ITEM_PLAYED; - } - - return $this; - } // 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. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->clip_length !== '00:00:00') { - return false; - } - - if ($this->fade_in !== '00:00:00') { - return false; - } - - if ($this->fade_out !== '00:00:00') { - return false; - } - - if ($this->cue_in !== '00:00:00') { - return false; - } - - if ($this->cue_out !== '00:00:00') { - return false; - } - - if ($this->schedule_group_played !== false) { - return false; - } - - if ($this->media_item_played !== false) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : 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->ends = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->group_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->file_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->clip_length = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->fade_in = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->fade_out = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->cue_in = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : 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->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->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 14; // 14 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSchedule object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { - $this->aCcShowInstances = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSchedulePeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShowInstances = null; - $this->aCcFiles = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcScheduleQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstances($con); - CcSchedulePeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcSchedulePeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $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); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcSchedulePeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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 ($this->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - - if (($retval = CcSchedulePeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbPlaylistId(); - break; - case 2: - return $this->getDbStarts(); - break; - case 3: - return $this->getDbEnds(); - break; - case 4: - return $this->getDbGroupId(); - break; - case 5: - return $this->getDbFileId(); - break; - case 6: - return $this->getDbClipLength(); - break; - case 7: - return $this->getDbFadeIn(); - break; - case 8: - return $this->getDbFadeOut(); - break; - case 9: - return $this->getDbCueIn(); - break; - case 10: - return $this->getDbCueOut(); - break; - case 11: - return $this->getDbScheduleGroupPlayed(); - break; - case 12: - return $this->getDbMediaItemPlayed(); - break; - case 13: - return $this->getDbInstanceId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcSchedulePeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbPlaylistId(), - $keys[2] => $this->getDbStarts(), - $keys[3] => $this->getDbEnds(), - $keys[4] => $this->getDbGroupId(), - $keys[5] => $this->getDbFileId(), - $keys[6] => $this->getDbClipLength(), - $keys[7] => $this->getDbFadeIn(), - $keys[8] => $this->getDbFadeOut(), - $keys[9] => $this->getDbCueIn(), - $keys[10] => $this->getDbCueOut(), - $keys[11] => $this->getDbScheduleGroupPlayed(), - $keys[12] => $this->getDbMediaItemPlayed(), - $keys[13] => $this->getDbInstanceId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShowInstances) { - $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbPlaylistId($value); - break; - case 2: - $this->setDbStarts($value); - break; - case 3: - $this->setDbEnds($value); - break; - case 4: - $this->setDbGroupId($value); - break; - case 5: - $this->setDbFileId($value); - break; - case 6: - $this->setDbClipLength($value); - break; - case 7: - $this->setDbFadeIn($value); - break; - case 8: - $this->setDbFadeOut($value); - break; - case 9: - $this->setDbCueIn($value); - break; - case 10: - $this->setDbCueOut($value); - break; - case 11: - $this->setDbScheduleGroupPlayed($value); - break; - case 12: - $this->setDbMediaItemPlayed($value); - break; - case 13: - $this->setDbInstanceId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSchedulePeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbStarts($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbEnds($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbGroupId($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbFileId($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbClipLength($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbFadeIn($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbFadeOut($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbCueIn($arr[$keys[9]]); - 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[12], $arr)) $this->setDbMediaItemPlayed($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setDbInstanceId($arr[$keys[13]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSchedulePeer::ID)) $criteria->add(CcSchedulePeer::ID, $this->id); - if ($this->isColumnModified(CcSchedulePeer::PLAYLIST_ID)) $criteria->add(CcSchedulePeer::PLAYLIST_ID, $this->playlist_id); - if ($this->isColumnModified(CcSchedulePeer::STARTS)) $criteria->add(CcSchedulePeer::STARTS, $this->starts); - if ($this->isColumnModified(CcSchedulePeer::ENDS)) $criteria->add(CcSchedulePeer::ENDS, $this->ends); - if ($this->isColumnModified(CcSchedulePeer::GROUP_ID)) $criteria->add(CcSchedulePeer::GROUP_ID, $this->group_id); - if ($this->isColumnModified(CcSchedulePeer::FILE_ID)) $criteria->add(CcSchedulePeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcSchedulePeer::CLIP_LENGTH)) $criteria->add(CcSchedulePeer::CLIP_LENGTH, $this->clip_length); - if ($this->isColumnModified(CcSchedulePeer::FADE_IN)) $criteria->add(CcSchedulePeer::FADE_IN, $this->fade_in); - if ($this->isColumnModified(CcSchedulePeer::FADE_OUT)) $criteria->add(CcSchedulePeer::FADE_OUT, $this->fade_out); - if ($this->isColumnModified(CcSchedulePeer::CUE_IN)) $criteria->add(CcSchedulePeer::CUE_IN, $this->cue_in); - 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::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; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSchedule (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbPlaylistId($this->playlist_id); - $copyObj->setDbStarts($this->starts); - $copyObj->setDbEnds($this->ends); - $copyObj->setDbGroupId($this->group_id); - $copyObj->setDbFileId($this->file_id); - $copyObj->setDbClipLength($this->clip_length); - $copyObj->setDbFadeIn($this->fade_in); - $copyObj->setDbFadeOut($this->fade_out); - $copyObj->setDbCueIn($this->cue_in); - $copyObj->setDbCueOut($this->cue_out); - $copyObj->setDbScheduleGroupPlayed($this->schedule_group_played); - $copyObj->setDbMediaItemPlayed($this->media_item_played); - $copyObj->setDbInstanceId($this->instance_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSchedule Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSchedulePeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSchedulePeer(); - } - 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) - { - // aggregate_column_relation behavior - if (null !== $this->aCcShowInstances && $v !== $this->aCcShowInstances) { - $this->oldCcShowInstances = $this->aCcShowInstances; - } - 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; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcSchedule The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbFileId(NULL); - } else { - $this->setDbFileId($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcSchedule($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcSchedules($this); - */ - } - return $this->aCcFiles; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->playlist_id = null; - $this->starts = null; - $this->ends = null; - $this->group_id = null; - $this->file_id = null; - $this->clip_length = null; - $this->fade_in = null; - $this->fade_out = null; - $this->cue_in = null; - $this->cue_out = null; - $this->schedule_group_played = null; - $this->media_item_played = null; - $this->instance_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShowInstances = null; - $this->aCcFiles = null; - } - - // aggregate_column_relation behavior - - /** - * Update the aggregate column in the related CcShowInstances object - * - * @param PropelPDO $con A connection object - */ - protected function updateRelatedCcShowInstances(PropelPDO $con) - { - if ($ccShowInstances = $this->getCcShowInstances()) { - $ccShowInstances->updateDbTimeFilled($con); - } - if ($this->oldCcShowInstances) { - $this->oldCcShowInstances->updateDbTimeFilled($con); - $this->oldCcShowInstances = null; - } - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSchedule diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedulePeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedulePeer.php deleted file mode 100644 index b21b26990..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSchedulePeer.php +++ /dev/null @@ -1,1420 +0,0 @@ - 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', '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, 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', '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', 'instance_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) - ); - - /** - * 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, '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, '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, 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, '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, 'instance_id' => 13, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSchedulePeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSchedulePeer::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(CcSchedulePeer::ID); - $criteria->addSelectColumn(CcSchedulePeer::PLAYLIST_ID); - $criteria->addSelectColumn(CcSchedulePeer::STARTS); - $criteria->addSelectColumn(CcSchedulePeer::ENDS); - $criteria->addSelectColumn(CcSchedulePeer::GROUP_ID); - $criteria->addSelectColumn(CcSchedulePeer::FILE_ID); - $criteria->addSelectColumn(CcSchedulePeer::CLIP_LENGTH); - $criteria->addSelectColumn(CcSchedulePeer::FADE_IN); - $criteria->addSelectColumn(CcSchedulePeer::FADE_OUT); - $criteria->addSelectColumn(CcSchedulePeer::CUE_IN); - $criteria->addSelectColumn(CcSchedulePeer::CUE_OUT); - $criteria->addSelectColumn(CcSchedulePeer::SCHEDULE_GROUP_PLAYED); - $criteria->addSelectColumn(CcSchedulePeer::MEDIA_ITEM_PLAYED); - $criteria->addSelectColumn(CcSchedulePeer::INSTANCE_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); - $criteria->addSelectColumn($alias . '.STARTS'); - $criteria->addSelectColumn($alias . '.ENDS'); - $criteria->addSelectColumn($alias . '.GROUP_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.CLIP_LENGTH'); - $criteria->addSelectColumn($alias . '.FADE_IN'); - $criteria->addSelectColumn($alias . '.FADE_OUT'); - $criteria->addSelectColumn($alias . '.CUE_IN'); - $criteria->addSelectColumn($alias . '.CUE_OUT'); - $criteria->addSelectColumn($alias . '.SCHEDULE_GROUP_PLAYED'); - $criteria->addSelectColumn($alias . '.MEDIA_ITEM_PLAYED'); - $criteria->addSelectColumn($alias . '.INSTANCE_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(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 - $criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::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 CcSchedule - * @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 = CcSchedulePeer::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 CcSchedulePeer::populateObjects(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSchedulePeer::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 CcSchedule $value A CcSchedule object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSchedule $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 CcSchedule object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSchedule) { - $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 CcSchedule 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 CcSchedule 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_schedule - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcSchedulePeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSchedulePeer::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; - CcSchedulePeer::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 (CcSchedule object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSchedulePeer::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 + CcSchedulePeer::NUM_COLUMNS; - } else { - $cls = CcSchedulePeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSchedulePeer::addInstanceToPool($obj, $key); - } - 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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Selects a collection of CcSchedule objects pre-filled with their CcFiles 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 doSelectJoinCcFiles(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); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcSchedule) to $obj2 (CcFiles) - $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); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj3 (CcFiles) - $obj3->addCcSchedule($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShowInstances(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 should not affect 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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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 should not affect 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 except CcShowInstances. - * - * @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 doSelectJoinAllExceptCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcSchedulePeer::addSelectColumns($criteria); - $startcol2 = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj2 (CcFiles) - $obj2->addCcSchedule($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcSchedule objects pre-filled with all related objects except CcFiles. - * - * @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 doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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 already loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj2 (CcShowInstances) - $obj2->addCcSchedule($obj1); - - } // if joined row is 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(BaseCcSchedulePeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSchedulePeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcScheduleTableMap()); - } - } - - /** - * 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 ? CcSchedulePeer::CLASS_DEFAULT : CcSchedulePeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSchedule or Criteria object. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $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 - $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 CcSchedule or Criteria object. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSchedulePeer::ID); - $value = $criteria->remove(CcSchedulePeer::ID); - if ($value) { - $selectCriteria->add(CcSchedulePeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME); - } - - } else { // $values is CcSchedule 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_schedule 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(CcSchedulePeer::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(CcSchedulePeer::TABLE_NAME, $con, CcSchedulePeer::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). - CcSchedulePeer::clearInstancePool(); - CcSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSchedule or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::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. - CcSchedulePeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSchedule) { // it's a model object - // invalidate the cache for this single object - CcSchedulePeer::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(CcSchedulePeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSchedulePeer::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); - CcSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSchedule 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 CcSchedule $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(CcSchedule $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSchedulePeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, CcSchedulePeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSchedule - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSchedulePeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $pk); - - $v = CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $pks, Criteria::IN); - $objs = CcSchedulePeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSchedulePeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSchedulePeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcScheduleQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcScheduleQuery.php deleted file mode 100644 index 11a030d84..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcScheduleQuery.php +++ /dev/null @@ -1,814 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSchedule|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSchedulePeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery 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(CcSchedulePeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the playlist_id column - * - * @param int|array $dbPlaylistId 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 filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) - { - if (is_array($dbPlaylistId)) { - $useMinMax = false; - if (isset($dbPlaylistId['min'])) { - $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPlaylistId['max'])) { - $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId, $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 CcScheduleQuery 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(CcSchedulePeer::STARTS, $dbStarts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStarts['max'])) { - $this->addUsingAlias(CcSchedulePeer::STARTS, $dbStarts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery 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(CcSchedulePeer::ENDS, $dbEnds['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEnds['max'])) { - $this->addUsingAlias(CcSchedulePeer::ENDS, $dbEnds['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::ENDS, $dbEnds, $comparison); - } - - /** - * Filter the query on the group_id column - * - * @param int|array $dbGroupId 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 filterByDbGroupId($dbGroupId = null, $comparison = null) - { - if (is_array($dbGroupId)) { - $useMinMax = false; - if (isset($dbGroupId['min'])) { - $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbGroupId['max'])) { - $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbFileId 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 filterByDbFileId($dbFileId = null, $comparison = null) - { - if (is_array($dbFileId)) { - $useMinMax = false; - if (isset($dbFileId['min'])) { - $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFileId['max'])) { - $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId, $comparison); - } - - /** - * Filter the query on the clip_length column - * - * @param string|array $dbClipLength 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 filterByDbClipLength($dbClipLength = null, $comparison = null) - { - if (is_array($dbClipLength)) { - $useMinMax = false; - if (isset($dbClipLength['min'])) { - $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbClipLength['max'])) { - $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength, $comparison); - } - - /** - * Filter the query on the fade_in column - * - * @param string|array $dbFadeIn 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 filterByDbFadeIn($dbFadeIn = null, $comparison = null) - { - if (is_array($dbFadeIn)) { - $useMinMax = false; - if (isset($dbFadeIn['min'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeIn['max'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn, $comparison); - } - - /** - * Filter the query on the fade_out column - * - * @param string|array $dbFadeOut 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 filterByDbFadeOut($dbFadeOut = null, $comparison = null) - { - if (is_array($dbFadeOut)) { - $useMinMax = false; - if (isset($dbFadeOut['min'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeOut['max'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut, $comparison); - } - - /** - * Filter the query on the cue_in column - * - * @param string|array $dbCueIn 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 filterByDbCueIn($dbCueIn = null, $comparison = null) - { - if (is_array($dbCueIn)) { - $useMinMax = false; - if (isset($dbCueIn['min'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueIn['max'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn, $comparison); - } - - /** - * Filter the query on the cue_out column - * - * @param string|array $dbCueOut 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 filterByDbCueOut($dbCueOut = null, $comparison = null) - { - if (is_array($dbCueOut)) { - $useMinMax = false; - if (isset($dbCueOut['min'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueOut['max'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut, $comparison); - } - - /** - * Filter the query on the schedule_group_played column - * - * @param boolean|string $dbScheduleGroupPlayed The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function filterByDbScheduleGroupPlayed($dbScheduleGroupPlayed = null, $comparison = null) - { - if (is_string($dbScheduleGroupPlayed)) { - $schedule_group_played = in_array(strtolower($dbScheduleGroupPlayed), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - return $this->addUsingAlias(CcSchedulePeer::SCHEDULE_GROUP_PLAYED, $dbScheduleGroupPlayed, $comparison); - } - - /** - * Filter the query on the media_item_played column - * - * @param boolean|string $dbMediaItemPlayed The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function filterByDbMediaItemPlayed($dbMediaItemPlayed = null, $comparison = null) - { - if (is_string($dbMediaItemPlayed)) { - $media_item_played = in_array(strtolower($dbMediaItemPlayed), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - 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'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles 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 filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcSchedulePeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles 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 joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Exclude object from result - * - * @param CcSchedule $ccSchedule Object to remove from the list of results - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function prune($ccSchedule = null) - { - if ($ccSchedule) { - $this->addUsingAlias(CcSchedulePeer::ID, $ccSchedule->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // aggregate_column_relation behavior - $this->findRelatedCcShowInstancess($con); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstancess($con); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associatiove array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), ortherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // aggregate_column_relation behavior - $this->findRelatedCcShowInstancess($con); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of udated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstancess($con); - - return $this->postUpdate($affectedRows, $con); - } - - // aggregate_column_relation behavior - - /** - * Finds the related CcShowInstances objects and keep them for later - * - * @param PropelPDO $con A connection object - */ - protected function findRelatedCcShowInstancess($con) - { - $criteria = clone $this; - if ($this->useAliasInSQL) { - $alias = $this->getModelAlias(); - $criteria->removeAlias($alias); - } else { - $alias = ''; - } - $this->ccShowInstancess = CcShowInstancesQuery::create() - ->joinCcSchedule($alias) - ->mergeWith($criteria) - ->find($con); - } - - protected function updateRelatedCcShowInstancess($con) - { - foreach ($this->ccShowInstancess as $ccShowInstances) { - $ccShowInstances->updateDbTimeFilled($con); - } - $this->ccShowInstancess = array(); - } - -} // BaseCcScheduleQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegister.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegister.php deleted file mode 100644 index dbb3aa6a2..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegister.php +++ /dev/null @@ -1,708 +0,0 @@ -name; - } - - /** - * Get the [ip] column value. - * - * @return string - */ - public function getDbIp() - { - return $this->ip; - } - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcServiceRegister The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = CcServiceRegisterPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [ip] column. - * - * @param string $v new value - * @return CcServiceRegister The current object (for fluent API support) - */ - public function setDbIp($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ip !== $v) { - $this->ip = $v; - $this->modifiedColumns[] = CcServiceRegisterPeer::IP; - } - - return $this; - } // setDbIp() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->name = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->ip = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcServiceRegisterPeer::NUM_COLUMNS - CcServiceRegisterPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcServiceRegister object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcServiceRegisterPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcServiceRegisterQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcServiceRegisterPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcServiceRegisterPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcServiceRegisterPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcServiceRegisterPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbName(); - break; - case 1: - return $this->getDbIp(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcServiceRegisterPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbName(), - $keys[1] => $this->getDbIp(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcServiceRegisterPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbName($value); - break; - case 1: - $this->setDbIp($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcServiceRegisterPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbName($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbIp($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcServiceRegisterPeer::NAME)) $criteria->add(CcServiceRegisterPeer::NAME, $this->name); - if ($this->isColumnModified(CcServiceRegisterPeer::IP)) $criteria->add(CcServiceRegisterPeer::IP, $this->ip); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $this->name); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbName(); - } - - /** - * Generic method to set the primary key (name column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbName($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbName(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcServiceRegister (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbIp($this->ip); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcServiceRegister Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcServiceRegisterPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcServiceRegisterPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->name = null; - $this->ip = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcServiceRegister diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterPeer.php deleted file mode 100644 index ab7d35634..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbName', 'DbIp', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbName', 'dbIp', ), - BasePeer::TYPE_COLNAME => array (self::NAME, self::IP, ), - BasePeer::TYPE_RAW_COLNAME => array ('NAME', 'IP', ), - BasePeer::TYPE_FIELDNAME => array ('name', 'ip', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbName' => 0, 'DbIp' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbName' => 0, 'dbIp' => 1, ), - BasePeer::TYPE_COLNAME => array (self::NAME => 0, self::IP => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('NAME' => 0, 'IP' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('name' => 0, 'ip' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcServiceRegisterPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcServiceRegisterPeer::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(CcServiceRegisterPeer::NAME); - $criteria->addSelectColumn(CcServiceRegisterPeer::IP); - } else { - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.IP'); - } - } - - /** - * 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(CcServiceRegisterPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcServiceRegisterPeer::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(CcServiceRegisterPeer::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 CcServiceRegister - * @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 = CcServiceRegisterPeer::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 CcServiceRegisterPeer::populateObjects(CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcServiceRegisterPeer::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 CcServiceRegister $value A CcServiceRegister object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcServiceRegister $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbName(); - } // 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 CcServiceRegister object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcServiceRegister) { - $key = (string) $value->getDbName(); - } 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 CcServiceRegister 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 CcServiceRegister 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_service_register - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcServiceRegisterPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcServiceRegisterPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcServiceRegisterPeer::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; - CcServiceRegisterPeer::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 (CcServiceRegister object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcServiceRegisterPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcServiceRegisterPeer::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 + CcServiceRegisterPeer::NUM_COLUMNS; - } else { - $cls = CcServiceRegisterPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcServiceRegisterPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcServiceRegisterPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcServiceRegisterPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcServiceRegisterTableMap()); - } - } - - /** - * 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 ? CcServiceRegisterPeer::CLASS_DEFAULT : CcServiceRegisterPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcServiceRegister or Criteria object. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcServiceRegister object - } - - - // 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 CcServiceRegister or Criteria object. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcServiceRegisterPeer::NAME); - $value = $criteria->remove(CcServiceRegisterPeer::NAME); - if ($value) { - $selectCriteria->add(CcServiceRegisterPeer::NAME, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcServiceRegisterPeer::TABLE_NAME); - } - - } else { // $values is CcServiceRegister 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_service_register 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(CcServiceRegisterPeer::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(CcServiceRegisterPeer::TABLE_NAME, $con, CcServiceRegisterPeer::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). - CcServiceRegisterPeer::clearInstancePool(); - CcServiceRegisterPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcServiceRegister or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::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. - CcServiceRegisterPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcServiceRegister) { // it's a model object - // invalidate the cache for this single object - CcServiceRegisterPeer::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(CcServiceRegisterPeer::NAME, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcServiceRegisterPeer::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); - CcServiceRegisterPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcServiceRegister 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 CcServiceRegister $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(CcServiceRegister $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcServiceRegisterPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, CcServiceRegisterPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcServiceRegister - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcServiceRegisterPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $pk); - - $v = CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $pks, Criteria::IN); - $objs = CcServiceRegisterPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcServiceRegisterPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcServiceRegisterPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterQuery.php deleted file mode 100644 index a8df529a7..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcServiceRegisterQuery.php +++ /dev/null @@ -1,196 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcServiceRegister|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcServiceRegisterPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $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 CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $keys, Criteria::IN); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the ip column - * - * @param string $dbIp The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByDbIp($dbIp = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIp)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIp)) { - $dbIp = str_replace('*', '%', $dbIp); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcServiceRegisterPeer::IP, $dbIp, $comparison); - } - - /** - * Exclude object from result - * - * @param CcServiceRegister $ccServiceRegister Object to remove from the list of results - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function prune($ccServiceRegister = null) - { - if ($ccServiceRegister) { - $this->addUsingAlias(CcServiceRegisterPeer::NAME, $ccServiceRegister->getDbName(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcServiceRegisterQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSess.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSess.php deleted file mode 100644 index 8ae2463af..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSess.php +++ /dev/null @@ -1,949 +0,0 @@ -sessid; - } - - /** - * Get the [userid] column value. - * - * @return int - */ - public function getUserid() - { - return $this->userid; - } - - /** - * Get the [login] column value. - * - * @return string - */ - public function getLogin() - { - return $this->login; - } - - /** - * Get the [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [sessid] column. - * - * @param string $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setSessid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sessid !== $v) { - $this->sessid = $v; - $this->modifiedColumns[] = CcSessPeer::SESSID; - } - - return $this; - } // setSessid() - - /** - * Set the value of [userid] column. - * - * @param int $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setUserid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->userid !== $v) { - $this->userid = $v; - $this->modifiedColumns[] = CcSessPeer::USERID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setUserid() - - /** - * Set the value of [login] column. - * - * @param string $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setLogin($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->login !== $v) { - $this->login = $v; - $this->modifiedColumns[] = CcSessPeer::LOGIN; - } - - return $this; - } // setLogin() - - /** - * Sets the value of [ts] 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 CcSess The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSessPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->sessid = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->userid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->login = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->ts = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSess object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->userid !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSessPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSessQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSessPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setNew(false); - } else { - $affectedRows += CcSessPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcSessPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getSessid(); - break; - case 1: - return $this->getUserid(); - break; - case 2: - return $this->getLogin(); - break; - case 3: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcSessPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getSessid(), - $keys[1] => $this->getUserid(), - $keys[2] => $this->getLogin(), - $keys[3] => $this->getTs(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setSessid($value); - break; - case 1: - $this->setUserid($value); - break; - case 2: - $this->setLogin($value); - break; - case 3: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSessPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setSessid($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setUserid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setLogin($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setTs($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSessPeer::SESSID)) $criteria->add(CcSessPeer::SESSID, $this->sessid); - if ($this->isColumnModified(CcSessPeer::USERID)) $criteria->add(CcSessPeer::USERID, $this->userid); - if ($this->isColumnModified(CcSessPeer::LOGIN)) $criteria->add(CcSessPeer::LOGIN, $this->login); - if ($this->isColumnModified(CcSessPeer::TS)) $criteria->add(CcSessPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $this->sessid); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getSessid(); - } - - /** - * Generic method to set the primary key (sessid column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setSessid($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getSessid(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSess (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setSessid($this->sessid); - $copyObj->setUserid($this->userid); - $copyObj->setLogin($this->login); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSess Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSessPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSessPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcSess The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setUserid(NULL); - } else { - $this->setUserid($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcSess($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->userid !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->userid, $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->aCcSubjs->addCcSesss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->sessid = null; - $this->userid = null; - $this->login = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSess diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessPeer.php deleted file mode 100644 index 70eab561a..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessPeer.php +++ /dev/null @@ -1,979 +0,0 @@ - array ('Sessid', 'Userid', 'Login', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('sessid', 'userid', 'login', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::SESSID, self::USERID, self::LOGIN, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('SESSID', 'USERID', 'LOGIN', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('sessid', 'userid', 'login', 'ts', ), - 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 ('Sessid' => 0, 'Userid' => 1, 'Login' => 2, 'Ts' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 3, ), - BasePeer::TYPE_COLNAME => array (self::SESSID => 0, self::USERID => 1, self::LOGIN => 2, self::TS => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('SESSID' => 0, 'USERID' => 1, 'LOGIN' => 2, 'TS' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSessPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSessPeer::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(CcSessPeer::SESSID); - $criteria->addSelectColumn(CcSessPeer::USERID); - $criteria->addSelectColumn(CcSessPeer::LOGIN); - $criteria->addSelectColumn(CcSessPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.SESSID'); - $criteria->addSelectColumn($alias . '.USERID'); - $criteria->addSelectColumn($alias . '.LOGIN'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::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 CcSess - * @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 = CcSessPeer::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 CcSessPeer::populateObjects(CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSessPeer::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 CcSess $value A CcSess object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSess $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getSessid(); - } // 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 CcSess object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSess) { - $key = (string) $value->getSessid(); - } 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 CcSess 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 CcSess 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_sess - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcSessPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSessPeer::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; - CcSessPeer::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 (CcSess object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSessPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSessPeer::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 + CcSessPeer::NUM_COLUMNS; - } else { - $cls = CcSessPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSessPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::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 CcSess objects pre-filled with their CcSubjs 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 CcSess objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcSessPeer::addSelectColumns($criteria); - $startcol = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcSessPeer::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 = CcSessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcSessPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcSess) to $obj2 (CcSubjs) - $obj2->addCcSess($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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::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 CcSess 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 CcSess 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); - } - - CcSessPeer::addSelectColumns($criteria); - $startcol2 = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcSessPeer::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 = CcSessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcSessPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcSess) to the collection in $obj2 (CcSubjs) - $obj2->addCcSess($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(BaseCcSessPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSessPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSessTableMap()); - } - } - - /** - * 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 ? CcSessPeer::CLASS_DEFAULT : CcSessPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSess or Criteria object. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSess object - } - - - // 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 CcSess or Criteria object. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSessPeer::SESSID); - $value = $criteria->remove(CcSessPeer::SESSID); - if ($value) { - $selectCriteria->add(CcSessPeer::SESSID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSessPeer::TABLE_NAME); - } - - } else { // $values is CcSess 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_sess 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(CcSessPeer::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(CcSessPeer::TABLE_NAME, $con, CcSessPeer::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). - CcSessPeer::clearInstancePool(); - CcSessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSess or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::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. - CcSessPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSess) { // it's a model object - // invalidate the cache for this single object - CcSessPeer::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(CcSessPeer::SESSID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSessPeer::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); - CcSessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSess 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 CcSess $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(CcSess $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSessPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSessPeer::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(CcSessPeer::DATABASE_NAME, CcSessPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSess - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSessPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $pk); - - $v = CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $pks, Criteria::IN); - $objs = CcSessPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSessPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSessPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessQuery.php deleted file mode 100644 index f0b500f83..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSessQuery.php +++ /dev/null @@ -1,334 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSess|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSessPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSessQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSessPeer::SESSID, $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 CcSessQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSessPeer::SESSID, $keys, Criteria::IN); - } - - /** - * Filter the query on the sessid column - * - * @param string $sessid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterBySessid($sessid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($sessid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $sessid)) { - $sessid = str_replace('*', '%', $sessid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSessPeer::SESSID, $sessid, $comparison); - } - - /** - * Filter the query on the userid column - * - * @param int|array $userid 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 CcSessQuery The current query, for fluid interface - */ - public function filterByUserid($userid = null, $comparison = null) - { - if (is_array($userid)) { - $useMinMax = false; - if (isset($userid['min'])) { - $this->addUsingAlias(CcSessPeer::USERID, $userid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($userid['max'])) { - $this->addUsingAlias(CcSessPeer::USERID, $userid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSessPeer::USERID, $userid, $comparison); - } - - /** - * Filter the query on the login column - * - * @param string $login The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterByLogin($login = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($login)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $login)) { - $login = str_replace('*', '%', $login); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSessPeer::LOGIN, $login, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcSessQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcSessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcSessPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSessPeer::TS, $ts, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSessQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcSess $ccSess Object to remove from the list of results - * - * @return CcSessQuery The current query, for fluid interface - */ - public function prune($ccSess = null) - { - if ($ccSess) { - $this->addUsingAlias(CcSessPeer::SESSID, $ccSess->getSessid(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSessQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShow.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShow.php deleted file mode 100644 index b2ab6b257..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShow.php +++ /dev/null @@ -1,1654 +0,0 @@ -name = ''; - $this->url = ''; - $this->genre = ''; - } - - /** - * Initializes internal state of BaseCcShow object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getDbUrl() - { - return $this->url; - } - - /** - * Get the [genre] column value. - * - * @return string - */ - public function getDbGenre() - { - return $this->genre; - } - - /** - * Get the [description] column value. - * - * @return string - */ - public function getDbDescription() - { - return $this->description; - } - - /** - * Get the [color] column value. - * - * @return string - */ - public function getDbColor() - { - return $this->color; - } - - /** - * Get the [background_color] column value. - * - * @return string - */ - public function getDbBackgroundColor() - { - return $this->background_color; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcShowPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v || $this->isNew()) { - $this->url = $v; - $this->modifiedColumns[] = CcShowPeer::URL; - } - - return $this; - } // setDbUrl() - - /** - * Set the value of [genre] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbGenre($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->genre !== $v || $this->isNew()) { - $this->genre = $v; - $this->modifiedColumns[] = CcShowPeer::GENRE; - } - - return $this; - } // setDbGenre() - - /** - * Set the value of [description] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->description !== $v) { - $this->description = $v; - $this->modifiedColumns[] = CcShowPeer::DESCRIPTION; - } - - return $this; - } // setDbDescription() - - /** - * Set the value of [color] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbColor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->color !== $v) { - $this->color = $v; - $this->modifiedColumns[] = CcShowPeer::COLOR; - } - - return $this; - } // setDbColor() - - /** - * Set the value of [background_color] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbBackgroundColor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->background_color !== $v) { - $this->background_color = $v; - $this->modifiedColumns[] = CcShowPeer::BACKGROUND_COLOR; - } - - return $this; - } // setDbBackgroundColor() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->url !== '') { - return false; - } - - if ($this->genre !== '') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->url = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->genre = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->description = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->background_color = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 7; // 7 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShow object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcShowInstancess = null; - - $this->collCcShowDayss = null; - - $this->collCcShowRebroadcasts = null; - - $this->collCcShowHostss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcShowPeer::doUpdate($this, $con); - } - - $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) { - foreach ($this->collCcShowDayss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowRebroadcasts !== null) { - foreach ($this->collCcShowRebroadcasts as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcShowPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancess !== null) { - foreach ($this->collCcShowInstancess as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowDayss !== null) { - foreach ($this->collCcShowDayss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowRebroadcasts !== null) { - foreach ($this->collCcShowRebroadcasts as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbName(); - break; - case 2: - return $this->getDbUrl(); - break; - case 3: - return $this->getDbGenre(); - break; - case 4: - return $this->getDbDescription(); - break; - case 5: - return $this->getDbColor(); - break; - case 6: - return $this->getDbBackgroundColor(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcShowPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbName(), - $keys[2] => $this->getDbUrl(), - $keys[3] => $this->getDbGenre(), - $keys[4] => $this->getDbDescription(), - $keys[5] => $this->getDbColor(), - $keys[6] => $this->getDbBackgroundColor(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbName($value); - break; - case 2: - $this->setDbUrl($value); - break; - case 3: - $this->setDbGenre($value); - break; - case 4: - $this->setDbDescription($value); - break; - case 5: - $this->setDbColor($value); - break; - case 6: - $this->setDbBackgroundColor($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowPeer::getFieldNames($keyType); - - 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[2], $arr)) $this->setDbUrl($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbGenre($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbDescription($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbColor($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbBackgroundColor($arr[$keys[6]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - - 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::URL)) $criteria->add(CcShowPeer::URL, $this->url); - if ($this->isColumnModified(CcShowPeer::GENRE)) $criteria->add(CcShowPeer::GENRE, $this->genre); - 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::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShow (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbUrl($this->url); - $copyObj->setDbGenre($this->genre); - $copyObj->setDbDescription($this->description); - $copyObj->setDbColor($this->color); - $copyObj->setDbBackgroundColor($this->background_color); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $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) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowDays($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowRebroadcasts() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowRebroadcast($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowHostss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowHosts($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShow Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowPeer(); - } - 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); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShowInstancesRelatedByDbOriginalShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShowInstancesRelatedByDbOriginalShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - /** - * Clears out the collCcShowDayss 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 addCcShowDayss() - */ - public function clearCcShowDayss() - { - $this->collCcShowDayss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowDayss collection. - * - * By default this just sets the collCcShowDayss collection to an empty array (like clearcollCcShowDayss()); - * 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 initCcShowDayss() - { - $this->collCcShowDayss = new PropelObjectCollection(); - $this->collCcShowDayss->setModel('CcShowDays'); - } - - /** - * Gets an array of CcShowDays objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this CcShow is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowDays[] List of CcShowDays objects - * @throws PropelException - */ - public function getCcShowDayss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowDayss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowDayss) { - // return empty collection - $this->initCcShowDayss(); - } else { - $collCcShowDayss = CcShowDaysQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowDayss; - } - $this->collCcShowDayss = $collCcShowDayss; - } - } - return $this->collCcShowDayss; - } - - /** - * Returns the number of related CcShowDays objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowDays objects. - * @throws PropelException - */ - public function countCcShowDayss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowDayss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowDayss) { - return 0; - } else { - $query = CcShowDaysQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowDayss); - } - } - - /** - * Method called to associate a CcShowDays object to this object - * through the CcShowDays foreign key attribute. - * - * @param CcShowDays $l CcShowDays - * @return void - * @throws PropelException - */ - public function addCcShowDays(CcShowDays $l) - { - if ($this->collCcShowDayss === null) { - $this->initCcShowDayss(); - } - if (!$this->collCcShowDayss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowDayss[]= $l; - $l->setCcShow($this); - } - } - - /** - * Clears out the collCcShowRebroadcasts 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 addCcShowRebroadcasts() - */ - public function clearCcShowRebroadcasts() - { - $this->collCcShowRebroadcasts = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowRebroadcasts collection. - * - * By default this just sets the collCcShowRebroadcasts collection to an empty array (like clearcollCcShowRebroadcasts()); - * 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 initCcShowRebroadcasts() - { - $this->collCcShowRebroadcasts = new PropelObjectCollection(); - $this->collCcShowRebroadcasts->setModel('CcShowRebroadcast'); - } - - /** - * Gets an array of CcShowRebroadcast 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 CcShowRebroadcast[] List of CcShowRebroadcast objects - * @throws PropelException - */ - public function getCcShowRebroadcasts($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowRebroadcasts || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowRebroadcasts) { - // return empty collection - $this->initCcShowRebroadcasts(); - } else { - $collCcShowRebroadcasts = CcShowRebroadcastQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowRebroadcasts; - } - $this->collCcShowRebroadcasts = $collCcShowRebroadcasts; - } - } - return $this->collCcShowRebroadcasts; - } - - /** - * Returns the number of related CcShowRebroadcast objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowRebroadcast objects. - * @throws PropelException - */ - public function countCcShowRebroadcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowRebroadcasts || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowRebroadcasts) { - return 0; - } else { - $query = CcShowRebroadcastQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowRebroadcasts); - } - } - - /** - * Method called to associate a CcShowRebroadcast object to this object - * through the CcShowRebroadcast foreign key attribute. - * - * @param CcShowRebroadcast $l CcShowRebroadcast - * @return void - * @throws PropelException - */ - public function addCcShowRebroadcast(CcShowRebroadcast $l) - { - if ($this->collCcShowRebroadcasts === null) { - $this->initCcShowRebroadcasts(); - } - if (!$this->collCcShowRebroadcasts->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowRebroadcasts[]= $l; - $l->setCcShow($this); - } - } - - /** - * Clears out the collCcShowHostss 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 addCcShowHostss() - */ - public function clearCcShowHostss() - { - $this->collCcShowHostss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowHostss collection. - * - * By default this just sets the collCcShowHostss collection to an empty array (like clearcollCcShowHostss()); - * 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 initCcShowHostss() - { - $this->collCcShowHostss = new PropelObjectCollection(); - $this->collCcShowHostss->setModel('CcShowHosts'); - } - - /** - * Gets an array of CcShowHosts 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 CcShowHosts[] List of CcShowHosts objects - * @throws PropelException - */ - public function getCcShowHostss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - // return empty collection - $this->initCcShowHostss(); - } else { - $collCcShowHostss = CcShowHostsQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowHostss; - } - $this->collCcShowHostss = $collCcShowHostss; - } - } - return $this->collCcShowHostss; - } - - /** - * Returns the number of related CcShowHosts objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowHosts objects. - * @throws PropelException - */ - public function countCcShowHostss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - return 0; - } else { - $query = CcShowHostsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowHostss); - } - } - - /** - * Method called to associate a CcShowHosts object to this object - * through the CcShowHosts foreign key attribute. - * - * @param CcShowHosts $l CcShowHosts - * @return void - * @throws PropelException - */ - public function addCcShowHosts(CcShowHosts $l) - { - if ($this->collCcShowHostss === null) { - $this->initCcShowHostss(); - } - if (!$this->collCcShowHostss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowHostss[]= $l; - $l->setCcShow($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowHostss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects - */ - public function getCcShowHostssJoinCcSubjs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowHostsQuery::create(null, $criteria); - $query->joinWith('CcSubjs', $join_behavior); - - return $this->getCcShowHostss($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->url = null; - $this->genre = null; - $this->description = null; - $this->color = null; - $this->background_color = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancess) { - foreach ((array) $this->collCcShowInstancess as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowDayss) { - foreach ((array) $this->collCcShowDayss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowRebroadcasts) { - foreach ((array) $this->collCcShowRebroadcasts as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowHostss) { - foreach ((array) $this->collCcShowHostss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancess = null; - $this->collCcShowDayss = null; - $this->collCcShowRebroadcasts = null; - $this->collCcShowHostss = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShow diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDays.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDays.php deleted file mode 100644 index be9f66086..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDays.php +++ /dev/null @@ -1,1476 +0,0 @@ -record = 0; - } - - /** - * Initializes internal state of BaseCcShowDays object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [optionally formatted] temporal [first_show] 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 getDbFirstShow($format = '%x') - { - if ($this->first_show === null) { - return null; - } - - - - try { - $dt = new DateTime($this->first_show); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->first_show, 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 [optionally formatted] temporal [last_show] 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 getDbLastShow($format = '%x') - { - if ($this->last_show === null) { - return null; - } - - - - try { - $dt = new DateTime($this->last_show); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->last_show, 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 [optionally formatted] temporal [start_time] 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 getDbStartTime($format = '%X') - { - if ($this->start_time === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start_time); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_time, 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 [timezone] column value. - * - * @return string - */ - public function getDbTimezone() - { - return $this->timezone; - } - - /** - * Get the [duration] column value. - * - * @return string - */ - public function getDbDuration() - { - return $this->duration; - } - - /** - * Get the [day] column value. - * - * @return int - */ - public function getDbDay() - { - 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Get the [record] column value. - * - * @return int - */ - public function getDbRecord() - { - return $this->record; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowDaysPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Sets the value of [first_show] 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 setDbFirstShow($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->first_show !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->first_show !== null && $tmpDt = new DateTime($this->first_show)) ? $tmpDt->format('Y-m-d') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->first_show = ($dt ? $dt->format('Y-m-d') : null); - $this->modifiedColumns[] = CcShowDaysPeer::FIRST_SHOW; - } - } // if either are not null - - return $this; - } // setDbFirstShow() - - /** - * Sets the value of [last_show] 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 setDbLastShow($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->last_show !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->last_show !== null && $tmpDt = new DateTime($this->last_show)) ? $tmpDt->format('Y-m-d') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->last_show = ($dt ? $dt->format('Y-m-d') : null); - $this->modifiedColumns[] = CcShowDaysPeer::LAST_SHOW; - } - } // if either are not null - - return $this; - } // setDbLastShow() - - /** - * Sets the value of [start_time] 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 setDbStartTime($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->start_time !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start_time !== null && $tmpDt = new DateTime($this->start_time)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start_time = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowDaysPeer::START_TIME; - } - } // if either are not null - - return $this; - } // setDbStartTime() - - /** - * Set the value of [timezone] column. - * - * @param string $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbTimezone($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->timezone !== $v) { - $this->timezone = $v; - $this->modifiedColumns[] = CcShowDaysPeer::TIMEZONE; - } - - return $this; - } // setDbTimezone() - - /** - * Set the value of [duration] column. - * - * @param string $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbDuration($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->duration !== $v) { - $this->duration = $v; - $this->modifiedColumns[] = CcShowDaysPeer::DURATION; - } - - return $this; - } // setDbDuration() - - /** - * Set the value of [day] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbDay($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->day !== $v) { - $this->day = $v; - $this->modifiedColumns[] = CcShowDaysPeer::DAY; - } - - return $this; - } // 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. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowDaysPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Set the value of [record] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbRecord($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->record !== $v || $this->isNew()) { - $this->record = $v; - $this->modifiedColumns[] = CcShowDaysPeer::RECORD; - } - - return $this; - } // setDbRecord() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->record !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : 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->start_time = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->timezone = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->duration = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->day = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->repeat_type = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->next_pop_date = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->show_id = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null; - $this->record = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 11; // 11 = CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowDays object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowDaysPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowDaysQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowDaysPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowDaysPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowDaysPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowDaysPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowDaysPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - - if (($retval = CcShowDaysPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowDaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbFirstShow(); - break; - case 2: - return $this->getDbLastShow(); - break; - case 3: - return $this->getDbStartTime(); - break; - case 4: - return $this->getDbTimezone(); - break; - case 5: - return $this->getDbDuration(); - break; - case 6: - return $this->getDbDay(); - break; - case 7: - return $this->getDbRepeatType(); - break; - case 8: - return $this->getDbNextPopDate(); - break; - case 9: - return $this->getDbShowId(); - break; - case 10: - return $this->getDbRecord(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowDaysPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbFirstShow(), - $keys[2] => $this->getDbLastShow(), - $keys[3] => $this->getDbStartTime(), - $keys[4] => $this->getDbTimezone(), - $keys[5] => $this->getDbDuration(), - $keys[6] => $this->getDbDay(), - $keys[7] => $this->getDbRepeatType(), - $keys[8] => $this->getDbNextPopDate(), - $keys[9] => $this->getDbShowId(), - $keys[10] => $this->getDbRecord(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowDaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbFirstShow($value); - break; - case 2: - $this->setDbLastShow($value); - break; - case 3: - $this->setDbStartTime($value); - break; - case 4: - $this->setDbTimezone($value); - break; - case 5: - $this->setDbDuration($value); - break; - case 6: - $this->setDbDay($value); - break; - case 7: - $this->setDbRepeatType($value); - break; - case 8: - $this->setDbNextPopDate($value); - break; - case 9: - $this->setDbShowId($value); - break; - case 10: - $this->setDbRecord($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowDaysPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - 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[3], $arr)) $this->setDbStartTime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbTimezone($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbDuration($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbDay($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbRepeatType($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbNextPopDate($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbShowId($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbRecord($arr[$keys[10]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowDaysPeer::ID)) $criteria->add(CcShowDaysPeer::ID, $this->id); - 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::START_TIME)) $criteria->add(CcShowDaysPeer::START_TIME, $this->start_time); - if ($this->isColumnModified(CcShowDaysPeer::TIMEZONE)) $criteria->add(CcShowDaysPeer::TIMEZONE, $this->timezone); - 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::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::RECORD)) $criteria->add(CcShowDaysPeer::RECORD, $this->record); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowDays (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbFirstShow($this->first_show); - $copyObj->setDbLastShow($this->last_show); - $copyObj->setDbStartTime($this->start_time); - $copyObj->setDbTimezone($this->timezone); - $copyObj->setDbDuration($this->duration); - $copyObj->setDbDay($this->day); - $copyObj->setDbRepeatType($this->repeat_type); - $copyObj->setDbNextPopDate($this->next_pop_date); - $copyObj->setDbShowId($this->show_id); - $copyObj->setDbRecord($this->record); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowDays Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowDaysPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowDaysPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowDays The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowDays($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowDayss($this); - */ - } - return $this->aCcShow; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->first_show = null; - $this->last_show = null; - $this->start_time = null; - $this->timezone = null; - $this->duration = null; - $this->day = null; - $this->repeat_type = null; - $this->next_pop_date = null; - $this->show_id = null; - $this->record = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowDays diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysPeer.php deleted file mode 100644 index df6b9081d..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysPeer.php +++ /dev/null @@ -1,1018 +0,0 @@ - array ('DbId', 'DbFirstShow', 'DbLastShow', 'DbStartTime', 'DbTimezone', 'DbDuration', 'DbDay', 'DbRepeatType', 'DbNextPopDate', 'DbShowId', 'DbRecord', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbFirstShow', 'dbLastShow', 'dbStartTime', 'dbTimezone', 'dbDuration', 'dbDay', 'dbRepeatType', 'dbNextPopDate', 'dbShowId', 'dbRecord', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::FIRST_SHOW, self::LAST_SHOW, self::START_TIME, self::TIMEZONE, self::DURATION, self::DAY, self::REPEAT_TYPE, self::NEXT_POP_DATE, self::SHOW_ID, self::RECORD, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'FIRST_SHOW', 'LAST_SHOW', 'START_TIME', 'TIMEZONE', 'DURATION', 'DAY', 'REPEAT_TYPE', 'NEXT_POP_DATE', 'SHOW_ID', 'RECORD', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'first_show', 'last_show', 'start_time', 'timezone', 'duration', 'day', 'repeat_type', 'next_pop_date', 'show_id', 'record', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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, 'DbFirstShow' => 1, 'DbLastShow' => 2, 'DbStartTime' => 3, 'DbTimezone' => 4, 'DbDuration' => 5, 'DbDay' => 6, 'DbRepeatType' => 7, 'DbNextPopDate' => 8, 'DbShowId' => 9, 'DbRecord' => 10, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbFirstShow' => 1, 'dbLastShow' => 2, 'dbStartTime' => 3, 'dbTimezone' => 4, 'dbDuration' => 5, 'dbDay' => 6, 'dbRepeatType' => 7, 'dbNextPopDate' => 8, 'dbShowId' => 9, 'dbRecord' => 10, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FIRST_SHOW => 1, self::LAST_SHOW => 2, self::START_TIME => 3, self::TIMEZONE => 4, self::DURATION => 5, self::DAY => 6, self::REPEAT_TYPE => 7, self::NEXT_POP_DATE => 8, self::SHOW_ID => 9, self::RECORD => 10, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'FIRST_SHOW' => 1, 'LAST_SHOW' => 2, 'START_TIME' => 3, 'TIMEZONE' => 4, 'DURATION' => 5, 'DAY' => 6, 'REPEAT_TYPE' => 7, 'NEXT_POP_DATE' => 8, 'SHOW_ID' => 9, 'RECORD' => 10, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'first_show' => 1, 'last_show' => 2, 'start_time' => 3, 'timezone' => 4, 'duration' => 5, 'day' => 6, 'repeat_type' => 7, 'next_pop_date' => 8, 'show_id' => 9, 'record' => 10, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowDaysPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowDaysPeer::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(CcShowDaysPeer::ID); - $criteria->addSelectColumn(CcShowDaysPeer::FIRST_SHOW); - $criteria->addSelectColumn(CcShowDaysPeer::LAST_SHOW); - $criteria->addSelectColumn(CcShowDaysPeer::START_TIME); - $criteria->addSelectColumn(CcShowDaysPeer::TIMEZONE); - $criteria->addSelectColumn(CcShowDaysPeer::DURATION); - $criteria->addSelectColumn(CcShowDaysPeer::DAY); - $criteria->addSelectColumn(CcShowDaysPeer::REPEAT_TYPE); - $criteria->addSelectColumn(CcShowDaysPeer::NEXT_POP_DATE); - $criteria->addSelectColumn(CcShowDaysPeer::SHOW_ID); - $criteria->addSelectColumn(CcShowDaysPeer::RECORD); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.FIRST_SHOW'); - $criteria->addSelectColumn($alias . '.LAST_SHOW'); - $criteria->addSelectColumn($alias . '.START_TIME'); - $criteria->addSelectColumn($alias . '.TIMEZONE'); - $criteria->addSelectColumn($alias . '.DURATION'); - $criteria->addSelectColumn($alias . '.DAY'); - $criteria->addSelectColumn($alias . '.REPEAT_TYPE'); - $criteria->addSelectColumn($alias . '.NEXT_POP_DATE'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.RECORD'); - } - } - - /** - * 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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::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 CcShowDays - * @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 = CcShowDaysPeer::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 CcShowDaysPeer::populateObjects(CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowDaysPeer::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 CcShowDays $value A CcShowDays object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowDays $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 CcShowDays object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowDays) { - $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 CcShowDays 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 CcShowDays 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_days - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowDaysPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowDaysPeer::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; - CcShowDaysPeer::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 (CcShowDays object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowDaysPeer::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 + CcShowDaysPeer::NUM_COLUMNS; - } else { - $cls = CcShowDaysPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowDaysPeer::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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowDaysPeer::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 CcShowDays 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 CcShowDays 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); - } - - CcShowDaysPeer::addSelectColumns($criteria); - $startcol = (CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowDaysPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowDaysPeer::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 = CcShowDaysPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowDaysPeer::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 (CcShowDays) to $obj2 (CcShow) - $obj2->addCcShowDays($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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowDaysPeer::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 CcShowDays 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 CcShowDays 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); - } - - CcShowDaysPeer::addSelectColumns($criteria); - $startcol2 = (CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowDaysPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowDaysPeer::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 = CcShowDaysPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowDaysPeer::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 (CcShowDays) to the collection in $obj2 (CcShow) - $obj2->addCcShowDays($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(BaseCcShowDaysPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowDaysPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowDaysTableMap()); - } - } - - /** - * 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 ? CcShowDaysPeer::CLASS_DEFAULT : CcShowDaysPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowDays or Criteria object. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowDays object - } - - if ($criteria->containsKey(CcShowDaysPeer::ID) && $criteria->keyContainsValue(CcShowDaysPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowDaysPeer::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 CcShowDays or Criteria object. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowDaysPeer::ID); - $value = $criteria->remove(CcShowDaysPeer::ID); - if ($value) { - $selectCriteria->add(CcShowDaysPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowDaysPeer::TABLE_NAME); - } - - } else { // $values is CcShowDays 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_days 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(CcShowDaysPeer::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(CcShowDaysPeer::TABLE_NAME, $con, CcShowDaysPeer::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). - CcShowDaysPeer::clearInstancePool(); - CcShowDaysPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowDays or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::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. - CcShowDaysPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowDays) { // it's a model object - // invalidate the cache for this single object - CcShowDaysPeer::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(CcShowDaysPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowDaysPeer::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); - CcShowDaysPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowDays 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 CcShowDays $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(CcShowDays $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowDaysPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, CcShowDaysPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowDays - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowDaysPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $pk); - - $v = CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $pks, Criteria::IN); - $objs = CcShowDaysPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowDaysPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowDaysPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysQuery.php deleted file mode 100644 index 18653bd70..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowDaysQuery.php +++ /dev/null @@ -1,565 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowDays|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowDaysPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery 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(CcShowDaysPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the first_show column - * - * @param string|array $dbFirstShow 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 filterByDbFirstShow($dbFirstShow = null, $comparison = null) - { - if (is_array($dbFirstShow)) { - $useMinMax = false; - if (isset($dbFirstShow['min'])) { - $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFirstShow['max'])) { - $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow, $comparison); - } - - /** - * Filter the query on the last_show column - * - * @param string|array $dbLastShow 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 filterByDbLastShow($dbLastShow = null, $comparison = null) - { - if (is_array($dbLastShow)) { - $useMinMax = false; - if (isset($dbLastShow['min'])) { - $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastShow['max'])) { - $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow, $comparison); - } - - /** - * Filter the query on the start_time column - * - * @param string|array $dbStartTime 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 filterByDbStartTime($dbStartTime = null, $comparison = null) - { - if (is_array($dbStartTime)) { - $useMinMax = false; - if (isset($dbStartTime['min'])) { - $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStartTime['max'])) { - $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime, $comparison); - } - - /** - * Filter the query on the timezone column - * - * @param string $dbTimezone The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function filterByDbTimezone($dbTimezone = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbTimezone)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbTimezone)) { - $dbTimezone = str_replace('*', '%', $dbTimezone); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowDaysPeer::TIMEZONE, $dbTimezone, $comparison); - } - - /** - * Filter the query on the duration column - * - * @param string $dbDuration The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function filterByDbDuration($dbDuration = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDuration)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDuration)) { - $dbDuration = str_replace('*', '%', $dbDuration); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration, $comparison); - } - - /** - * Filter the query on the day column - * - * @param int|array $dbDay 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 filterByDbDay($dbDay = null, $comparison = null) - { - if (is_array($dbDay)) { - $useMinMax = false; - if (isset($dbDay['min'])) { - $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbDay['max'])) { - $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - 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 - * - * @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 CcShowDaysQuery 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(CcShowDaysPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShowId['max'])) { - $this->addUsingAlias(CcShowDaysPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::SHOW_ID, $dbShowId, $comparison); - } - - /** - * Filter the query on the record column - * - * @param int|array $dbRecord 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 filterByDbRecord($dbRecord = null, $comparison = null) - { - if (is_array($dbRecord)) { - $useMinMax = false; - if (isset($dbRecord['min'])) { - $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecord['max'])) { - $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord, $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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery 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'); - } - - /** - * Exclude object from result - * - * @param CcShowDays $ccShowDays Object to remove from the list of results - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function prune($ccShowDays = null) - { - if ($ccShowDays) { - $this->addUsingAlias(CcShowDaysPeer::ID, $ccShowDays->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowDaysQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHosts.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHosts.php deleted file mode 100644 index ca4d11449..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHosts.php +++ /dev/null @@ -1,936 +0,0 @@ -id; - } - - /** - * Get the [show_id] column value. - * - * @return int - */ - public function getDbShow() - { - return $this->show_id; - } - - /** - * Get the [subjs_id] column value. - * - * @return int - */ - public function getDbHost() - { - return $this->subjs_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbShow($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShow() - - /** - * Set the value of [subjs_id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbHost($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subjs_id !== $v) { - $this->subjs_id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::SUBJS_ID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbHost() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->show_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->subjs_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowHosts object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - if ($this->aCcSubjs !== null && $this->subjs_id !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowHostsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowHostsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowHostsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowHostsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowHostsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowHostsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowHostsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - if ($this->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcShowHostsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowHostsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbShow(); - break; - case 2: - return $this->getDbHost(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowHostsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbShow(), - $keys[2] => $this->getDbHost(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowHostsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbShow($value); - break; - case 2: - $this->setDbHost($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowHostsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbShow($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbHost($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowHostsPeer::ID)) $criteria->add(CcShowHostsPeer::ID, $this->id); - if ($this->isColumnModified(CcShowHostsPeer::SHOW_ID)) $criteria->add(CcShowHostsPeer::SHOW_ID, $this->show_id); - if ($this->isColumnModified(CcShowHostsPeer::SUBJS_ID)) $criteria->add(CcShowHostsPeer::SUBJS_ID, $this->subjs_id); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowHosts (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbShow($this->show_id); - $copyObj->setDbHost($this->subjs_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowHosts Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowHostsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowHostsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowHosts The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShow(NULL); - } else { - $this->setDbShow($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowHosts($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowHostss($this); - */ - } - return $this->aCcShow; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcShowHosts The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbHost(NULL); - } else { - $this->setDbHost($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcShowHosts($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subjs_id !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subjs_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->aCcSubjs->addCcShowHostss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->show_id = null; - $this->subjs_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowHosts diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsPeer.php deleted file mode 100644 index 33a82f0d9..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsPeer.php +++ /dev/null @@ -1,1365 +0,0 @@ - array ('DbId', 'DbShow', 'DbHost', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShow', 'dbHost', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::SUBJS_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'SUBJS_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'subjs_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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, 'DbShow' => 1, 'DbHost' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShow' => 1, 'dbHost' => 2, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::SUBJS_ID => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'SUBJS_ID' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'subjs_id' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowHostsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowHostsPeer::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(CcShowHostsPeer::ID); - $criteria->addSelectColumn(CcShowHostsPeer::SHOW_ID); - $criteria->addSelectColumn(CcShowHostsPeer::SUBJS_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.SUBJS_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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::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 CcShowHosts - * @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 = CcShowHostsPeer::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 CcShowHostsPeer::populateObjects(CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowHostsPeer::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 CcShowHosts $value A CcShowHosts object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowHosts $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 CcShowHosts object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowHosts) { - $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 CcShowHosts 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 CcShowHosts 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_hosts - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowHostsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowHostsPeer::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; - CcShowHostsPeer::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 (CcShowHosts object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowHostsPeer::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 + CcShowHostsPeer::NUM_COLUMNS; - } else { - $cls = CcShowHostsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowHostsPeer::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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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 CcShowHosts 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 CcShowHosts 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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 (CcShowHosts) to $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowHosts objects pre-filled with their CcSubjs 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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowHosts) to $obj2 (CcSubjs) - $obj2->addCcShowHosts($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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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 CcShowHosts 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 CcShowHosts 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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 (CcShowHosts) to the collection in $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - } // if joined row not null - - // Add objects for joined CcSubjs rows - - $key3 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcSubjsPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcSubjsPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj3 (CcSubjs) - $obj3->addCcShowHosts($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShow(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinAllExceptCcSubjs(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::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 CcShowHosts objects pre-filled with all related objects except CcShow. - * - * @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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj2 (CcSubjs) - $obj2->addCcShowHosts($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowHosts objects pre-filled with all related objects except CcSubjs. - * - * @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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 already loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - - } // if joined row is 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(BaseCcShowHostsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowHostsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowHostsTableMap()); - } - } - - /** - * 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 ? CcShowHostsPeer::CLASS_DEFAULT : CcShowHostsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowHosts or Criteria object. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowHosts object - } - - if ($criteria->containsKey(CcShowHostsPeer::ID) && $criteria->keyContainsValue(CcShowHostsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowHostsPeer::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 CcShowHosts or Criteria object. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowHostsPeer::ID); - $value = $criteria->remove(CcShowHostsPeer::ID); - if ($value) { - $selectCriteria->add(CcShowHostsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowHostsPeer::TABLE_NAME); - } - - } else { // $values is CcShowHosts 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_hosts 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(CcShowHostsPeer::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(CcShowHostsPeer::TABLE_NAME, $con, CcShowHostsPeer::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). - CcShowHostsPeer::clearInstancePool(); - CcShowHostsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowHosts or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::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. - CcShowHostsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowHosts) { // it's a model object - // invalidate the cache for this single object - CcShowHostsPeer::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(CcShowHostsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowHostsPeer::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); - CcShowHostsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowHosts 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 CcShowHosts $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(CcShowHosts $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowHostsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, CcShowHostsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowHosts - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowHostsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $pk); - - $v = CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $pks, Criteria::IN); - $objs = CcShowHostsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowHostsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowHostsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsQuery.php deleted file mode 100644 index 2b910a52b..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowHostsQuery.php +++ /dev/null @@ -1,371 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowHosts|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowHostsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery 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(CcShowHostsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the show_id column - * - * @param int|array $dbShow 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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByDbShow($dbShow = null, $comparison = null) - { - if (is_array($dbShow)) { - $useMinMax = false; - if (isset($dbShow['min'])) { - $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShow['max'])) { - $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow, $comparison); - } - - /** - * Filter the query on the subjs_id column - * - * @param int|array $dbHost 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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByDbHost($dbHost = null, $comparison = null) - { - if (is_array($dbHost)) { - $useMinMax = false; - if (isset($dbHost['min'])) { - $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbHost['max'])) { - $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost, $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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery 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 CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcShowHosts $ccShowHosts Object to remove from the list of results - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function prune($ccShowHosts = null) - { - if ($ccShowHosts) { - $this->addUsingAlias(CcShowHostsPeer::ID, $ccShowHosts->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowHostsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstances.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstances.php deleted file mode 100644 index c78c34142..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstances.php +++ /dev/null @@ -1,1945 +0,0 @@ -record = 0; - $this->rebroadcast = 0; - $this->modified_instance = false; - } - - /** - * Initializes internal state of BaseCcShowInstances object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [optionally formatted] temporal [starts] 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 getDbStarts($format = 'Y-m-d H:i:s') - { - if ($this->starts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->starts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, 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 [optionally formatted] temporal [ends] 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 getDbEnds($format = 'Y-m-d H:i:s') - { - if ($this->ends === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ends); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Get the [record] column value. - * - * @return int - */ - public function getDbRecord() - { - return $this->record; - } - - /** - * Get the [rebroadcast] column value. - * - * @return int - */ - public function getDbRebroadcast() - { - return $this->rebroadcast; - } - - /** - * Get the [instance_id] column value. - * - * @return int - */ - public function getDbOriginalShow() - { - return $this->instance_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbRecordedFile() - { - return $this->file_id; - } - - /** - * Get the [optionally formatted] temporal [time_filled] 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 getDbTimeFilled($format = '%X') - { - if ($this->time_filled === null) { - return null; - } - - - - try { - $dt = new DateTime($this->time_filled); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->time_filled, 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 [modified_instance] column value. - * - * @return boolean - */ - public function getDbModifiedInstance() - { - return $this->modified_instance; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Sets the value of [starts] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbStarts($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->starts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->starts !== null && $tmpDt = new DateTime($this->starts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->starts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::STARTS; - } - } // if either are not null - - return $this; - } // setDbStarts() - - /** - * Sets the value of [ends] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbEnds($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->ends !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ends !== null && $tmpDt = new DateTime($this->ends)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ends = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::ENDS; - } - } // if either are not null - - return $this; - } // setDbEnds() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Set the value of [record] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRecord($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->record !== $v || $this->isNew()) { - $this->record = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::RECORD; - } - - return $this; - } // setDbRecord() - - /** - * Set the value of [rebroadcast] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRebroadcast($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->rebroadcast !== $v || $this->isNew()) { - $this->rebroadcast = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::REBROADCAST; - } - - return $this; - } // setDbRebroadcast() - - /** - * Set the value of [instance_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbOriginalShow($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->instance_id !== $v) { - $this->instance_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::INSTANCE_ID; - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null && $this->aCcShowInstancesRelatedByDbOriginalShow->getDbId() !== $v) { - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - } - - return $this; - } // setDbOriginalShow() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRecordedFile($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbRecordedFile() - - /** - * Sets the value of [time_filled] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbTimeFilled($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->time_filled !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->time_filled !== null && $tmpDt = new DateTime($this->time_filled)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->time_filled = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::TIME_FILLED; - } - } // if either are not null - - return $this; - } // setDbTimeFilled() - - /** - * Set the value of [modified_instance] column. - * - * @param boolean $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbModifiedInstance($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->modified_instance !== $v || $this->isNew()) { - $this->modified_instance = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::MODIFIED_INSTANCE; - } - - return $this; - } // setDbModifiedInstance() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->record !== 0) { - return false; - } - - if ($this->rebroadcast !== 0) { - return false; - } - - if ($this->modified_instance !== false) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->starts = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->ends = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->show_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->record = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->rebroadcast = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->modified_instance = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 10; // 10 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowInstances object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null && $this->instance_id !== $this->aCcShowInstancesRelatedByDbOriginalShow->getDbId()) { - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - } - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowInstancesPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - $this->aCcFiles = null; - $this->collCcShowInstancessRelatedByDbId = null; - - $this->collCcSchedules = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowInstancesQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowInstancesPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null) { - if ($this->aCcShowInstancesRelatedByDbOriginalShow->isModified() || $this->aCcShowInstancesRelatedByDbOriginalShow->isNew()) { - $affectedRows += $this->aCcShowInstancesRelatedByDbOriginalShow->save($con); - } - $this->setCcShowInstancesRelatedByDbOriginalShow($this->aCcShowInstancesRelatedByDbOriginalShow); - } - - if ($this->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowInstancesPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowInstancesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowInstancesPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowInstancesPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcShowInstancessRelatedByDbId !== null) { - foreach ($this->collCcShowInstancessRelatedByDbId as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null) { - if (!$this->aCcShowInstancesRelatedByDbOriginalShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShowInstancesRelatedByDbOriginalShow->getValidationFailures()); - } - } - - if ($this->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - - if (($retval = CcShowInstancesPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancessRelatedByDbId !== null) { - foreach ($this->collCcShowInstancessRelatedByDbId as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowInstancesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbStarts(); - break; - case 2: - return $this->getDbEnds(); - break; - case 3: - return $this->getDbShowId(); - break; - case 4: - return $this->getDbRecord(); - break; - case 5: - return $this->getDbRebroadcast(); - break; - case 6: - return $this->getDbOriginalShow(); - break; - case 7: - return $this->getDbRecordedFile(); - break; - case 8: - return $this->getDbTimeFilled(); - break; - case 9: - return $this->getDbModifiedInstance(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowInstancesPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbStarts(), - $keys[2] => $this->getDbEnds(), - $keys[3] => $this->getDbShowId(), - $keys[4] => $this->getDbRecord(), - $keys[5] => $this->getDbRebroadcast(), - $keys[6] => $this->getDbOriginalShow(), - $keys[7] => $this->getDbRecordedFile(), - $keys[8] => $this->getDbTimeFilled(), - $keys[9] => $this->getDbModifiedInstance(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcShowInstancesRelatedByDbOriginalShow) { - $result['CcShowInstancesRelatedByDbOriginalShow'] = $this->aCcShowInstancesRelatedByDbOriginalShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowInstancesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbStarts($value); - break; - case 2: - $this->setDbEnds($value); - break; - case 3: - $this->setDbShowId($value); - break; - case 4: - $this->setDbRecord($value); - break; - case 5: - $this->setDbRebroadcast($value); - break; - case 6: - $this->setDbOriginalShow($value); - break; - case 7: - $this->setDbRecordedFile($value); - break; - case 8: - $this->setDbTimeFilled($value); - break; - case 9: - $this->setDbModifiedInstance($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowInstancesPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbStarts($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbEnds($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbShowId($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbRecord($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbRebroadcast($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbModifiedInstance($arr[$keys[9]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowInstancesPeer::ID)) $criteria->add(CcShowInstancesPeer::ID, $this->id); - if ($this->isColumnModified(CcShowInstancesPeer::STARTS)) $criteria->add(CcShowInstancesPeer::STARTS, $this->starts); - if ($this->isColumnModified(CcShowInstancesPeer::ENDS)) $criteria->add(CcShowInstancesPeer::ENDS, $this->ends); - if ($this->isColumnModified(CcShowInstancesPeer::SHOW_ID)) $criteria->add(CcShowInstancesPeer::SHOW_ID, $this->show_id); - if ($this->isColumnModified(CcShowInstancesPeer::RECORD)) $criteria->add(CcShowInstancesPeer::RECORD, $this->record); - if ($this->isColumnModified(CcShowInstancesPeer::REBROADCAST)) $criteria->add(CcShowInstancesPeer::REBROADCAST, $this->rebroadcast); - if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id); - if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled); - if ($this->isColumnModified(CcShowInstancesPeer::MODIFIED_INSTANCE)) $criteria->add(CcShowInstancesPeer::MODIFIED_INSTANCE, $this->modified_instance); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME); - $criteria->add(CcShowInstancesPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowInstances (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbStarts($this->starts); - $copyObj->setDbEnds($this->ends); - $copyObj->setDbShowId($this->show_id); - $copyObj->setDbRecord($this->record); - $copyObj->setDbRebroadcast($this->rebroadcast); - $copyObj->setDbOriginalShow($this->instance_id); - $copyObj->setDbRecordedFile($this->file_id); - $copyObj->setDbTimeFilled($this->time_filled); - $copyObj->setDbModifiedInstance($this->modified_instance); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcShowInstancessRelatedByDbId() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowInstancesRelatedByDbId($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSchedules() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSchedule($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowInstances Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowInstancesPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowInstancesPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowInstances($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowInstancess($this); - */ - } - return $this->aCcShow; - } - - /** - * Declares an association between this object and a CcShowInstances object. - * - * @param CcShowInstances $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShowInstancesRelatedByDbOriginalShow(CcShowInstances $v = null) - { - if ($v === null) { - $this->setDbOriginalShow(NULL); - } else { - $this->setDbOriginalShow($v->getDbId()); - } - - $this->aCcShowInstancesRelatedByDbOriginalShow = $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->addCcShowInstancesRelatedByDbId($this); - } - - return $this; - } - - - /** - * Get the associated CcShowInstances object - * - * @param PropelPDO Optional Connection object. - * @return CcShowInstances The associated CcShowInstances object. - * @throws PropelException - */ - public function getCcShowInstancesRelatedByDbOriginalShow(PropelPDO $con = null) - { - if ($this->aCcShowInstancesRelatedByDbOriginalShow === null && ($this->instance_id !== null)) { - $this->aCcShowInstancesRelatedByDbOriginalShow = 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->aCcShowInstancesRelatedByDbOriginalShow->addCcShowInstancessRelatedByDbId($this); - */ - } - return $this->aCcShowInstancesRelatedByDbOriginalShow; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbRecordedFile(NULL); - } else { - $this->setDbRecordedFile($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcShowInstances($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcShowInstancess($this); - */ - } - return $this->aCcFiles; - } - - /** - * Clears out the collCcShowInstancessRelatedByDbId 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 addCcShowInstancessRelatedByDbId() - */ - public function clearCcShowInstancessRelatedByDbId() - { - $this->collCcShowInstancessRelatedByDbId = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowInstancessRelatedByDbId collection. - * - * By default this just sets the collCcShowInstancessRelatedByDbId collection to an empty array (like clearcollCcShowInstancessRelatedByDbId()); - * 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 initCcShowInstancessRelatedByDbId() - { - $this->collCcShowInstancessRelatedByDbId = new PropelObjectCollection(); - $this->collCcShowInstancessRelatedByDbId->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 CcShowInstances 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 getCcShowInstancessRelatedByDbId($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowInstancessRelatedByDbId || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowInstancessRelatedByDbId) { - // return empty collection - $this->initCcShowInstancessRelatedByDbId(); - } else { - $collCcShowInstancessRelatedByDbId = CcShowInstancesQuery::create(null, $criteria) - ->filterByCcShowInstancesRelatedByDbOriginalShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowInstancessRelatedByDbId; - } - $this->collCcShowInstancessRelatedByDbId = $collCcShowInstancessRelatedByDbId; - } - } - return $this->collCcShowInstancessRelatedByDbId; - } - - /** - * 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 countCcShowInstancessRelatedByDbId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowInstancessRelatedByDbId || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowInstancessRelatedByDbId) { - return 0; - } else { - $query = CcShowInstancesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShowInstancesRelatedByDbOriginalShow($this) - ->count($con); - } - } else { - return count($this->collCcShowInstancessRelatedByDbId); - } - } - - /** - * 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 addCcShowInstancesRelatedByDbId(CcShowInstances $l) - { - if ($this->collCcShowInstancessRelatedByDbId === null) { - $this->initCcShowInstancessRelatedByDbId(); - } - if (!$this->collCcShowInstancessRelatedByDbId->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowInstancessRelatedByDbId[]= $l; - $l->setCcShowInstancesRelatedByDbOriginalShow($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowInstancessRelatedByDbId from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessRelatedByDbIdJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowInstancessRelatedByDbId($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowInstancessRelatedByDbId from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessRelatedByDbIdJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowInstancessRelatedByDbId($query, $con); - } - - /** - * Clears out the collCcSchedules 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 addCcSchedules() - */ - public function clearCcSchedules() - { - $this->collCcSchedules = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSchedules collection. - * - * By default this just sets the collCcSchedules collection to an empty array (like clearcollCcSchedules()); - * 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 initCcSchedules() - { - $this->collCcSchedules = new PropelObjectCollection(); - $this->collCcSchedules->setModel('CcSchedule'); - } - - /** - * Gets an array of CcSchedule 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 CcShowInstances 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 CcSchedule[] List of CcSchedule objects - * @throws PropelException - */ - public function getCcSchedules($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - // return empty collection - $this->initCcSchedules(); - } else { - $collCcSchedules = CcScheduleQuery::create(null, $criteria) - ->filterByCcShowInstances($this) - ->find($con); - if (null !== $criteria) { - return $collCcSchedules; - } - $this->collCcSchedules = $collCcSchedules; - } - } - return $this->collCcSchedules; - } - - /** - * Returns the number of related CcSchedule objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSchedule objects. - * @throws PropelException - */ - public function countCcSchedules(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - return 0; - } else { - $query = CcScheduleQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShowInstances($this) - ->count($con); - } - } else { - return count($this->collCcSchedules); - } - } - - /** - * Method called to associate a CcSchedule object to this object - * through the CcSchedule foreign key attribute. - * - * @param CcSchedule $l CcSchedule - * @return void - * @throws PropelException - */ - public function addCcSchedule(CcSchedule $l) - { - if ($this->collCcSchedules === null) { - $this->initCcSchedules(); - } - if (!$this->collCcSchedules->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSchedules[]= $l; - $l->setCcShowInstances($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcSchedules from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcSchedule[] List of CcSchedule objects - */ - public function getCcSchedulesJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcScheduleQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcSchedules($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->starts = null; - $this->ends = null; - $this->show_id = null; - $this->record = null; - $this->rebroadcast = null; - $this->instance_id = null; - $this->file_id = null; - $this->time_filled = null; - $this->modified_instance = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancessRelatedByDbId) { - foreach ((array) $this->collCcShowInstancessRelatedByDbId as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSchedules) { - foreach ((array) $this->collCcSchedules as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancessRelatedByDbId = null; - $this->collCcSchedules = null; - $this->aCcShow = null; - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - $this->aCcFiles = null; - } - - // aggregate_column behavior - - /** - * Computes the value of the aggregate column time_filled - * - * @param PropelPDO $con A connection object - * - * @return mixed The scalar result from the aggregate query - */ - public function computeDbTimeFilled(PropelPDO $con) - { - $stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1'); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - /** - * Updates the aggregate column time_filled - * - * @param PropelPDO $con A connection object - */ - public function updateDbTimeFilled(PropelPDO $con) - { - $this->setDbTimeFilled($this->computeDbTimeFilled($con)); - $this->save($con); - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowInstances diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesPeer.php deleted file mode 100644 index d30a1a8ab..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesPeer.php +++ /dev/null @@ -1,1555 +0,0 @@ - array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', 'DbModifiedInstance', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', 'dbModifiedInstance', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, self::MODIFIED_INSTANCE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', 'MODIFIED_INSTANCE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', 'modified_instance', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) - ); - - /** - * 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, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, 'DbModifiedInstance' => 9, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, 'dbModifiedInstance' => 9, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, self::MODIFIED_INSTANCE => 9, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, 'MODIFIED_INSTANCE' => 9, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, 'modified_instance' => 9, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @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); - $criteria->addSelectColumn(CcShowInstancesPeer::RECORD); - $criteria->addSelectColumn(CcShowInstancesPeer::REBROADCAST); - $criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID); - $criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID); - $criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED); - $criteria->addSelectColumn(CcShowInstancesPeer::MODIFIED_INSTANCE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.STARTS'); - $criteria->addSelectColumn($alias . '.ENDS'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.RECORD'); - $criteria->addSelectColumn($alias . '.REBROADCAST'); - $criteria->addSelectColumn($alias . '.INSTANCE_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.TIME_FILLED'); - $criteria->addSelectColumn($alias . '.MODIFIED_INSTANCE'); - } - } - - /** - * 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 CcShowInstancesPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowInstancesPeer::clearInstancePool(); - // 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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with their CcFiles 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 doSelectJoinCcFiles(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); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowInstances) to $obj2 (CcFiles) - $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); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj3 (CcFiles) - $obj3->addCcShowInstances($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShow(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 should not affect 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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcShowInstancesRelatedByDbOriginalShow 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 doCountJoinAllExceptCcShowInstancesRelatedByDbOriginalShow(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 should not affect 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); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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 should not affect 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 except CcShow. - * - * @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 doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol2 = (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcFiles) - $obj2->addCcShowInstances($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with all related objects except CcShowInstancesRelatedByDbOriginalShow. - * - * @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 doSelectJoinAllExceptCcShowInstancesRelatedByDbOriginalShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcShow) - $obj2->addCcShowInstances($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj3 (CcFiles) - $obj3->addCcShowInstances($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with all related objects except CcFiles. - * - * @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 doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcShow) - $obj2->addCcShowInstances($obj1); - - } // if joined row is 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(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesQuery.php deleted file mode 100644 index d127d88ad..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowInstancesQuery.php +++ /dev/null @@ -1,806 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 on the record column - * - * @param int|array $dbRecord 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 filterByDbRecord($dbRecord = null, $comparison = null) - { - if (is_array($dbRecord)) { - $useMinMax = false; - if (isset($dbRecord['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecord['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord, $comparison); - } - - /** - * Filter the query on the rebroadcast column - * - * @param int|array $dbRebroadcast 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 filterByDbRebroadcast($dbRebroadcast = null, $comparison = null) - { - if (is_array($dbRebroadcast)) { - $useMinMax = false; - if (isset($dbRebroadcast['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRebroadcast['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast, $comparison); - } - - /** - * Filter the query on the instance_id column - * - * @param int|array $dbOriginalShow 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 filterByDbOriginalShow($dbOriginalShow = null, $comparison = null) - { - if (is_array($dbOriginalShow)) { - $useMinMax = false; - if (isset($dbOriginalShow['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbOriginalShow['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbRecordedFile 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 filterByDbRecordedFile($dbRecordedFile = null, $comparison = null) - { - if (is_array($dbRecordedFile)) { - $useMinMax = false; - if (isset($dbRecordedFile['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecordedFile['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile, $comparison); - } - - /** - * Filter the query on the time_filled column - * - * @param string|array $dbTimeFilled 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 filterByDbTimeFilled($dbTimeFilled = null, $comparison = null) - { - if (is_array($dbTimeFilled)) { - $useMinMax = false; - if (isset($dbTimeFilled['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbTimeFilled['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled, $comparison); - } - - /** - * Filter the query on the modified_instance column - * - * @param boolean|string $dbModifiedInstance The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByDbModifiedInstance($dbModifiedInstance = null, $comparison = null) - { - if (is_string($dbModifiedInstance)) { - $modified_instance = in_array(strtolower($dbModifiedInstance), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - return $this->addUsingAlias(CcShowInstancesPeer::MODIFIED_INSTANCE, $dbModifiedInstance, $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 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 CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByCcShowInstancesRelatedByDbOriginalShow($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $ccShowInstances->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowInstancesRelatedByDbOriginalShow 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 joinCcShowInstancesRelatedByDbOriginalShow($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowInstancesRelatedByDbOriginalShow'); - - // 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, 'CcShowInstancesRelatedByDbOriginalShow'); - } - - return $this; - } - - /** - * Use the CcShowInstancesRelatedByDbOriginalShow 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 useCcShowInstancesRelatedByDbOriginalShowQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcShowInstancesRelatedByDbOriginalShow($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstancesRelatedByDbOriginalShow', 'CcShowInstancesQuery'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles 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 filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles 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 joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * 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 CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByCcShowInstancesRelatedByDbId($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::ID, $ccShowInstances->getDbOriginalShow(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowInstancesRelatedByDbId 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 joinCcShowInstancesRelatedByDbId($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowInstancesRelatedByDbId'); - - // 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, 'CcShowInstancesRelatedByDbId'); - } - - return $this; - } - - /** - * Use the CcShowInstancesRelatedByDbId 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 useCcShowInstancesRelatedByDbIdQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcShowInstancesRelatedByDbId($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstancesRelatedByDbId', 'CcShowInstancesQuery'); - } - - /** - * 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 diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowPeer.php deleted file mode 100644 index 110c08101..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowPeer.php +++ /dev/null @@ -1,776 +0,0 @@ - array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::GENRE, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) - ); - - /** - * 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, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::GENRE => 3, self::DESCRIPTION => 4, self::COLOR => 5, self::BACKGROUND_COLOR => 6, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowPeer::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(CcShowPeer::ID); - $criteria->addSelectColumn(CcShowPeer::NAME); - $criteria->addSelectColumn(CcShowPeer::URL); - $criteria->addSelectColumn(CcShowPeer::GENRE); - $criteria->addSelectColumn(CcShowPeer::DESCRIPTION); - $criteria->addSelectColumn(CcShowPeer::COLOR); - $criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.GENRE'); - $criteria->addSelectColumn($alias . '.DESCRIPTION'); - $criteria->addSelectColumn($alias . '.COLOR'); - $criteria->addSelectColumn($alias . '.BACKGROUND_COLOR'); - } - } - - /** - * 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(CcShowPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowPeer::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(CcShowPeer::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 CcShow - * @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 = CcShowPeer::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 CcShowPeer::populateObjects(CcShowPeer::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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowPeer::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 CcShow $value A CcShow object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShow $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 CcShow object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShow) { - $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 CcShow 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 CcShow 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 - * by a foreign key with ON DELETE CASCADE - */ - 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, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowDaysPeer::clearInstancePool(); - // Invalidate objects in CcShowRebroadcastPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowRebroadcastPeer::clearInstancePool(); - // Invalidate objects in CcShowHostsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowHostsPeer::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 = CcShowPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowPeer::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; - CcShowPeer::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 (CcShow object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowPeer::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 + CcShowPeer::NUM_COLUMNS; - } else { - $cls = CcShowPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcShowPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowTableMap()); - } - } - - /** - * 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 ? CcShowPeer::CLASS_DEFAULT : CcShowPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShow or Criteria object. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShow object - } - - if ($criteria->containsKey(CcShowPeer::ID) && $criteria->keyContainsValue(CcShowPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowPeer::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 CcShow or Criteria object. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowPeer::ID); - $value = $criteria->remove(CcShowPeer::ID); - if ($value) { - $selectCriteria->add(CcShowPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); - } - - } else { // $values is CcShow 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 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(CcShowPeer::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(CcShowPeer::TABLE_NAME, $con, CcShowPeer::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). - CcShowPeer::clearInstancePool(); - CcShowPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShow or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::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. - CcShowPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShow) { // it's a model object - // invalidate the cache for this single object - CcShowPeer::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(CcShowPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowPeer::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); - CcShowPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShow 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 CcShow $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(CcShow $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowPeer::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(CcShowPeer::DATABASE_NAME, CcShowPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShow - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $pk); - - $v = CcShowPeer::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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $pks, Criteria::IN); - $objs = CcShowPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowQuery.php deleted file mode 100644 index 10f9dac11..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowQuery.php +++ /dev/null @@ -1,593 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShow|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowPeer::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 CcShowQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowPeer::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 CcShowQuery 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(CcShowPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $dbUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbUrl($dbUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbUrl)) { - $dbUrl = str_replace('*', '%', $dbUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::URL, $dbUrl, $comparison); - } - - /** - * Filter the query on the genre column - * - * @param string $dbGenre The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbGenre($dbGenre = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGenre)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGenre)) { - $dbGenre = str_replace('*', '%', $dbGenre); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::GENRE, $dbGenre, $comparison); - } - - /** - * Filter the query on the description column - * - * @param string $dbDescription The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbDescription($dbDescription = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDescription)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDescription)) { - $dbDescription = str_replace('*', '%', $dbDescription); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::DESCRIPTION, $dbDescription, $comparison); - } - - /** - * Filter the query on the color column - * - * @param string $dbColor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbColor($dbColor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbColor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbColor)) { - $dbColor = str_replace('*', '%', $dbColor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::COLOR, $dbColor, $comparison); - } - - /** - * Filter the query on the background_color column - * - * @param string $dbBackgroundColor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbBackgroundColor($dbBackgroundColor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBackgroundColor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBackgroundColor)) { - $dbBackgroundColor = str_replace('*', '%', $dbBackgroundColor); - $comparison = Criteria::LIKE; - } - } - 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 - * - * @param CcShowDays $ccShowDays 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 filterByCcShowDays($ccShowDays, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowDays->getDbShowId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowDays 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 joinCcShowDays($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowDays'); - - // 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, 'CcShowDays'); - } - - return $this; - } - - /** - * Use the CcShowDays relation CcShowDays 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 CcShowDaysQuery A secondary query class using the current class as primary query - */ - public function useCcShowDaysQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowDays($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowDays', 'CcShowDaysQuery'); - } - - /** - * Filter the query by a related CcShowRebroadcast object - * - * @param CcShowRebroadcast $ccShowRebroadcast 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 filterByCcShowRebroadcast($ccShowRebroadcast, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowRebroadcast->getDbShowId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowRebroadcast 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 joinCcShowRebroadcast($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowRebroadcast'); - - // 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, 'CcShowRebroadcast'); - } - - return $this; - } - - /** - * Use the CcShowRebroadcast relation CcShowRebroadcast 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 CcShowRebroadcastQuery A secondary query class using the current class as primary query - */ - public function useCcShowRebroadcastQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowRebroadcast($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowRebroadcast', 'CcShowRebroadcastQuery'); - } - - /** - * Filter the query by a related CcShowHosts object - * - * @param CcShowHosts $ccShowHosts 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 filterByCcShowHosts($ccShowHosts, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowHosts->getDbShow(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowHosts 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 joinCcShowHosts($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowHosts'); - - // 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, 'CcShowHosts'); - } - - return $this; - } - - /** - * Use the CcShowHosts relation CcShowHosts 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 CcShowHostsQuery A secondary query class using the current class as primary query - */ - public function useCcShowHostsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowHosts($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery'); - } - - /** - * Exclude object from result - * - * @param CcShow $ccShow Object to remove from the list of results - * - * @return CcShowQuery The current query, for fluid interface - */ - public function prune($ccShow = null) - { - if ($ccShow) { - $this->addUsingAlias(CcShowPeer::ID, $ccShow->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcast.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcast.php deleted file mode 100644 index aabd37d79..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcast.php +++ /dev/null @@ -1,957 +0,0 @@ -id; - } - - /** - * Get the [day_offset] column value. - * - * @return string - */ - public function getDbDayOffset() - { - return $this->day_offset; - } - - /** - * Get the [optionally formatted] temporal [start_time] 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 getDbStartTime($format = '%X') - { - if ($this->start_time === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start_time); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_time, 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [day_offset] column. - * - * @param string $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbDayOffset($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->day_offset !== $v) { - $this->day_offset = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::DAY_OFFSET; - } - - return $this; - } // setDbDayOffset() - - /** - * Sets the value of [start_time] 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 CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbStartTime($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->start_time !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start_time !== null && $tmpDt = new DateTime($this->start_time)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start_time = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowRebroadcastPeer::START_TIME; - } - } // if either are not null - - return $this; - } // setDbStartTime() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->day_offset = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->start_time = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->show_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowRebroadcast object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowRebroadcastPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowRebroadcastQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowRebroadcastPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowRebroadcastPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowRebroadcastPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowRebroadcastPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowRebroadcastPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - - if (($retval = CcShowRebroadcastPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowRebroadcastPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbDayOffset(); - break; - case 2: - return $this->getDbStartTime(); - break; - case 3: - return $this->getDbShowId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowRebroadcastPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbDayOffset(), - $keys[2] => $this->getDbStartTime(), - $keys[3] => $this->getDbShowId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowRebroadcastPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbDayOffset($value); - break; - case 2: - $this->setDbStartTime($value); - break; - case 3: - $this->setDbShowId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowRebroadcastPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbDayOffset($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbStartTime($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbShowId($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowRebroadcastPeer::ID)) $criteria->add(CcShowRebroadcastPeer::ID, $this->id); - if ($this->isColumnModified(CcShowRebroadcastPeer::DAY_OFFSET)) $criteria->add(CcShowRebroadcastPeer::DAY_OFFSET, $this->day_offset); - if ($this->isColumnModified(CcShowRebroadcastPeer::START_TIME)) $criteria->add(CcShowRebroadcastPeer::START_TIME, $this->start_time); - if ($this->isColumnModified(CcShowRebroadcastPeer::SHOW_ID)) $criteria->add(CcShowRebroadcastPeer::SHOW_ID, $this->show_id); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowRebroadcast (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbDayOffset($this->day_offset); - $copyObj->setDbStartTime($this->start_time); - $copyObj->setDbShowId($this->show_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowRebroadcast Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowRebroadcastPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowRebroadcastPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowRebroadcast The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowRebroadcast($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowRebroadcasts($this); - */ - } - return $this->aCcShow; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->day_offset = null; - $this->start_time = null; - $this->show_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowRebroadcast diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastPeer.php deleted file mode 100644 index ef0434c70..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastPeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('DbId', 'DbDayOffset', 'DbStartTime', 'DbShowId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbDayOffset', 'dbStartTime', 'dbShowId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::DAY_OFFSET, self::START_TIME, self::SHOW_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DAY_OFFSET', 'START_TIME', 'SHOW_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'day_offset', 'start_time', '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, 'DbDayOffset' => 1, 'DbStartTime' => 2, 'DbShowId' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbDayOffset' => 1, 'dbStartTime' => 2, 'dbShowId' => 3, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DAY_OFFSET => 1, self::START_TIME => 2, self::SHOW_ID => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DAY_OFFSET' => 1, 'START_TIME' => 2, 'SHOW_ID' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'day_offset' => 1, 'start_time' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowRebroadcastPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::ID); - $criteria->addSelectColumn(CcShowRebroadcastPeer::DAY_OFFSET); - $criteria->addSelectColumn(CcShowRebroadcastPeer::START_TIME); - $criteria->addSelectColumn(CcShowRebroadcastPeer::SHOW_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.DAY_OFFSET'); - $criteria->addSelectColumn($alias . '.START_TIME'); - $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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::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 CcShowRebroadcast - * @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 = CcShowRebroadcastPeer::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 CcShowRebroadcastPeer::populateObjects(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowRebroadcastPeer::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 CcShowRebroadcast $value A CcShowRebroadcast object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowRebroadcast $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 CcShowRebroadcast object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowRebroadcast) { - $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 CcShowRebroadcast 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 CcShowRebroadcast 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_rebroadcast - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowRebroadcastPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowRebroadcastPeer::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; - CcShowRebroadcastPeer::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 (CcShowRebroadcast object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowRebroadcastPeer::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 + CcShowRebroadcastPeer::NUM_COLUMNS; - } else { - $cls = CcShowRebroadcastPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowRebroadcastPeer::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 CcShowRebroadcast 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 CcShowRebroadcast 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); - } - - CcShowRebroadcastPeer::addSelectColumns($criteria); - $startcol = (CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowRebroadcastPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowRebroadcastPeer::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 = CcShowRebroadcastPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowRebroadcastPeer::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 (CcShowRebroadcast) to $obj2 (CcShow) - $obj2->addCcShowRebroadcast($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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowRebroadcastPeer::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 CcShowRebroadcast 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 CcShowRebroadcast 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); - } - - CcShowRebroadcastPeer::addSelectColumns($criteria); - $startcol2 = (CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowRebroadcastPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowRebroadcastPeer::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 = CcShowRebroadcastPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowRebroadcastPeer::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 (CcShowRebroadcast) to the collection in $obj2 (CcShow) - $obj2->addCcShowRebroadcast($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(BaseCcShowRebroadcastPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowRebroadcastPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowRebroadcastTableMap()); - } - } - - /** - * 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 ? CcShowRebroadcastPeer::CLASS_DEFAULT : CcShowRebroadcastPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowRebroadcast or Criteria object. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowRebroadcast object - } - - if ($criteria->containsKey(CcShowRebroadcastPeer::ID) && $criteria->keyContainsValue(CcShowRebroadcastPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowRebroadcastPeer::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 CcShowRebroadcast or Criteria object. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowRebroadcastPeer::ID); - $value = $criteria->remove(CcShowRebroadcastPeer::ID); - if ($value) { - $selectCriteria->add(CcShowRebroadcastPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowRebroadcastPeer::TABLE_NAME); - } - - } else { // $values is CcShowRebroadcast 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_rebroadcast 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(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::TABLE_NAME, $con, CcShowRebroadcastPeer::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). - CcShowRebroadcastPeer::clearInstancePool(); - CcShowRebroadcastPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowRebroadcast or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::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. - CcShowRebroadcastPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowRebroadcast) { // it's a model object - // invalidate the cache for this single object - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowRebroadcastPeer::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); - CcShowRebroadcastPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowRebroadcast 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 CcShowRebroadcast $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(CcShowRebroadcast $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowRebroadcastPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, CcShowRebroadcastPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowRebroadcast - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowRebroadcastPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $pk); - - $v = CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $pks, Criteria::IN); - $objs = CcShowRebroadcastPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowRebroadcastPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowRebroadcastPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastQuery.php deleted file mode 100644 index d7fedf8e9..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowRebroadcastQuery.php +++ /dev/null @@ -1,329 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowRebroadcast|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowRebroadcastPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery 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(CcShowRebroadcastPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the day_offset column - * - * @param string $dbDayOffset The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByDbDayOffset($dbDayOffset = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDayOffset)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDayOffset)) { - $dbDayOffset = str_replace('*', '%', $dbDayOffset); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::DAY_OFFSET, $dbDayOffset, $comparison); - } - - /** - * Filter the query on the start_time column - * - * @param string|array $dbStartTime 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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByDbStartTime($dbStartTime = null, $comparison = null) - { - if (is_array($dbStartTime)) { - $useMinMax = false; - if (isset($dbStartTime['min'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStartTime['max'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime, $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 CcShowRebroadcastQuery 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(CcShowRebroadcastPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShowId['max'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery 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'); - } - - /** - * Exclude object from result - * - * @param CcShowRebroadcast $ccShowRebroadcast Object to remove from the list of results - * - * @return CcShowRebroadcastQuery The current query, for fluid interface - */ - public function prune($ccShowRebroadcast = null) - { - if ($ccShowRebroadcast) { - $this->addUsingAlias(CcShowRebroadcastPeer::ID, $ccShowRebroadcast->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowRebroadcastQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedule.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedule.php deleted file mode 100644 index bf8b384e6..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedule.php +++ /dev/null @@ -1,905 +0,0 @@ -id; - } - - /** - * Get the [instance_id] column value. - * - * @return int - */ - public function getDbInstanceId() - { - return $this->instance_id; - } - - /** - * Get the [position] column value. - * - * @return int - */ - public function getDbPosition() - { - return $this->position; - } - - /** - * Get the [group_id] column value. - * - * @return int - */ - public function getDbGroupId() - { - return $this->group_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [instance_id] column. - * - * @param int $v new value - * @return CcShowSchedule 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[] = CcShowSchedulePeer::INSTANCE_ID; - } - - if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) { - $this->aCcShowInstances = null; - } - - return $this; - } // setDbInstanceId() - - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::POSITION; - } - - return $this; - } // setDbPosition() - - /** - * Set the value of [group_id] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbGroupId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->group_id !== $v) { - $this->group_id = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::GROUP_ID; - } - - return $this; - } // setDbGroupId() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->instance_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->position = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->group_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowSchedule object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { - $this->aCcShowInstances = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowSchedulePeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShowInstances = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowScheduleQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowSchedulePeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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[] = CcShowSchedulePeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowSchedulePeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowSchedulePeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowSchedulePeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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 = CcShowSchedulePeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbInstanceId(); - break; - case 2: - return $this->getDbPosition(); - break; - case 3: - return $this->getDbGroupId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowSchedulePeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbInstanceId(), - $keys[2] => $this->getDbPosition(), - $keys[3] => $this->getDbGroupId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShowInstances) { - $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbInstanceId($value); - break; - case 2: - $this->setDbPosition($value); - break; - case 3: - $this->setDbGroupId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowSchedulePeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbInstanceId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbPosition($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbGroupId($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowSchedulePeer::ID)) $criteria->add(CcShowSchedulePeer::ID, $this->id); - if ($this->isColumnModified(CcShowSchedulePeer::INSTANCE_ID)) $criteria->add(CcShowSchedulePeer::INSTANCE_ID, $this->instance_id); - 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); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowSchedule (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbInstanceId($this->instance_id); - $copyObj->setDbPosition($this->position); - $copyObj->setDbGroupId($this->group_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowSchedule Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowSchedulePeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowSchedulePeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShowInstances object. - * - * @param CcShowInstances $v - * @return CcShowSchedule 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->addCcShowSchedule($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->addCcShowSchedules($this); - */ - } - return $this->aCcShowInstances; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->instance_id = null; - $this->position = null; - $this->group_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShowInstances = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowSchedule diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedulePeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedulePeer.php deleted file mode 100644 index 677ff8447..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowSchedulePeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('DbId', 'DbInstanceId', 'DbPosition', 'DbGroupId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbInstanceId', 'dbPosition', 'dbGroupId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::INSTANCE_ID, self::POSITION, self::GROUP_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'INSTANCE_ID', 'POSITION', 'GROUP_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'instance_id', 'position', 'group_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, 'DbInstanceId' => 1, 'DbPosition' => 2, 'DbGroupId' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbInstanceId' => 1, 'dbPosition' => 2, 'dbGroupId' => 3, ), - 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, 'INSTANCE_ID' => 1, 'POSITION' => 2, 'GROUP_ID' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'instance_id' => 1, 'position' => 2, 'group_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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowSchedulePeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowSchedulePeer::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(CcShowSchedulePeer::ID); - $criteria->addSelectColumn(CcShowSchedulePeer::INSTANCE_ID); - $criteria->addSelectColumn(CcShowSchedulePeer::POSITION); - $criteria->addSelectColumn(CcShowSchedulePeer::GROUP_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.INSTANCE_ID'); - $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.GROUP_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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::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 CcShowSchedule - * @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 = CcShowSchedulePeer::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 CcShowSchedulePeer::populateObjects(CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowSchedulePeer::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 CcShowSchedule $value A CcShowSchedule object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowSchedule $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 CcShowSchedule object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowSchedule) { - $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 CcShowSchedule 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 CcShowSchedule 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_schedule - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowSchedulePeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowSchedulePeer::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; - CcShowSchedulePeer::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 (CcShowSchedule object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowSchedulePeer::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 + CcShowSchedulePeer::NUM_COLUMNS; - } else { - $cls = CcShowSchedulePeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowSchedulePeer::addInstanceToPool($obj, $key); - } - 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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowSchedulePeer::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 CcShowSchedule 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 CcShowSchedule 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); - } - - CcShowSchedulePeer::addSelectColumns($criteria); - $startcol = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - CcShowInstancesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowSchedulePeer::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 = CcShowSchedulePeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowSchedulePeer::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 (CcShowSchedule) to $obj2 (CcShowInstances) - $obj2->addCcShowSchedule($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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowSchedulePeer::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 CcShowSchedule 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 CcShowSchedule 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); - } - - CcShowSchedulePeer::addSelectColumns($criteria); - $startcol2 = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowSchedulePeer::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 = CcShowSchedulePeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowSchedulePeer::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 (CcShowSchedule) to the collection in $obj2 (CcShowInstances) - $obj2->addCcShowSchedule($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(BaseCcShowSchedulePeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowSchedulePeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowScheduleTableMap()); - } - } - - /** - * 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 ? CcShowSchedulePeer::CLASS_DEFAULT : CcShowSchedulePeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowSchedule or Criteria object. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowSchedule object - } - - if ($criteria->containsKey(CcShowSchedulePeer::ID) && $criteria->keyContainsValue(CcShowSchedulePeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowSchedulePeer::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 CcShowSchedule or Criteria object. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowSchedulePeer::ID); - $value = $criteria->remove(CcShowSchedulePeer::ID); - if ($value) { - $selectCriteria->add(CcShowSchedulePeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowSchedulePeer::TABLE_NAME); - } - - } else { // $values is CcShowSchedule 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_schedule 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(CcShowSchedulePeer::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(CcShowSchedulePeer::TABLE_NAME, $con, CcShowSchedulePeer::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). - CcShowSchedulePeer::clearInstancePool(); - CcShowSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowSchedule or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::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. - CcShowSchedulePeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowSchedule) { // it's a model object - // invalidate the cache for this single object - CcShowSchedulePeer::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(CcShowSchedulePeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowSchedulePeer::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); - CcShowSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowSchedule 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 CcShowSchedule $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(CcShowSchedule $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowSchedulePeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, CcShowSchedulePeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowSchedule - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowSchedulePeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $pk); - - $v = CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $pks, Criteria::IN); - $objs = CcShowSchedulePeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowSchedulePeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowSchedulePeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowScheduleQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowScheduleQuery.php deleted file mode 100644 index 2cb1b65c8..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcShowScheduleQuery.php +++ /dev/null @@ -1,338 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowSchedule|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowSchedulePeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery 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(CcShowSchedulePeer::ID, $dbId, $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 CcShowScheduleQuery 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(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbInstanceId['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId, $comparison); - } - - /** - * Filter the query on the position column - * - * @param int|array $dbPosition The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByDbPosition($dbPosition = null, $comparison = null) - { - if (is_array($dbPosition)) { - $useMinMax = false; - if (isset($dbPosition['min'])) { - $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPosition['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition, $comparison); - } - - /** - * Filter the query on the group_id column - * - * @param int|array $dbGroupId 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 filterByDbGroupId($dbGroupId = null, $comparison = null) - { - if (is_array($dbGroupId)) { - $useMinMax = false; - if (isset($dbGroupId['min'])) { - $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbGroupId['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId, $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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByCcShowInstances($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery 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 - * - * @param CcShowSchedule $ccShowSchedule Object to remove from the list of results - * - * @return CcShowScheduleQuery The current query, for fluid interface - */ - public function prune($ccShowSchedule = null) - { - if ($ccShowSchedule) { - $this->addUsingAlias(CcShowSchedulePeer::ID, $ccShowSchedule->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowScheduleQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmemb.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmemb.php deleted file mode 100644 index 7fc4dbc9b..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmemb.php +++ /dev/null @@ -1,891 +0,0 @@ -uid = 0; - $this->gid = 0; - $this->level = 0; - } - - /** - * Initializes internal state of BaseCcSmemb object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [uid] column value. - * - * @return int - */ - public function getUid() - { - return $this->uid; - } - - /** - * Get the [gid] column value. - * - * @return int - */ - public function getGid() - { - return $this->gid; - } - - /** - * Get the [level] column value. - * - * @return int - */ - public function getLevel() - { - return $this->level; - } - - /** - * Get the [mid] column value. - * - * @return int - */ - public function getMid() - { - return $this->mid; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSmembPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [uid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setUid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->uid !== $v || $this->isNew()) { - $this->uid = $v; - $this->modifiedColumns[] = CcSmembPeer::UID; - } - - return $this; - } // setUid() - - /** - * Set the value of [gid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setGid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->gid !== $v || $this->isNew()) { - $this->gid = $v; - $this->modifiedColumns[] = CcSmembPeer::GID; - } - - return $this; - } // setGid() - - /** - * Set the value of [level] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setLevel($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->level !== $v || $this->isNew()) { - $this->level = $v; - $this->modifiedColumns[] = CcSmembPeer::LEVEL; - } - - return $this; - } // setLevel() - - /** - * Set the value of [mid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setMid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->mid !== $v) { - $this->mid = $v; - $this->modifiedColumns[] = CcSmembPeer::MID; - } - - return $this; - } // setMid() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->uid !== 0) { - return false; - } - - if ($this->gid !== 0) { - return false; - } - - if ($this->level !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->uid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->gid = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->level = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->mid = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcSmembPeer::NUM_COLUMNS - CcSmembPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSmemb object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSmembPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSmembQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSmembPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcSmembPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcSmembPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getUid(); - break; - case 2: - return $this->getGid(); - break; - case 3: - return $this->getLevel(); - break; - case 4: - return $this->getMid(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcSmembPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getUid(), - $keys[2] => $this->getGid(), - $keys[3] => $this->getLevel(), - $keys[4] => $this->getMid(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setUid($value); - break; - case 2: - $this->setGid($value); - break; - case 3: - $this->setLevel($value); - break; - case 4: - $this->setMid($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSmembPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setUid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setGid($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setLevel($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setMid($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSmembPeer::ID)) $criteria->add(CcSmembPeer::ID, $this->id); - if ($this->isColumnModified(CcSmembPeer::UID)) $criteria->add(CcSmembPeer::UID, $this->uid); - if ($this->isColumnModified(CcSmembPeer::GID)) $criteria->add(CcSmembPeer::GID, $this->gid); - if ($this->isColumnModified(CcSmembPeer::LEVEL)) $criteria->add(CcSmembPeer::LEVEL, $this->level); - if ($this->isColumnModified(CcSmembPeer::MID)) $criteria->add(CcSmembPeer::MID, $this->mid); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSmemb (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setId($this->id); - $copyObj->setUid($this->uid); - $copyObj->setGid($this->gid); - $copyObj->setLevel($this->level); - $copyObj->setMid($this->mid); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSmemb Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSmembPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSmembPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->uid = null; - $this->gid = null; - $this->level = null; - $this->mid = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSmemb diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembPeer.php deleted file mode 100644 index 849c13423..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembPeer.php +++ /dev/null @@ -1,750 +0,0 @@ - array ('Id', 'Uid', 'Gid', 'Level', 'Mid', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'uid', 'gid', 'level', 'mid', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::UID, self::GID, self::LEVEL, self::MID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'UID', 'GID', 'LEVEL', 'MID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'uid', 'gid', 'level', 'mid', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Id' => 0, 'Uid' => 1, 'Gid' => 2, 'Level' => 3, 'Mid' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 4, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::UID => 1, self::GID => 2, self::LEVEL => 3, self::MID => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'UID' => 1, 'GID' => 2, 'LEVEL' => 3, 'MID' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSmembPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSmembPeer::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(CcSmembPeer::ID); - $criteria->addSelectColumn(CcSmembPeer::UID); - $criteria->addSelectColumn(CcSmembPeer::GID); - $criteria->addSelectColumn(CcSmembPeer::LEVEL); - $criteria->addSelectColumn(CcSmembPeer::MID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.UID'); - $criteria->addSelectColumn($alias . '.GID'); - $criteria->addSelectColumn($alias . '.LEVEL'); - $criteria->addSelectColumn($alias . '.MID'); - } - } - - /** - * 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(CcSmembPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSmembPeer::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(CcSmembPeer::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 CcSmemb - * @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 = CcSmembPeer::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 CcSmembPeer::populateObjects(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSmembPeer::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 CcSmemb $value A CcSmemb object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSmemb $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcSmemb object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSmemb) { - $key = (string) $value->getId(); - } 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 CcSmemb 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 CcSmemb 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_smemb - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcSmembPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSmembPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSmembPeer::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; - CcSmembPeer::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 (CcSmemb object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSmembPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSmembPeer::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 + CcSmembPeer::NUM_COLUMNS; - } else { - $cls = CcSmembPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSmembPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcSmembPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSmembPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSmembTableMap()); - } - } - - /** - * 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 ? CcSmembPeer::CLASS_DEFAULT : CcSmembPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSmemb or Criteria object. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSmemb object - } - - - // 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 CcSmemb or Criteria object. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSmembPeer::ID); - $value = $criteria->remove(CcSmembPeer::ID); - if ($value) { - $selectCriteria->add(CcSmembPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSmembPeer::TABLE_NAME); - } - - } else { // $values is CcSmemb 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_smemb 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(CcSmembPeer::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(CcSmembPeer::TABLE_NAME, $con, CcSmembPeer::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). - CcSmembPeer::clearInstancePool(); - CcSmembPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSmemb or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::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. - CcSmembPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSmemb) { // it's a model object - // invalidate the cache for this single object - CcSmembPeer::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(CcSmembPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSmembPeer::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); - CcSmembPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSmemb 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 CcSmemb $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(CcSmemb $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSmembPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, CcSmembPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSmemb - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSmembPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $pk); - - $v = CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $pks, Criteria::IN); - $objs = CcSmembPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSmembPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSmembPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembQuery.php deleted file mode 100644 index 06b24502c..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSmembQuery.php +++ /dev/null @@ -1,305 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSmemb|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSmembPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSmembQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSmembPeer::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 CcSmembQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSmembPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcSmembQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcSmembPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the uid column - * - * @param int|array $uid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByUid($uid = null, $comparison = null) - { - if (is_array($uid)) { - $useMinMax = false; - if (isset($uid['min'])) { - $this->addUsingAlias(CcSmembPeer::UID, $uid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($uid['max'])) { - $this->addUsingAlias(CcSmembPeer::UID, $uid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::UID, $uid, $comparison); - } - - /** - * Filter the query on the gid column - * - * @param int|array $gid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByGid($gid = null, $comparison = null) - { - if (is_array($gid)) { - $useMinMax = false; - if (isset($gid['min'])) { - $this->addUsingAlias(CcSmembPeer::GID, $gid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($gid['max'])) { - $this->addUsingAlias(CcSmembPeer::GID, $gid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::GID, $gid, $comparison); - } - - /** - * Filter the query on the level column - * - * @param int|array $level 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByLevel($level = null, $comparison = null) - { - if (is_array($level)) { - $useMinMax = false; - if (isset($level['min'])) { - $this->addUsingAlias(CcSmembPeer::LEVEL, $level['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($level['max'])) { - $this->addUsingAlias(CcSmembPeer::LEVEL, $level['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::LEVEL, $level, $comparison); - } - - /** - * Filter the query on the mid column - * - * @param int|array $mid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByMid($mid = null, $comparison = null) - { - if (is_array($mid)) { - $useMinMax = false; - if (isset($mid['min'])) { - $this->addUsingAlias(CcSmembPeer::MID, $mid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($mid['max'])) { - $this->addUsingAlias(CcSmembPeer::MID, $mid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::MID, $mid, $comparison); - } - - /** - * Exclude object from result - * - * @param CcSmemb $ccSmemb Object to remove from the list of results - * - * @return CcSmembQuery The current query, for fluid interface - */ - public function prune($ccSmemb = null) - { - if ($ccSmemb) { - $this->addUsingAlias(CcSmembPeer::ID, $ccSmemb->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSmembQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSetting.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSetting.php deleted file mode 100644 index 6dadc9b67..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSetting.php +++ /dev/null @@ -1,756 +0,0 @@ -keyname; - } - - /** - * Get the [value] column value. - * - * @return string - */ - public function getDbValue() - { - return $this->value; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getDbType() - { - return $this->type; - } - - /** - * Set the value of [keyname] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbKeyName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->keyname !== $v) { - $this->keyname = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::KEYNAME; - } - - return $this; - } // setDbKeyName() - - /** - * Set the value of [value] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbValue($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->value !== $v) { - $this->value = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::VALUE; - } - - return $this; - } // setDbValue() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::TYPE; - } - - return $this; - } // setDbType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->keyname = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->value = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcStreamSettingPeer::NUM_COLUMNS - CcStreamSettingPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcStreamSetting object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcStreamSettingPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcStreamSettingQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcStreamSettingPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcStreamSettingPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcStreamSettingPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbKeyName(); - break; - case 1: - return $this->getDbValue(); - break; - case 2: - return $this->getDbType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcStreamSettingPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbKeyName(), - $keys[1] => $this->getDbValue(), - $keys[2] => $this->getDbType(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbKeyName($value); - break; - case 1: - $this->setDbValue($value); - break; - case 2: - $this->setDbType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcStreamSettingPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbKeyName($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbValue($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbType($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcStreamSettingPeer::KEYNAME)) $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname); - if ($this->isColumnModified(CcStreamSettingPeer::VALUE)) $criteria->add(CcStreamSettingPeer::VALUE, $this->value); - if ($this->isColumnModified(CcStreamSettingPeer::TYPE)) $criteria->add(CcStreamSettingPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbKeyName(); - } - - /** - * Generic method to set the primary key (keyname column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbKeyName($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbKeyName(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcStreamSetting (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbKeyName($this->keyname); - $copyObj->setDbValue($this->value); - $copyObj->setDbType($this->type); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcStreamSetting Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcStreamSettingPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcStreamSettingPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->keyname = null; - $this->value = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcStreamSetting diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingPeer.php deleted file mode 100644 index f5e680b20..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingPeer.php +++ /dev/null @@ -1,740 +0,0 @@ - array ('DbKeyName', 'DbValue', 'DbType', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbKeyName', 'dbValue', 'dbType', ), - BasePeer::TYPE_COLNAME => array (self::KEYNAME, self::VALUE, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('KEYNAME', 'VALUE', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('keyname', 'value', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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 ('DbKeyName' => 0, 'DbValue' => 1, 'DbType' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbKeyName' => 0, 'dbValue' => 1, 'dbType' => 2, ), - BasePeer::TYPE_COLNAME => array (self::KEYNAME => 0, self::VALUE => 1, self::TYPE => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('KEYNAME' => 0, 'VALUE' => 1, 'TYPE' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('keyname' => 0, 'value' => 1, 'type' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcStreamSettingPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcStreamSettingPeer::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(CcStreamSettingPeer::KEYNAME); - $criteria->addSelectColumn(CcStreamSettingPeer::VALUE); - $criteria->addSelectColumn(CcStreamSettingPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.KEYNAME'); - $criteria->addSelectColumn($alias . '.VALUE'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcStreamSettingPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcStreamSettingPeer::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(CcStreamSettingPeer::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 CcStreamSetting - * @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 = CcStreamSettingPeer::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 CcStreamSettingPeer::populateObjects(CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcStreamSettingPeer::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 CcStreamSetting $value A CcStreamSetting object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcStreamSetting $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbKeyName(); - } // 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 CcStreamSetting object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcStreamSetting) { - $key = (string) $value->getDbKeyName(); - } 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 CcStreamSetting 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 CcStreamSetting 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_stream_setting - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcStreamSettingPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcStreamSettingPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcStreamSettingPeer::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; - CcStreamSettingPeer::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 (CcStreamSetting object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcStreamSettingPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcStreamSettingPeer::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 + CcStreamSettingPeer::NUM_COLUMNS; - } else { - $cls = CcStreamSettingPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcStreamSettingPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcStreamSettingPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcStreamSettingPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcStreamSettingTableMap()); - } - } - - /** - * 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 ? CcStreamSettingPeer::CLASS_DEFAULT : CcStreamSettingPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcStreamSetting or Criteria object. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcStreamSetting object - } - - - // 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 CcStreamSetting or Criteria object. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcStreamSettingPeer::KEYNAME); - $value = $criteria->remove(CcStreamSettingPeer::KEYNAME); - if ($value) { - $selectCriteria->add(CcStreamSettingPeer::KEYNAME, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcStreamSettingPeer::TABLE_NAME); - } - - } else { // $values is CcStreamSetting 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_stream_setting 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(CcStreamSettingPeer::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(CcStreamSettingPeer::TABLE_NAME, $con, CcStreamSettingPeer::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). - CcStreamSettingPeer::clearInstancePool(); - CcStreamSettingPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcStreamSetting or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::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. - CcStreamSettingPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcStreamSetting) { // it's a model object - // invalidate the cache for this single object - CcStreamSettingPeer::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(CcStreamSettingPeer::KEYNAME, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcStreamSettingPeer::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); - CcStreamSettingPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcStreamSetting 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 CcStreamSetting $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(CcStreamSetting $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcStreamSettingPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, CcStreamSettingPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcStreamSetting - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcStreamSettingPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $pk); - - $v = CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $pks, Criteria::IN); - $objs = CcStreamSettingPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcStreamSettingPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcStreamSettingPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingQuery.php deleted file mode 100644 index 666106d6f..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcStreamSettingQuery.php +++ /dev/null @@ -1,222 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcStreamSetting|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcStreamSettingPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $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 CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $keys, Criteria::IN); - } - - /** - * Filter the query on the keyname column - * - * @param string $dbKeyName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbKeyName($dbKeyName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbKeyName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbKeyName)) { - $dbKeyName = str_replace('*', '%', $dbKeyName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $dbKeyName, $comparison); - } - - /** - * Filter the query on the value column - * - * @param string $dbValue The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbValue($dbValue = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbValue)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbValue)) { - $dbValue = str_replace('*', '%', $dbValue); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::VALUE, $dbValue, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $dbType The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbType($dbType = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbType)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbType)) { - $dbType = str_replace('*', '%', $dbType); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::TYPE, $dbType, $comparison); - } - - /** - * Exclude object from result - * - * @param CcStreamSetting $ccStreamSetting Object to remove from the list of results - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function prune($ccStreamSetting = null) - { - if ($ccStreamSetting) { - $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $ccStreamSetting->getDbKeyName(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcStreamSettingQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjs.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjs.php deleted file mode 100644 index 54a0468ce..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjs.php +++ /dev/null @@ -1,2423 +0,0 @@ -login = ''; - $this->pass = ''; - $this->type = 'U'; - $this->first_name = ''; - $this->last_name = ''; - $this->login_attempts = 0; - } - - /** - * Initializes internal state of BaseCcSubjs object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [login] column value. - * - * @return string - */ - public function getDbLogin() - { - return $this->login; - } - - /** - * Get the [pass] column value. - * - * @return string - */ - public function getDbPass() - { - return $this->pass; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getDbType() - { - return $this->type; - } - - /** - * Get the [first_name] column value. - * - * @return string - */ - public function getDbFirstName() - { - return $this->first_name; - } - - /** - * Get the [last_name] column value. - * - * @return string - */ - public function getDbLastName() - { - return $this->last_name; - } - - /** - * Get the [optionally formatted] temporal [lastlogin] 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 getDbLastlogin($format = 'Y-m-d H:i:s') - { - if ($this->lastlogin === null) { - return null; - } - - - - try { - $dt = new DateTime($this->lastlogin); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastlogin, 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 [optionally formatted] temporal [lastfail] 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 getDbLastfail($format = 'Y-m-d H:i:s') - { - if ($this->lastfail === null) { - return null; - } - - - - try { - $dt = new DateTime($this->lastfail); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastfail, 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 [skype_contact] column value. - * - * @return string - */ - public function getDbSkypeContact() - { - return $this->skype_contact; - } - - /** - * Get the [jabber_contact] column value. - * - * @return string - */ - public function getDbJabberContact() - { - return $this->jabber_contact; - } - - /** - * Get the [email] column value. - * - * @return string - */ - public function getDbEmail() - { - return $this->email; - } - - /** - * Get the [login_attempts] column value. - * - * @return int - */ - public function getDbLoginAttempts() - { - return $this->login_attempts; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSubjsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [login] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLogin($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->login !== $v || $this->isNew()) { - $this->login = $v; - $this->modifiedColumns[] = CcSubjsPeer::LOGIN; - } - - return $this; - } // setDbLogin() - - /** - * Set the value of [pass] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbPass($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->pass !== $v || $this->isNew()) { - $this->pass = $v; - $this->modifiedColumns[] = CcSubjsPeer::PASS; - } - - return $this; - } // setDbPass() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v || $this->isNew()) { - $this->type = $v; - $this->modifiedColumns[] = CcSubjsPeer::TYPE; - } - - return $this; - } // setDbType() - - /** - * Set the value of [first_name] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbFirstName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->first_name !== $v || $this->isNew()) { - $this->first_name = $v; - $this->modifiedColumns[] = CcSubjsPeer::FIRST_NAME; - } - - return $this; - } // setDbFirstName() - - /** - * Set the value of [last_name] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLastName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->last_name !== $v || $this->isNew()) { - $this->last_name = $v; - $this->modifiedColumns[] = CcSubjsPeer::LAST_NAME; - } - - return $this; - } // setDbLastName() - - /** - * Sets the value of [lastlogin] 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 CcSubjs The current object (for fluent API support) - */ - public function setDbLastlogin($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->lastlogin !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->lastlogin !== null && $tmpDt = new DateTime($this->lastlogin)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->lastlogin = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSubjsPeer::LASTLOGIN; - } - } // if either are not null - - return $this; - } // setDbLastlogin() - - /** - * Sets the value of [lastfail] 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 CcSubjs The current object (for fluent API support) - */ - public function setDbLastfail($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->lastfail !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->lastfail !== null && $tmpDt = new DateTime($this->lastfail)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->lastfail = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSubjsPeer::LASTFAIL; - } - } // if either are not null - - return $this; - } // setDbLastfail() - - /** - * Set the value of [skype_contact] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbSkypeContact($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->skype_contact !== $v) { - $this->skype_contact = $v; - $this->modifiedColumns[] = CcSubjsPeer::SKYPE_CONTACT; - } - - return $this; - } // setDbSkypeContact() - - /** - * Set the value of [jabber_contact] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbJabberContact($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->jabber_contact !== $v) { - $this->jabber_contact = $v; - $this->modifiedColumns[] = CcSubjsPeer::JABBER_CONTACT; - } - - return $this; - } // setDbJabberContact() - - /** - * Set the value of [email] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbEmail($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->email !== $v) { - $this->email = $v; - $this->modifiedColumns[] = CcSubjsPeer::EMAIL; - } - - return $this; - } // setDbEmail() - - /** - * Set the value of [login_attempts] column. - * - * @param int $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLoginAttempts($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->login_attempts !== $v || $this->isNew()) { - $this->login_attempts = $v; - $this->modifiedColumns[] = CcSubjsPeer::LOGIN_ATTEMPTS; - } - - return $this; - } // setDbLoginAttempts() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->login !== '') { - return false; - } - - if ($this->pass !== '') { - return false; - } - - if ($this->type !== 'U') { - return false; - } - - if ($this->first_name !== '') { - return false; - } - - if ($this->last_name !== '') { - return false; - } - - if ($this->login_attempts !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->login = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->pass = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->type = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->first_name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->skype_contact = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->jabber_contact = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->email = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->login_attempts = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 12; // 12 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSubjs object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSubjsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcAccesss = null; - - $this->collCcFiless = null; - - $this->collCcPermss = null; - - $this->collCcShowHostss = null; - - $this->collCcPlaylists = null; - - $this->collCcPrefs = null; - - $this->collCcSesss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSubjsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSubjsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcSubjsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcSubjsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSubjsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcSubjsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcAccesss !== null) { - foreach ($this->collCcAccesss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPermss !== null) { - foreach ($this->collCcPermss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPlaylists !== null) { - foreach ($this->collCcPlaylists as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPrefs !== null) { - foreach ($this->collCcPrefs as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSesss !== null) { - foreach ($this->collCcSesss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcSubjsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcAccesss !== null) { - foreach ($this->collCcAccesss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPermss !== null) { - foreach ($this->collCcPermss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPlaylists !== null) { - foreach ($this->collCcPlaylists as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPrefs !== null) { - foreach ($this->collCcPrefs as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSesss !== null) { - foreach ($this->collCcSesss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbLogin(); - break; - case 2: - return $this->getDbPass(); - break; - case 3: - return $this->getDbType(); - break; - case 4: - return $this->getDbFirstName(); - break; - case 5: - return $this->getDbLastName(); - break; - case 6: - return $this->getDbLastlogin(); - break; - case 7: - return $this->getDbLastfail(); - break; - case 8: - return $this->getDbSkypeContact(); - break; - case 9: - return $this->getDbJabberContact(); - break; - case 10: - return $this->getDbEmail(); - break; - case 11: - return $this->getDbLoginAttempts(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcSubjsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbLogin(), - $keys[2] => $this->getDbPass(), - $keys[3] => $this->getDbType(), - $keys[4] => $this->getDbFirstName(), - $keys[5] => $this->getDbLastName(), - $keys[6] => $this->getDbLastlogin(), - $keys[7] => $this->getDbLastfail(), - $keys[8] => $this->getDbSkypeContact(), - $keys[9] => $this->getDbJabberContact(), - $keys[10] => $this->getDbEmail(), - $keys[11] => $this->getDbLoginAttempts(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbLogin($value); - break; - case 2: - $this->setDbPass($value); - break; - case 3: - $this->setDbType($value); - break; - case 4: - $this->setDbFirstName($value); - break; - case 5: - $this->setDbLastName($value); - break; - case 6: - $this->setDbLastlogin($value); - break; - case 7: - $this->setDbLastfail($value); - break; - case 8: - $this->setDbSkypeContact($value); - break; - case 9: - $this->setDbJabberContact($value); - break; - case 10: - $this->setDbEmail($value); - break; - case 11: - $this->setDbLoginAttempts($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSubjsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbLogin($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbPass($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbType($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbFirstName($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbSkypeContact($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbJabberContact($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbEmail($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDbLoginAttempts($arr[$keys[11]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSubjsPeer::ID)) $criteria->add(CcSubjsPeer::ID, $this->id); - if ($this->isColumnModified(CcSubjsPeer::LOGIN)) $criteria->add(CcSubjsPeer::LOGIN, $this->login); - if ($this->isColumnModified(CcSubjsPeer::PASS)) $criteria->add(CcSubjsPeer::PASS, $this->pass); - if ($this->isColumnModified(CcSubjsPeer::TYPE)) $criteria->add(CcSubjsPeer::TYPE, $this->type); - if ($this->isColumnModified(CcSubjsPeer::FIRST_NAME)) $criteria->add(CcSubjsPeer::FIRST_NAME, $this->first_name); - if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name); - if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin); - if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail); - if ($this->isColumnModified(CcSubjsPeer::SKYPE_CONTACT)) $criteria->add(CcSubjsPeer::SKYPE_CONTACT, $this->skype_contact); - if ($this->isColumnModified(CcSubjsPeer::JABBER_CONTACT)) $criteria->add(CcSubjsPeer::JABBER_CONTACT, $this->jabber_contact); - if ($this->isColumnModified(CcSubjsPeer::EMAIL)) $criteria->add(CcSubjsPeer::EMAIL, $this->email); - if ($this->isColumnModified(CcSubjsPeer::LOGIN_ATTEMPTS)) $criteria->add(CcSubjsPeer::LOGIN_ATTEMPTS, $this->login_attempts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSubjs (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbLogin($this->login); - $copyObj->setDbPass($this->pass); - $copyObj->setDbType($this->type); - $copyObj->setDbFirstName($this->first_name); - $copyObj->setDbLastName($this->last_name); - $copyObj->setDbLastlogin($this->lastlogin); - $copyObj->setDbLastfail($this->lastfail); - $copyObj->setDbSkypeContact($this->skype_contact); - $copyObj->setDbJabberContact($this->jabber_contact); - $copyObj->setDbEmail($this->email); - $copyObj->setDbLoginAttempts($this->login_attempts); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcAccesss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcAccess($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcFiless() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcFiles($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPermss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPerms($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowHostss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowHosts($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPlaylists() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylist($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPrefs() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPref($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSesss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSess($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSubjs Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSubjsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSubjsPeer(); - } - return self::$peer; - } - - /** - * Clears out the collCcAccesss 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 addCcAccesss() - */ - public function clearCcAccesss() - { - $this->collCcAccesss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcAccesss collection. - * - * By default this just sets the collCcAccesss collection to an empty array (like clearcollCcAccesss()); - * 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 initCcAccesss() - { - $this->collCcAccesss = new PropelObjectCollection(); - $this->collCcAccesss->setModel('CcAccess'); - } - - /** - * Gets an array of CcAccess 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 CcSubjs 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 CcAccess[] List of CcAccess objects - * @throws PropelException - */ - public function getCcAccesss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcAccesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcAccesss) { - // return empty collection - $this->initCcAccesss(); - } else { - $collCcAccesss = CcAccessQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcAccesss; - } - $this->collCcAccesss = $collCcAccesss; - } - } - return $this->collCcAccesss; - } - - /** - * Returns the number of related CcAccess objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcAccess objects. - * @throws PropelException - */ - public function countCcAccesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcAccesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcAccesss) { - return 0; - } else { - $query = CcAccessQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcAccesss); - } - } - - /** - * Method called to associate a CcAccess object to this object - * through the CcAccess foreign key attribute. - * - * @param CcAccess $l CcAccess - * @return void - * @throws PropelException - */ - public function addCcAccess(CcAccess $l) - { - if ($this->collCcAccesss === null) { - $this->initCcAccesss(); - } - if (!$this->collCcAccesss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcAccesss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcFiless 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 addCcFiless() - */ - public function clearCcFiless() - { - $this->collCcFiless = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcFiless collection. - * - * By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless()); - * 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 initCcFiless() - { - $this->collCcFiless = new PropelObjectCollection(); - $this->collCcFiless->setModel('CcFiles'); - } - - /** - * Gets an array of CcFiles 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 CcSubjs 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 CcFiles[] List of CcFiles objects - * @throws PropelException - */ - public function getCcFiless($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - // return empty collection - $this->initCcFiless(); - } else { - $collCcFiless = CcFilesQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcFiless; - } - $this->collCcFiless = $collCcFiless; - } - } - return $this->collCcFiless; - } - - /** - * Returns the number of related CcFiles objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcFiles objects. - * @throws PropelException - */ - public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - return 0; - } else { - $query = CcFilesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcFiless); - } - } - - /** - * Method called to associate a CcFiles object to this object - * through the CcFiles foreign key attribute. - * - * @param CcFiles $l CcFiles - * @return void - * @throws PropelException - */ - public function addCcFiles(CcFiles $l) - { - if ($this->collCcFiless === null) { - $this->initCcFiless(); - } - if (!$this->collCcFiless->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcFiless[]= $l; - $l->setCcSubjs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcSubjs is new, it will return - * an empty collection; or if this CcSubjs has previously - * been saved, it will retrieve related CcFiless from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcSubjs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcFiles[] List of CcFiles objects - */ - public function getCcFilessJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcFilesQuery::create(null, $criteria); - $query->joinWith('CcMusicDirs', $join_behavior); - - return $this->getCcFiless($query, $con); - } - - /** - * Clears out the collCcPermss 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 addCcPermss() - */ - public function clearCcPermss() - { - $this->collCcPermss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPermss collection. - * - * By default this just sets the collCcPermss collection to an empty array (like clearcollCcPermss()); - * 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 initCcPermss() - { - $this->collCcPermss = new PropelObjectCollection(); - $this->collCcPermss->setModel('CcPerms'); - } - - /** - * Gets an array of CcPerms 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 CcSubjs 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 CcPerms[] List of CcPerms objects - * @throws PropelException - */ - public function getCcPermss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPermss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPermss) { - // return empty collection - $this->initCcPermss(); - } else { - $collCcPermss = CcPermsQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPermss; - } - $this->collCcPermss = $collCcPermss; - } - } - return $this->collCcPermss; - } - - /** - * Returns the number of related CcPerms objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPerms objects. - * @throws PropelException - */ - public function countCcPermss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPermss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPermss) { - return 0; - } else { - $query = CcPermsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPermss); - } - } - - /** - * Method called to associate a CcPerms object to this object - * through the CcPerms foreign key attribute. - * - * @param CcPerms $l CcPerms - * @return void - * @throws PropelException - */ - public function addCcPerms(CcPerms $l) - { - if ($this->collCcPermss === null) { - $this->initCcPermss(); - } - if (!$this->collCcPermss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPermss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcShowHostss 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 addCcShowHostss() - */ - public function clearCcShowHostss() - { - $this->collCcShowHostss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowHostss collection. - * - * By default this just sets the collCcShowHostss collection to an empty array (like clearcollCcShowHostss()); - * 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 initCcShowHostss() - { - $this->collCcShowHostss = new PropelObjectCollection(); - $this->collCcShowHostss->setModel('CcShowHosts'); - } - - /** - * Gets an array of CcShowHosts 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 CcSubjs 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 CcShowHosts[] List of CcShowHosts objects - * @throws PropelException - */ - public function getCcShowHostss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - // return empty collection - $this->initCcShowHostss(); - } else { - $collCcShowHostss = CcShowHostsQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowHostss; - } - $this->collCcShowHostss = $collCcShowHostss; - } - } - return $this->collCcShowHostss; - } - - /** - * Returns the number of related CcShowHosts objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowHosts objects. - * @throws PropelException - */ - public function countCcShowHostss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - return 0; - } else { - $query = CcShowHostsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcShowHostss); - } - } - - /** - * Method called to associate a CcShowHosts object to this object - * through the CcShowHosts foreign key attribute. - * - * @param CcShowHosts $l CcShowHosts - * @return void - * @throws PropelException - */ - public function addCcShowHosts(CcShowHosts $l) - { - if ($this->collCcShowHostss === null) { - $this->initCcShowHostss(); - } - if (!$this->collCcShowHostss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowHostss[]= $l; - $l->setCcSubjs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcSubjs is new, it will return - * an empty collection; or if this CcSubjs has previously - * been saved, it will retrieve related CcShowHostss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcSubjs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects - */ - public function getCcShowHostssJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowHostsQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowHostss($query, $con); - } - - /** - * Clears out the collCcPlaylists 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 addCcPlaylists() - */ - public function clearCcPlaylists() - { - $this->collCcPlaylists = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylists collection. - * - * By default this just sets the collCcPlaylists collection to an empty array (like clearcollCcPlaylists()); - * 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 initCcPlaylists() - { - $this->collCcPlaylists = new PropelObjectCollection(); - $this->collCcPlaylists->setModel('CcPlaylist'); - } - - /** - * Gets an array of CcPlaylist 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 CcSubjs 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 CcPlaylist[] List of CcPlaylist objects - * @throws PropelException - */ - public function getCcPlaylists($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylists || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylists) { - // return empty collection - $this->initCcPlaylists(); - } else { - $collCcPlaylists = CcPlaylistQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylists; - } - $this->collCcPlaylists = $collCcPlaylists; - } - } - return $this->collCcPlaylists; - } - - /** - * Returns the number of related CcPlaylist objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylist objects. - * @throws PropelException - */ - public function countCcPlaylists(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylists || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylists) { - return 0; - } else { - $query = CcPlaylistQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPlaylists); - } - } - - /** - * Method called to associate a CcPlaylist object to this object - * through the CcPlaylist foreign key attribute. - * - * @param CcPlaylist $l CcPlaylist - * @return void - * @throws PropelException - */ - public function addCcPlaylist(CcPlaylist $l) - { - if ($this->collCcPlaylists === null) { - $this->initCcPlaylists(); - } - if (!$this->collCcPlaylists->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylists[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcPrefs 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 addCcPrefs() - */ - public function clearCcPrefs() - { - $this->collCcPrefs = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPrefs collection. - * - * By default this just sets the collCcPrefs collection to an empty array (like clearcollCcPrefs()); - * 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 initCcPrefs() - { - $this->collCcPrefs = new PropelObjectCollection(); - $this->collCcPrefs->setModel('CcPref'); - } - - /** - * Gets an array of CcPref 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 CcSubjs 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 CcPref[] List of CcPref objects - * @throws PropelException - */ - public function getCcPrefs($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPrefs || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPrefs) { - // return empty collection - $this->initCcPrefs(); - } else { - $collCcPrefs = CcPrefQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPrefs; - } - $this->collCcPrefs = $collCcPrefs; - } - } - return $this->collCcPrefs; - } - - /** - * Returns the number of related CcPref objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPref objects. - * @throws PropelException - */ - public function countCcPrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPrefs || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPrefs) { - return 0; - } else { - $query = CcPrefQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPrefs); - } - } - - /** - * Method called to associate a CcPref object to this object - * through the CcPref foreign key attribute. - * - * @param CcPref $l CcPref - * @return void - * @throws PropelException - */ - public function addCcPref(CcPref $l) - { - if ($this->collCcPrefs === null) { - $this->initCcPrefs(); - } - if (!$this->collCcPrefs->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPrefs[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcSesss 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 addCcSesss() - */ - public function clearCcSesss() - { - $this->collCcSesss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSesss collection. - * - * By default this just sets the collCcSesss collection to an empty array (like clearcollCcSesss()); - * 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 initCcSesss() - { - $this->collCcSesss = new PropelObjectCollection(); - $this->collCcSesss->setModel('CcSess'); - } - - /** - * Gets an array of CcSess 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 CcSubjs 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 CcSess[] List of CcSess objects - * @throws PropelException - */ - public function getCcSesss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSesss) { - // return empty collection - $this->initCcSesss(); - } else { - $collCcSesss = CcSessQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcSesss; - } - $this->collCcSesss = $collCcSesss; - } - } - return $this->collCcSesss; - } - - /** - * Returns the number of related CcSess objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSess objects. - * @throws PropelException - */ - public function countCcSesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSesss) { - return 0; - } else { - $query = CcSessQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcSesss); - } - } - - /** - * Method called to associate a CcSess object to this object - * through the CcSess foreign key attribute. - * - * @param CcSess $l CcSess - * @return void - * @throws PropelException - */ - public function addCcSess(CcSess $l) - { - if ($this->collCcSesss === null) { - $this->initCcSesss(); - } - if (!$this->collCcSesss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSesss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->login = null; - $this->pass = null; - $this->type = null; - $this->first_name = null; - $this->last_name = null; - $this->lastlogin = null; - $this->lastfail = null; - $this->skype_contact = null; - $this->jabber_contact = null; - $this->email = null; - $this->login_attempts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcAccesss) { - foreach ((array) $this->collCcAccesss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcFiless) { - foreach ((array) $this->collCcFiless as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPermss) { - foreach ((array) $this->collCcPermss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowHostss) { - foreach ((array) $this->collCcShowHostss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPlaylists) { - foreach ((array) $this->collCcPlaylists as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPrefs) { - foreach ((array) $this->collCcPrefs as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSesss) { - foreach ((array) $this->collCcSesss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcAccesss = null; - $this->collCcFiless = null; - $this->collCcPermss = null; - $this->collCcShowHostss = null; - $this->collCcPlaylists = null; - $this->collCcPrefs = null; - $this->collCcSesss = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSubjs diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsPeer.php deleted file mode 100644 index 79a9a7efa..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsPeer.php +++ /dev/null @@ -1,801 +0,0 @@ - array ('DbId', 'DbLogin', 'DbPass', 'DbType', 'DbFirstName', 'DbLastName', 'DbLastlogin', 'DbLastfail', 'DbSkypeContact', 'DbJabberContact', 'DbEmail', 'DbLoginAttempts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLogin', 'dbPass', 'dbType', 'dbFirstName', 'dbLastName', 'dbLastlogin', 'dbLastfail', 'dbSkypeContact', 'dbJabberContact', 'dbEmail', 'dbLoginAttempts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::FIRST_NAME, self::LAST_NAME, self::LASTLOGIN, self::LASTFAIL, self::SKYPE_CONTACT, self::JABBER_CONTACT, self::EMAIL, self::LOGIN_ATTEMPTS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'FIRST_NAME', 'LAST_NAME', 'LASTLOGIN', 'LASTFAIL', 'SKYPE_CONTACT', 'JABBER_CONTACT', 'EMAIL', 'LOGIN_ATTEMPTS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'first_name', 'last_name', 'lastlogin', 'lastfail', 'skype_contact', 'jabber_contact', 'email', 'login_attempts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * 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, 'DbLogin' => 1, 'DbPass' => 2, 'DbType' => 3, 'DbFirstName' => 4, 'DbLastName' => 5, 'DbLastlogin' => 6, 'DbLastfail' => 7, 'DbSkypeContact' => 8, 'DbJabberContact' => 9, 'DbEmail' => 10, 'DbLoginAttempts' => 11, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLogin' => 1, 'dbPass' => 2, 'dbType' => 3, 'dbFirstName' => 4, 'dbLastName' => 5, 'dbLastlogin' => 6, 'dbLastfail' => 7, 'dbSkypeContact' => 8, 'dbJabberContact' => 9, 'dbEmail' => 10, 'dbLoginAttempts' => 11, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::FIRST_NAME => 4, self::LAST_NAME => 5, self::LASTLOGIN => 6, self::LASTFAIL => 7, self::SKYPE_CONTACT => 8, self::JABBER_CONTACT => 9, self::EMAIL => 10, self::LOGIN_ATTEMPTS => 11, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'FIRST_NAME' => 4, 'LAST_NAME' => 5, 'LASTLOGIN' => 6, 'LASTFAIL' => 7, 'SKYPE_CONTACT' => 8, 'JABBER_CONTACT' => 9, 'EMAIL' => 10, 'LOGIN_ATTEMPTS' => 11, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'first_name' => 4, 'last_name' => 5, 'lastlogin' => 6, 'lastfail' => 7, 'skype_contact' => 8, 'jabber_contact' => 9, 'email' => 10, 'login_attempts' => 11, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSubjsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSubjsPeer::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(CcSubjsPeer::ID); - $criteria->addSelectColumn(CcSubjsPeer::LOGIN); - $criteria->addSelectColumn(CcSubjsPeer::PASS); - $criteria->addSelectColumn(CcSubjsPeer::TYPE); - $criteria->addSelectColumn(CcSubjsPeer::FIRST_NAME); - $criteria->addSelectColumn(CcSubjsPeer::LAST_NAME); - $criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN); - $criteria->addSelectColumn(CcSubjsPeer::LASTFAIL); - $criteria->addSelectColumn(CcSubjsPeer::SKYPE_CONTACT); - $criteria->addSelectColumn(CcSubjsPeer::JABBER_CONTACT); - $criteria->addSelectColumn(CcSubjsPeer::EMAIL); - $criteria->addSelectColumn(CcSubjsPeer::LOGIN_ATTEMPTS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.LOGIN'); - $criteria->addSelectColumn($alias . '.PASS'); - $criteria->addSelectColumn($alias . '.TYPE'); - $criteria->addSelectColumn($alias . '.FIRST_NAME'); - $criteria->addSelectColumn($alias . '.LAST_NAME'); - $criteria->addSelectColumn($alias . '.LASTLOGIN'); - $criteria->addSelectColumn($alias . '.LASTFAIL'); - $criteria->addSelectColumn($alias . '.SKYPE_CONTACT'); - $criteria->addSelectColumn($alias . '.JABBER_CONTACT'); - $criteria->addSelectColumn($alias . '.EMAIL'); - $criteria->addSelectColumn($alias . '.LOGIN_ATTEMPTS'); - } - } - - /** - * 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(CcSubjsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSubjsPeer::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(CcSubjsPeer::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 CcSubjs - * @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 = CcSubjsPeer::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 CcSubjsPeer::populateObjects(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSubjsPeer::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 CcSubjs $value A CcSubjs object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSubjs $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 CcSubjs object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSubjs) { - $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 CcSubjs 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 CcSubjs 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_subjs - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcPermsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPermsPeer::clearInstancePool(); - // Invalidate objects in CcShowHostsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowHostsPeer::clearInstancePool(); - // Invalidate objects in CcPrefPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPrefPeer::clearInstancePool(); - // Invalidate objects in CcSessPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcSessPeer::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 = CcSubjsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSubjsPeer::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; - CcSubjsPeer::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 (CcSubjs object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSubjsPeer::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 + CcSubjsPeer::NUM_COLUMNS; - } else { - $cls = CcSubjsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcSubjsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSubjsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSubjsTableMap()); - } - } - - /** - * 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 ? CcSubjsPeer::CLASS_DEFAULT : CcSubjsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSubjs or Criteria object. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSubjs object - } - - if ($criteria->containsKey(CcSubjsPeer::ID) && $criteria->keyContainsValue(CcSubjsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSubjsPeer::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 CcSubjs or Criteria object. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSubjsPeer::ID); - $value = $criteria->remove(CcSubjsPeer::ID); - if ($value) { - $selectCriteria->add(CcSubjsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSubjsPeer::TABLE_NAME); - } - - } else { // $values is CcSubjs 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_subjs 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(CcSubjsPeer::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(CcSubjsPeer::TABLE_NAME, $con, CcSubjsPeer::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). - CcSubjsPeer::clearInstancePool(); - CcSubjsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSubjs or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::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. - CcSubjsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSubjs) { // it's a model object - // invalidate the cache for this single object - CcSubjsPeer::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(CcSubjsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSubjsPeer::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); - CcSubjsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSubjs 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 CcSubjs $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(CcSubjs $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSubjsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, CcSubjsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSubjs - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSubjsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $pk); - - $v = CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $pks, Criteria::IN); - $objs = CcSubjsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSubjsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSubjsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsQuery.php deleted file mode 100644 index 9a0cffdd0..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcSubjsQuery.php +++ /dev/null @@ -1,954 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSubjs|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSubjsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery 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(CcSubjsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the login column - * - * @param string $dbLogin The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLogin($dbLogin = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLogin)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLogin)) { - $dbLogin = str_replace('*', '%', $dbLogin); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::LOGIN, $dbLogin, $comparison); - } - - /** - * Filter the query on the pass column - * - * @param string $dbPass The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbPass($dbPass = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbPass)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbPass)) { - $dbPass = str_replace('*', '%', $dbPass); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::PASS, $dbPass, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $dbType The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbType($dbType = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbType)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbType)) { - $dbType = str_replace('*', '%', $dbType); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::TYPE, $dbType, $comparison); - } - - /** - * Filter the query on the first_name column - * - * @param string $dbFirstName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbFirstName($dbFirstName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFirstName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFirstName)) { - $dbFirstName = str_replace('*', '%', $dbFirstName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::FIRST_NAME, $dbFirstName, $comparison); - } - - /** - * Filter the query on the last_name column - * - * @param string $dbLastName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastName($dbLastName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLastName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLastName)) { - $dbLastName = str_replace('*', '%', $dbLastName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::LAST_NAME, $dbLastName, $comparison); - } - - /** - * Filter the query on the lastlogin column - * - * @param string|array $dbLastlogin 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastlogin($dbLastlogin = null, $comparison = null) - { - if (is_array($dbLastlogin)) { - $useMinMax = false; - if (isset($dbLastlogin['min'])) { - $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastlogin['max'])) { - $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin, $comparison); - } - - /** - * Filter the query on the lastfail column - * - * @param string|array $dbLastfail 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastfail($dbLastfail = null, $comparison = null) - { - if (is_array($dbLastfail)) { - $useMinMax = false; - if (isset($dbLastfail['min'])) { - $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastfail['max'])) { - $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail, $comparison); - } - - /** - * Filter the query on the skype_contact column - * - * @param string $dbSkypeContact The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbSkypeContact($dbSkypeContact = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSkypeContact)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSkypeContact)) { - $dbSkypeContact = str_replace('*', '%', $dbSkypeContact); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::SKYPE_CONTACT, $dbSkypeContact, $comparison); - } - - /** - * Filter the query on the jabber_contact column - * - * @param string $dbJabberContact The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbJabberContact($dbJabberContact = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbJabberContact)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbJabberContact)) { - $dbJabberContact = str_replace('*', '%', $dbJabberContact); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::JABBER_CONTACT, $dbJabberContact, $comparison); - } - - /** - * Filter the query on the email column - * - * @param string $dbEmail The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbEmail($dbEmail = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEmail)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEmail)) { - $dbEmail = str_replace('*', '%', $dbEmail); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::EMAIL, $dbEmail, $comparison); - } - - /** - * Filter the query on the login_attempts column - * - * @param int|array $dbLoginAttempts 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLoginAttempts($dbLoginAttempts = null, $comparison = null) - { - if (is_array($dbLoginAttempts)) { - $useMinMax = false; - if (isset($dbLoginAttempts['min'])) { - $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLoginAttempts['max'])) { - $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts, $comparison); - } - - /** - * Filter the query by a related CcAccess object - * - * @param CcAccess $ccAccess the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcAccess($ccAccess, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccAccess->getOwner(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcAccess relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcAccess($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcAccess'); - - // 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, 'CcAccess'); - } - - return $this; - } - - /** - * Use the CcAccess relation CcAccess 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 CcAccessQuery A secondary query class using the current class as primary query - */ - public function useCcAccessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcAccess($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcAccess', 'CcAccessQuery'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccFiles->getDbEditedby(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Filter the query by a related CcPerms object - * - * @param CcPerms $ccPerms the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPerms($ccPerms, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPerms->getSubj(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPerms relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPerms($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPerms'); - - // 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, 'CcPerms'); - } - - return $this; - } - - /** - * Use the CcPerms relation CcPerms 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 CcPermsQuery A secondary query class using the current class as primary query - */ - public function useCcPermsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPerms($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPerms', 'CcPermsQuery'); - } - - /** - * Filter the query by a related CcShowHosts object - * - * @param CcShowHosts $ccShowHosts the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcShowHosts($ccShowHosts, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccShowHosts->getDbHost(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowHosts relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcShowHosts($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowHosts'); - - // 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, 'CcShowHosts'); - } - - return $this; - } - - /** - * Use the CcShowHosts relation CcShowHosts 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 CcShowHostsQuery A secondary query class using the current class as primary query - */ - public function useCcShowHostsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowHosts($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery'); - } - - /** - * Filter the query by a related CcPlaylist object - * - * @param CcPlaylist $ccPlaylist the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPlaylist->getDbEditedby(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylist relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); - - // 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, 'CcPlaylist'); - } - - return $this; - } - - /** - * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); - } - - /** - * Filter the query by a related CcPref object - * - * @param CcPref $ccPref the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPref($ccPref, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPref->getSubjid(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPref relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPref($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPref'); - - // 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, 'CcPref'); - } - - return $this; - } - - /** - * Use the CcPref relation CcPref 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 CcPrefQuery A secondary query class using the current class as primary query - */ - public function useCcPrefQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPref($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPref', 'CcPrefQuery'); - } - - /** - * Filter the query by a related CcSess object - * - * @param CcSess $ccSess the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcSess($ccSess, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccSess->getUserid(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSess relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcSess($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSess'); - - // 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, 'CcSess'); - } - - return $this; - } - - /** - * Use the CcSess relation CcSess 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 CcSessQuery A secondary query class using the current class as primary query - */ - public function useCcSessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSess($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSess', 'CcSessQuery'); - } - - /** - * Exclude object from result - * - * @param CcSubjs $ccSubjs Object to remove from the list of results - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function prune($ccSubjs = null) - { - if ($ccSubjs) { - $this->addUsingAlias(CcSubjsPeer::ID, $ccSubjs->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSubjsQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTrans.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTrans.php deleted file mode 100644 index 2ea4f7c20..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTrans.php +++ /dev/null @@ -1,1903 +0,0 @@ -lock = 'N'; - } - - /** - * Initializes internal state of BaseCcTrans object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [trtok] column value. - * - * @return string - */ - public function getTrtok() - { - return $this->trtok; - } - - /** - * Get the [direction] column value. - * - * @return string - */ - public function getDirection() - { - return $this->direction; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Get the [trtype] column value. - * - * @return string - */ - public function getTrtype() - { - return $this->trtype; - } - - /** - * Get the [lock] column value. - * - * @return string - */ - public function getLock() - { - return $this->lock; - } - - /** - * Get the [target] column value. - * - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Get the [rtrtok] column value. - * - * @return string - */ - public function getRtrtok() - { - return $this->rtrtok; - } - - /** - * Get the [mdtrtok] column value. - * - * @return string - */ - public function getMdtrtok() - { - return $this->mdtrtok; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getGunid() - { - return $this->gunid; - } - - /** - * Get the [pdtoken] column value. - * - * @return string - */ - public function getPdtoken() - { - return $this->pdtoken; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Get the [localfile] column value. - * - * @return string - */ - public function getLocalfile() - { - return $this->localfile; - } - - /** - * Get the [fname] column value. - * - * @return string - */ - public function getFname() - { - return $this->fname; - } - - /** - * Get the [title] column value. - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Get the [expectedsum] column value. - * - * @return string - */ - public function getExpectedsum() - { - return $this->expectedsum; - } - - /** - * Get the [realsum] column value. - * - * @return string - */ - public function getRealsum() - { - return $this->realsum; - } - - /** - * Get the [expectedsize] column value. - * - * @return int - */ - public function getExpectedsize() - { - return $this->expectedsize; - } - - /** - * Get the [realsize] column value. - * - * @return int - */ - public function getRealsize() - { - return $this->realsize; - } - - /** - * Get the [uid] column value. - * - * @return int - */ - public function getUid() - { - return $this->uid; - } - - /** - * Get the [errmsg] column value. - * - * @return string - */ - public function getErrmsg() - { - return $this->errmsg; - } - - /** - * Get the [jobpid] column value. - * - * @return int - */ - public function getJobpid() - { - return $this->jobpid; - } - - /** - * Get the [optionally formatted] temporal [start] 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 getStart($format = 'Y-m-d H:i:s') - { - if ($this->start === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start, 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 [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcTransPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [trtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->trtok !== $v) { - $this->trtok = $v; - $this->modifiedColumns[] = CcTransPeer::TRTOK; - } - - return $this; - } // setTrtok() - - /** - * Set the value of [direction] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setDirection($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->direction !== $v) { - $this->direction = $v; - $this->modifiedColumns[] = CcTransPeer::DIRECTION; - } - - return $this; - } // setDirection() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v) { - $this->state = $v; - $this->modifiedColumns[] = CcTransPeer::STATE; - } - - return $this; - } // setState() - - /** - * Set the value of [trtype] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTrtype($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->trtype !== $v) { - $this->trtype = $v; - $this->modifiedColumns[] = CcTransPeer::TRTYPE; - } - - return $this; - } // setTrtype() - - /** - * Set the value of [lock] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setLock($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lock !== $v || $this->isNew()) { - $this->lock = $v; - $this->modifiedColumns[] = CcTransPeer::LOCK; - } - - return $this; - } // setLock() - - /** - * Set the value of [target] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTarget($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->target !== $v) { - $this->target = $v; - $this->modifiedColumns[] = CcTransPeer::TARGET; - } - - return $this; - } // setTarget() - - /** - * Set the value of [rtrtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRtrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->rtrtok !== $v) { - $this->rtrtok = $v; - $this->modifiedColumns[] = CcTransPeer::RTRTOK; - } - - return $this; - } // setRtrtok() - - /** - * Set the value of [mdtrtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setMdtrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mdtrtok !== $v) { - $this->mdtrtok = $v; - $this->modifiedColumns[] = CcTransPeer::MDTRTOK; - } - - return $this; - } // setMdtrtok() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcTransPeer::GUNID; - } - - return $this; - } // setGunid() - - /** - * Set the value of [pdtoken] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setPdtoken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->pdtoken !== $v) { - $this->pdtoken = $v; - $this->modifiedColumns[] = CcTransPeer::PDTOKEN; - } - - return $this; - } // setPdtoken() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v) { - $this->url = $v; - $this->modifiedColumns[] = CcTransPeer::URL; - } - - return $this; - } // setUrl() - - /** - * Set the value of [localfile] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setLocalfile($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->localfile !== $v) { - $this->localfile = $v; - $this->modifiedColumns[] = CcTransPeer::LOCALFILE; - } - - return $this; - } // setLocalfile() - - /** - * Set the value of [fname] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setFname($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->fname !== $v) { - $this->fname = $v; - $this->modifiedColumns[] = CcTransPeer::FNAME; - } - - return $this; - } // setFname() - - /** - * Set the value of [title] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->title !== $v) { - $this->title = $v; - $this->modifiedColumns[] = CcTransPeer::TITLE; - } - - return $this; - } // setTitle() - - /** - * Set the value of [expectedsum] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setExpectedsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->expectedsum !== $v) { - $this->expectedsum = $v; - $this->modifiedColumns[] = CcTransPeer::EXPECTEDSUM; - } - - return $this; - } // setExpectedsum() - - /** - * Set the value of [realsum] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRealsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->realsum !== $v) { - $this->realsum = $v; - $this->modifiedColumns[] = CcTransPeer::REALSUM; - } - - return $this; - } // setRealsum() - - /** - * Set the value of [expectedsize] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setExpectedsize($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->expectedsize !== $v) { - $this->expectedsize = $v; - $this->modifiedColumns[] = CcTransPeer::EXPECTEDSIZE; - } - - return $this; - } // setExpectedsize() - - /** - * Set the value of [realsize] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRealsize($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->realsize !== $v) { - $this->realsize = $v; - $this->modifiedColumns[] = CcTransPeer::REALSIZE; - } - - return $this; - } // setRealsize() - - /** - * Set the value of [uid] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setUid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->uid !== $v) { - $this->uid = $v; - $this->modifiedColumns[] = CcTransPeer::UID; - } - - return $this; - } // setUid() - - /** - * Set the value of [errmsg] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setErrmsg($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->errmsg !== $v) { - $this->errmsg = $v; - $this->modifiedColumns[] = CcTransPeer::ERRMSG; - } - - return $this; - } // setErrmsg() - - /** - * Set the value of [jobpid] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setJobpid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->jobpid !== $v) { - $this->jobpid = $v; - $this->modifiedColumns[] = CcTransPeer::JOBPID; - } - - return $this; - } // setJobpid() - - /** - * Sets the value of [start] 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 CcTrans The current object (for fluent API support) - */ - public function setStart($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->start !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start !== null && $tmpDt = new DateTime($this->start)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcTransPeer::START; - } - } // if either are not null - - return $this; - } // setStart() - - /** - * Sets the value of [ts] 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 CcTrans The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcTransPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->lock !== 'N') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->trtok = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->direction = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->state = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->trtype = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->lock = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->target = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->rtrtok = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->mdtrtok = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->gunid = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->pdtoken = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->url = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; - $this->localfile = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; - $this->fname = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null; - $this->title = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null; - $this->expectedsum = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null; - $this->realsum = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null; - $this->expectedsize = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null; - $this->realsize = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null; - $this->uid = ($row[$startcol + 19] !== null) ? (int) $row[$startcol + 19] : null; - $this->errmsg = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null; - $this->jobpid = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null; - $this->start = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null; - $this->ts = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 24; // 24 = CcTransPeer::NUM_COLUMNS - CcTransPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcTrans object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcTransPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcTransQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcTransPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcTransPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcTransPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcTransPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcTransPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcTransPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcTransPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getTrtok(); - break; - case 2: - return $this->getDirection(); - break; - case 3: - return $this->getState(); - break; - case 4: - return $this->getTrtype(); - break; - case 5: - return $this->getLock(); - break; - case 6: - return $this->getTarget(); - break; - case 7: - return $this->getRtrtok(); - break; - case 8: - return $this->getMdtrtok(); - break; - case 9: - return $this->getGunid(); - break; - case 10: - return $this->getPdtoken(); - break; - case 11: - return $this->getUrl(); - break; - case 12: - return $this->getLocalfile(); - break; - case 13: - return $this->getFname(); - break; - case 14: - return $this->getTitle(); - break; - case 15: - return $this->getExpectedsum(); - break; - case 16: - return $this->getRealsum(); - break; - case 17: - return $this->getExpectedsize(); - break; - case 18: - return $this->getRealsize(); - break; - case 19: - return $this->getUid(); - break; - case 20: - return $this->getErrmsg(); - break; - case 21: - return $this->getJobpid(); - break; - case 22: - return $this->getStart(); - break; - case 23: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcTransPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getTrtok(), - $keys[2] => $this->getDirection(), - $keys[3] => $this->getState(), - $keys[4] => $this->getTrtype(), - $keys[5] => $this->getLock(), - $keys[6] => $this->getTarget(), - $keys[7] => $this->getRtrtok(), - $keys[8] => $this->getMdtrtok(), - $keys[9] => $this->getGunid(), - $keys[10] => $this->getPdtoken(), - $keys[11] => $this->getUrl(), - $keys[12] => $this->getLocalfile(), - $keys[13] => $this->getFname(), - $keys[14] => $this->getTitle(), - $keys[15] => $this->getExpectedsum(), - $keys[16] => $this->getRealsum(), - $keys[17] => $this->getExpectedsize(), - $keys[18] => $this->getRealsize(), - $keys[19] => $this->getUid(), - $keys[20] => $this->getErrmsg(), - $keys[21] => $this->getJobpid(), - $keys[22] => $this->getStart(), - $keys[23] => $this->getTs(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcTransPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setTrtok($value); - break; - case 2: - $this->setDirection($value); - break; - case 3: - $this->setState($value); - break; - case 4: - $this->setTrtype($value); - break; - case 5: - $this->setLock($value); - break; - case 6: - $this->setTarget($value); - break; - case 7: - $this->setRtrtok($value); - break; - case 8: - $this->setMdtrtok($value); - break; - case 9: - $this->setGunid($value); - break; - case 10: - $this->setPdtoken($value); - break; - case 11: - $this->setUrl($value); - break; - case 12: - $this->setLocalfile($value); - break; - case 13: - $this->setFname($value); - break; - case 14: - $this->setTitle($value); - break; - case 15: - $this->setExpectedsum($value); - break; - case 16: - $this->setRealsum($value); - break; - case 17: - $this->setExpectedsize($value); - break; - case 18: - $this->setRealsize($value); - break; - case 19: - $this->setUid($value); - break; - case 20: - $this->setErrmsg($value); - break; - case 21: - $this->setJobpid($value); - break; - case 22: - $this->setStart($value); - break; - case 23: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcTransPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setTrtok($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDirection($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setState($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTrtype($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setLock($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setTarget($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setRtrtok($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setMdtrtok($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setGunid($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setPdtoken($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setUrl($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setLocalfile($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setFname($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setTitle($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setExpectedsum($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setRealsum($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setExpectedsize($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setRealsize($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setUid($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setErrmsg($arr[$keys[20]]); - if (array_key_exists($keys[21], $arr)) $this->setJobpid($arr[$keys[21]]); - if (array_key_exists($keys[22], $arr)) $this->setStart($arr[$keys[22]]); - if (array_key_exists($keys[23], $arr)) $this->setTs($arr[$keys[23]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcTransPeer::ID)) $criteria->add(CcTransPeer::ID, $this->id); - if ($this->isColumnModified(CcTransPeer::TRTOK)) $criteria->add(CcTransPeer::TRTOK, $this->trtok); - if ($this->isColumnModified(CcTransPeer::DIRECTION)) $criteria->add(CcTransPeer::DIRECTION, $this->direction); - if ($this->isColumnModified(CcTransPeer::STATE)) $criteria->add(CcTransPeer::STATE, $this->state); - if ($this->isColumnModified(CcTransPeer::TRTYPE)) $criteria->add(CcTransPeer::TRTYPE, $this->trtype); - if ($this->isColumnModified(CcTransPeer::LOCK)) $criteria->add(CcTransPeer::LOCK, $this->lock); - if ($this->isColumnModified(CcTransPeer::TARGET)) $criteria->add(CcTransPeer::TARGET, $this->target); - if ($this->isColumnModified(CcTransPeer::RTRTOK)) $criteria->add(CcTransPeer::RTRTOK, $this->rtrtok); - if ($this->isColumnModified(CcTransPeer::MDTRTOK)) $criteria->add(CcTransPeer::MDTRTOK, $this->mdtrtok); - if ($this->isColumnModified(CcTransPeer::GUNID)) $criteria->add(CcTransPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcTransPeer::PDTOKEN)) $criteria->add(CcTransPeer::PDTOKEN, $this->pdtoken); - if ($this->isColumnModified(CcTransPeer::URL)) $criteria->add(CcTransPeer::URL, $this->url); - if ($this->isColumnModified(CcTransPeer::LOCALFILE)) $criteria->add(CcTransPeer::LOCALFILE, $this->localfile); - if ($this->isColumnModified(CcTransPeer::FNAME)) $criteria->add(CcTransPeer::FNAME, $this->fname); - if ($this->isColumnModified(CcTransPeer::TITLE)) $criteria->add(CcTransPeer::TITLE, $this->title); - if ($this->isColumnModified(CcTransPeer::EXPECTEDSUM)) $criteria->add(CcTransPeer::EXPECTEDSUM, $this->expectedsum); - if ($this->isColumnModified(CcTransPeer::REALSUM)) $criteria->add(CcTransPeer::REALSUM, $this->realsum); - if ($this->isColumnModified(CcTransPeer::EXPECTEDSIZE)) $criteria->add(CcTransPeer::EXPECTEDSIZE, $this->expectedsize); - if ($this->isColumnModified(CcTransPeer::REALSIZE)) $criteria->add(CcTransPeer::REALSIZE, $this->realsize); - if ($this->isColumnModified(CcTransPeer::UID)) $criteria->add(CcTransPeer::UID, $this->uid); - if ($this->isColumnModified(CcTransPeer::ERRMSG)) $criteria->add(CcTransPeer::ERRMSG, $this->errmsg); - if ($this->isColumnModified(CcTransPeer::JOBPID)) $criteria->add(CcTransPeer::JOBPID, $this->jobpid); - if ($this->isColumnModified(CcTransPeer::START)) $criteria->add(CcTransPeer::START, $this->start); - if ($this->isColumnModified(CcTransPeer::TS)) $criteria->add(CcTransPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcTrans (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setTrtok($this->trtok); - $copyObj->setDirection($this->direction); - $copyObj->setState($this->state); - $copyObj->setTrtype($this->trtype); - $copyObj->setLock($this->lock); - $copyObj->setTarget($this->target); - $copyObj->setRtrtok($this->rtrtok); - $copyObj->setMdtrtok($this->mdtrtok); - $copyObj->setGunid($this->gunid); - $copyObj->setPdtoken($this->pdtoken); - $copyObj->setUrl($this->url); - $copyObj->setLocalfile($this->localfile); - $copyObj->setFname($this->fname); - $copyObj->setTitle($this->title); - $copyObj->setExpectedsum($this->expectedsum); - $copyObj->setRealsum($this->realsum); - $copyObj->setExpectedsize($this->expectedsize); - $copyObj->setRealsize($this->realsize); - $copyObj->setUid($this->uid); - $copyObj->setErrmsg($this->errmsg); - $copyObj->setJobpid($this->jobpid); - $copyObj->setStart($this->start); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcTrans Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcTransPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcTransPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->trtok = null; - $this->direction = null; - $this->state = null; - $this->trtype = null; - $this->lock = null; - $this->target = null; - $this->rtrtok = null; - $this->mdtrtok = null; - $this->gunid = null; - $this->pdtoken = null; - $this->url = null; - $this->localfile = null; - $this->fname = null; - $this->title = null; - $this->expectedsum = null; - $this->realsum = null; - $this->expectedsize = null; - $this->realsize = null; - $this->uid = null; - $this->errmsg = null; - $this->jobpid = null; - $this->start = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcTrans diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransPeer.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransPeer.php deleted file mode 100644 index bac6b9ed8..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransPeer.php +++ /dev/null @@ -1,849 +0,0 @@ - array ('Id', 'Trtok', 'Direction', 'State', 'Trtype', 'Lock', 'Target', 'Rtrtok', 'Mdtrtok', 'Gunid', 'Pdtoken', 'Url', 'Localfile', 'Fname', 'Title', 'Expectedsum', 'Realsum', 'Expectedsize', 'Realsize', 'Uid', 'Errmsg', 'Jobpid', 'Start', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::TRTOK, self::DIRECTION, self::STATE, self::TRTYPE, self::LOCK, self::TARGET, self::RTRTOK, self::MDTRTOK, self::GUNID, self::PDTOKEN, self::URL, self::LOCALFILE, self::FNAME, self::TITLE, self::EXPECTEDSUM, self::REALSUM, self::EXPECTEDSIZE, self::REALSIZE, self::UID, self::ERRMSG, self::JOBPID, self::START, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TRTOK', 'DIRECTION', 'STATE', 'TRTYPE', 'LOCK', 'TARGET', 'RTRTOK', 'MDTRTOK', 'GUNID', 'PDTOKEN', 'URL', 'LOCALFILE', 'FNAME', 'TITLE', 'EXPECTEDSUM', 'REALSUM', 'EXPECTEDSIZE', 'REALSIZE', 'UID', 'ERRMSG', 'JOBPID', 'START', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) - ); - - /** - * 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 ('Id' => 0, 'Trtok' => 1, 'Direction' => 2, 'State' => 3, 'Trtype' => 4, 'Lock' => 5, 'Target' => 6, 'Rtrtok' => 7, 'Mdtrtok' => 8, 'Gunid' => 9, 'Pdtoken' => 10, 'Url' => 11, 'Localfile' => 12, 'Fname' => 13, 'Title' => 14, 'Expectedsum' => 15, 'Realsum' => 16, 'Expectedsize' => 17, 'Realsize' => 18, 'Uid' => 19, 'Errmsg' => 20, 'Jobpid' => 21, 'Start' => 22, 'Ts' => 23, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TRTOK => 1, self::DIRECTION => 2, self::STATE => 3, self::TRTYPE => 4, self::LOCK => 5, self::TARGET => 6, self::RTRTOK => 7, self::MDTRTOK => 8, self::GUNID => 9, self::PDTOKEN => 10, self::URL => 11, self::LOCALFILE => 12, self::FNAME => 13, self::TITLE => 14, self::EXPECTEDSUM => 15, self::REALSUM => 16, self::EXPECTEDSIZE => 17, self::REALSIZE => 18, self::UID => 19, self::ERRMSG => 20, self::JOBPID => 21, self::START => 22, self::TS => 23, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TRTOK' => 1, 'DIRECTION' => 2, 'STATE' => 3, 'TRTYPE' => 4, 'LOCK' => 5, 'TARGET' => 6, 'RTRTOK' => 7, 'MDTRTOK' => 8, 'GUNID' => 9, 'PDTOKEN' => 10, 'URL' => 11, 'LOCALFILE' => 12, 'FNAME' => 13, 'TITLE' => 14, 'EXPECTEDSUM' => 15, 'REALSUM' => 16, 'EXPECTEDSIZE' => 17, 'REALSIZE' => 18, 'UID' => 19, 'ERRMSG' => 20, 'JOBPID' => 21, 'START' => 22, 'TS' => 23, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcTransPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcTransPeer::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(CcTransPeer::ID); - $criteria->addSelectColumn(CcTransPeer::TRTOK); - $criteria->addSelectColumn(CcTransPeer::DIRECTION); - $criteria->addSelectColumn(CcTransPeer::STATE); - $criteria->addSelectColumn(CcTransPeer::TRTYPE); - $criteria->addSelectColumn(CcTransPeer::LOCK); - $criteria->addSelectColumn(CcTransPeer::TARGET); - $criteria->addSelectColumn(CcTransPeer::RTRTOK); - $criteria->addSelectColumn(CcTransPeer::MDTRTOK); - $criteria->addSelectColumn(CcTransPeer::GUNID); - $criteria->addSelectColumn(CcTransPeer::PDTOKEN); - $criteria->addSelectColumn(CcTransPeer::URL); - $criteria->addSelectColumn(CcTransPeer::LOCALFILE); - $criteria->addSelectColumn(CcTransPeer::FNAME); - $criteria->addSelectColumn(CcTransPeer::TITLE); - $criteria->addSelectColumn(CcTransPeer::EXPECTEDSUM); - $criteria->addSelectColumn(CcTransPeer::REALSUM); - $criteria->addSelectColumn(CcTransPeer::EXPECTEDSIZE); - $criteria->addSelectColumn(CcTransPeer::REALSIZE); - $criteria->addSelectColumn(CcTransPeer::UID); - $criteria->addSelectColumn(CcTransPeer::ERRMSG); - $criteria->addSelectColumn(CcTransPeer::JOBPID); - $criteria->addSelectColumn(CcTransPeer::START); - $criteria->addSelectColumn(CcTransPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.TRTOK'); - $criteria->addSelectColumn($alias . '.DIRECTION'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.TRTYPE'); - $criteria->addSelectColumn($alias . '.LOCK'); - $criteria->addSelectColumn($alias . '.TARGET'); - $criteria->addSelectColumn($alias . '.RTRTOK'); - $criteria->addSelectColumn($alias . '.MDTRTOK'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.PDTOKEN'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.LOCALFILE'); - $criteria->addSelectColumn($alias . '.FNAME'); - $criteria->addSelectColumn($alias . '.TITLE'); - $criteria->addSelectColumn($alias . '.EXPECTEDSUM'); - $criteria->addSelectColumn($alias . '.REALSUM'); - $criteria->addSelectColumn($alias . '.EXPECTEDSIZE'); - $criteria->addSelectColumn($alias . '.REALSIZE'); - $criteria->addSelectColumn($alias . '.UID'); - $criteria->addSelectColumn($alias . '.ERRMSG'); - $criteria->addSelectColumn($alias . '.JOBPID'); - $criteria->addSelectColumn($alias . '.START'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcTransPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcTransPeer::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(CcTransPeer::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 CcTrans - * @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 = CcTransPeer::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 CcTransPeer::populateObjects(CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcTransPeer::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 CcTrans $value A CcTrans object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcTrans $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcTrans object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcTrans) { - $key = (string) $value->getId(); - } 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 CcTrans 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 CcTrans 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_trans - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcTransPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcTransPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcTransPeer::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; - CcTransPeer::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 (CcTrans object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcTransPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcTransPeer::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 + CcTransPeer::NUM_COLUMNS; - } else { - $cls = CcTransPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcTransPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcTransPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcTransPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcTransTableMap()); - } - } - - /** - * 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 ? CcTransPeer::CLASS_DEFAULT : CcTransPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcTrans or Criteria object. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcTrans object - } - - if ($criteria->containsKey(CcTransPeer::ID) && $criteria->keyContainsValue(CcTransPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcTransPeer::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 CcTrans or Criteria object. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcTransPeer::ID); - $value = $criteria->remove(CcTransPeer::ID); - if ($value) { - $selectCriteria->add(CcTransPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcTransPeer::TABLE_NAME); - } - - } else { // $values is CcTrans 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_trans 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(CcTransPeer::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(CcTransPeer::TABLE_NAME, $con, CcTransPeer::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). - CcTransPeer::clearInstancePool(); - CcTransPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcTrans or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::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. - CcTransPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcTrans) { // it's a model object - // invalidate the cache for this single object - CcTransPeer::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(CcTransPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcTransPeer::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); - CcTransPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcTrans 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 CcTrans $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(CcTrans $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcTransPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcTransPeer::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(CcTransPeer::DATABASE_NAME, CcTransPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcTrans - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcTransPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $pk); - - $v = CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $pks, Criteria::IN); - $objs = CcTransPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcTransPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcTransPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransQuery.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransQuery.php deleted file mode 100644 index 0bbccae2f..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/BaseCcTransQuery.php +++ /dev/null @@ -1,826 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcTrans|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcTransPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcTransQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcTransPeer::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 CcTransQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcTransPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcTransQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcTransPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the trtok column - * - * @param string $trtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTrtok($trtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($trtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $trtok)) { - $trtok = str_replace('*', '%', $trtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TRTOK, $trtok, $comparison); - } - - /** - * Filter the query on the direction column - * - * @param string $direction The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByDirection($direction = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($direction)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $direction)) { - $direction = str_replace('*', '%', $direction); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::DIRECTION, $direction, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $state The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByState($state = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($state)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $state)) { - $state = str_replace('*', '%', $state); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::STATE, $state, $comparison); - } - - /** - * Filter the query on the trtype column - * - * @param string $trtype The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTrtype($trtype = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($trtype)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $trtype)) { - $trtype = str_replace('*', '%', $trtype); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TRTYPE, $trtype, $comparison); - } - - /** - * Filter the query on the lock column - * - * @param string $lock The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByLock($lock = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($lock)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $lock)) { - $lock = str_replace('*', '%', $lock); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::LOCK, $lock, $comparison); - } - - /** - * Filter the query on the target column - * - * @param string $target The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTarget($target = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($target)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $target)) { - $target = str_replace('*', '%', $target); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TARGET, $target, $comparison); - } - - /** - * Filter the query on the rtrtok column - * - * @param string $rtrtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByRtrtok($rtrtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($rtrtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $rtrtok)) { - $rtrtok = str_replace('*', '%', $rtrtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::RTRTOK, $rtrtok, $comparison); - } - - /** - * Filter the query on the mdtrtok column - * - * @param string $mdtrtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByMdtrtok($mdtrtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($mdtrtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $mdtrtok)) { - $mdtrtok = str_replace('*', '%', $mdtrtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::MDTRTOK, $mdtrtok, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $gunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByGunid($gunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($gunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $gunid)) { - $gunid = str_replace('*', '%', $gunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::GUNID, $gunid, $comparison); - } - - /** - * Filter the query on the pdtoken column - * - * @param string|array $pdtoken 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 CcTransQuery The current query, for fluid interface - */ - public function filterByPdtoken($pdtoken = null, $comparison = null) - { - if (is_array($pdtoken)) { - $useMinMax = false; - if (isset($pdtoken['min'])) { - $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($pdtoken['max'])) { - $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $url The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByUrl($url = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($url)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $url)) { - $url = str_replace('*', '%', $url); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::URL, $url, $comparison); - } - - /** - * Filter the query on the localfile column - * - * @param string $localfile The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByLocalfile($localfile = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($localfile)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $localfile)) { - $localfile = str_replace('*', '%', $localfile); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::LOCALFILE, $localfile, $comparison); - } - - /** - * Filter the query on the fname column - * - * @param string $fname The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByFname($fname = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($fname)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $fname)) { - $fname = str_replace('*', '%', $fname); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::FNAME, $fname, $comparison); - } - - /** - * Filter the query on the title column - * - * @param string $title The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTitle($title = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($title)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $title)) { - $title = str_replace('*', '%', $title); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TITLE, $title, $comparison); - } - - /** - * Filter the query on the expectedsum column - * - * @param string $expectedsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByExpectedsum($expectedsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($expectedsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $expectedsum)) { - $expectedsum = str_replace('*', '%', $expectedsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::EXPECTEDSUM, $expectedsum, $comparison); - } - - /** - * Filter the query on the realsum column - * - * @param string $realsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByRealsum($realsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($realsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $realsum)) { - $realsum = str_replace('*', '%', $realsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::REALSUM, $realsum, $comparison); - } - - /** - * Filter the query on the expectedsize column - * - * @param int|array $expectedsize 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 CcTransQuery The current query, for fluid interface - */ - public function filterByExpectedsize($expectedsize = null, $comparison = null) - { - if (is_array($expectedsize)) { - $useMinMax = false; - if (isset($expectedsize['min'])) { - $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($expectedsize['max'])) { - $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize, $comparison); - } - - /** - * Filter the query on the realsize column - * - * @param int|array $realsize 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 CcTransQuery The current query, for fluid interface - */ - public function filterByRealsize($realsize = null, $comparison = null) - { - if (is_array($realsize)) { - $useMinMax = false; - if (isset($realsize['min'])) { - $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($realsize['max'])) { - $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize, $comparison); - } - - /** - * Filter the query on the uid column - * - * @param int|array $uid 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 CcTransQuery The current query, for fluid interface - */ - public function filterByUid($uid = null, $comparison = null) - { - if (is_array($uid)) { - $useMinMax = false; - if (isset($uid['min'])) { - $this->addUsingAlias(CcTransPeer::UID, $uid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($uid['max'])) { - $this->addUsingAlias(CcTransPeer::UID, $uid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::UID, $uid, $comparison); - } - - /** - * Filter the query on the errmsg column - * - * @param string $errmsg The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByErrmsg($errmsg = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($errmsg)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $errmsg)) { - $errmsg = str_replace('*', '%', $errmsg); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::ERRMSG, $errmsg, $comparison); - } - - /** - * Filter the query on the jobpid column - * - * @param int|array $jobpid 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 CcTransQuery The current query, for fluid interface - */ - public function filterByJobpid($jobpid = null, $comparison = null) - { - if (is_array($jobpid)) { - $useMinMax = false; - if (isset($jobpid['min'])) { - $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($jobpid['max'])) { - $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid, $comparison); - } - - /** - * Filter the query on the start column - * - * @param string|array $start 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 CcTransQuery The current query, for fluid interface - */ - public function filterByStart($start = null, $comparison = null) - { - if (is_array($start)) { - $useMinMax = false; - if (isset($start['min'])) { - $this->addUsingAlias(CcTransPeer::START, $start['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($start['max'])) { - $this->addUsingAlias(CcTransPeer::START, $start['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::START, $start, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcTransQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcTransPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcTransPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::TS, $ts, $comparison); - } - - /** - * Exclude object from result - * - * @param CcTrans $ccTrans Object to remove from the list of results - * - * @return CcTransQuery The current query, for fluid interface - */ - public function prune($ccTrans = null) - { - if ($ccTrans) { - $this->addUsingAlias(CcTransPeer::ID, $ccTrans->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcTransQuery diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcFiles.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcFiles.php deleted file mode 100644 index edc51a659..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcFiles.php +++ /dev/null @@ -1,31 +0,0 @@ -length; - } - - public function setDbLength($time) - { - $this->length = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; - return Common::setTimeInSub($this, 'LENGTH', $time); - } - - -} // CcFiles diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylist.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylist.php deleted file mode 100644 index 0d3cff401..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylist.php +++ /dev/null @@ -1,48 +0,0 @@ -prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - public function computeLength() - { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME); - - $sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length' - . ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME - . ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1'; - - $stmt = $con->prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - -} // CcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylistcontents.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylistcontents.php deleted file mode 100644 index 1b6417a66..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/CcPlaylistcontents.php +++ /dev/null @@ -1,81 +0,0 @@ -fadein; - } - - public function setDbFadein($time) - { - $this->fadein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - Common::setTimeInSub($this, 'FADEIN', $time); - } - - public function getDbFadeout() - { - return $this->fadeout; - } - - public function setDbFadeout($time) - { - $this->fadeout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - Common::setTimeInSub($this, 'FADEOUT', $time); - } - - public function getDbCuein() - { - return $this->cuein; - } - - public function setDbCuein($time) - { - $this->cuein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - Common::setTimeInSub($this, 'CUEIN', $time); - } - - public function getDbCueout() - { - return $this->cueout; - } - - public function setDbCueout($time) - { - $this->cueout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - Common::setTimeInSub($this, 'CUEOUT', $time); - } - - public function getDbCliplength() - { - return $this->cliplength; - } - - public function setDbCliplength($time) - { - $this->cliplength = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - Common::setTimeInSub($this, 'CLIPLENGTH', $time); - } - - - - -} // CcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/Common.php b/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/Common.php deleted file mode 100644 index 3e13c7fa3..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/airtime/om/Common.php +++ /dev/null @@ -1,19 +0,0 @@ -prepare($sql); - $stmt->bindValue(':f1', $time); - $stmt->bindValue(':p1', $row->getDbId()); - $stmt->execute(); - } -} diff --git a/install_minimal/upgrades/airtime-2.0.1/propel/classmap-airtime-conf.php b/install_minimal/upgrades/airtime-2.0.1/propel/classmap-airtime-conf.php deleted file mode 100644 index ef3b99a4b..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/propel/classmap-airtime-conf.php +++ /dev/null @@ -1,144 +0,0 @@ - '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', - 'CcMusicDirsTableMap' => 'airtime/map/CcMusicDirsTableMap.php', - 'CcMusicDirsPeer' => 'airtime/CcMusicDirsPeer.php', - 'CcMusicDirs' => 'airtime/CcMusicDirs.php', - 'CcMusicDirsQuery' => 'airtime/CcMusicDirsQuery.php', - 'BaseCcMusicDirsPeer' => 'airtime/om/BaseCcMusicDirsPeer.php', - 'BaseCcMusicDirs' => 'airtime/om/BaseCcMusicDirs.php', - 'BaseCcMusicDirsQuery' => 'airtime/om/BaseCcMusicDirsQuery.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', - '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', - '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', - 'CcShowRebroadcastTableMap' => 'airtime/map/CcShowRebroadcastTableMap.php', - 'CcShowRebroadcastPeer' => 'airtime/CcShowRebroadcastPeer.php', - 'CcShowRebroadcast' => 'airtime/CcShowRebroadcast.php', - 'CcShowRebroadcastQuery' => 'airtime/CcShowRebroadcastQuery.php', - 'BaseCcShowRebroadcastPeer' => 'airtime/om/BaseCcShowRebroadcastPeer.php', - 'BaseCcShowRebroadcast' => 'airtime/om/BaseCcShowRebroadcast.php', - 'BaseCcShowRebroadcastQuery' => 'airtime/om/BaseCcShowRebroadcastQuery.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', - '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', - 'CcCountryTableMap' => 'airtime/map/CcCountryTableMap.php', - 'CcCountryPeer' => 'airtime/CcCountryPeer.php', - 'CcCountry' => 'airtime/CcCountry.php', - 'CcCountryQuery' => 'airtime/CcCountryQuery.php', - 'BaseCcCountryPeer' => 'airtime/om/BaseCcCountryPeer.php', - 'BaseCcCountry' => 'airtime/om/BaseCcCountry.php', - 'BaseCcCountryQuery' => 'airtime/om/BaseCcCountryQuery.php', - 'CcStreamSettingTableMap' => 'airtime/map/CcStreamSettingTableMap.php', - 'CcStreamSettingPeer' => 'airtime/CcStreamSettingPeer.php', - 'CcStreamSetting' => 'airtime/CcStreamSetting.php', - 'CcStreamSettingQuery' => 'airtime/CcStreamSettingQuery.php', - 'BaseCcStreamSettingPeer' => 'airtime/om/BaseCcStreamSettingPeer.php', - 'BaseCcStreamSetting' => 'airtime/om/BaseCcStreamSetting.php', - 'BaseCcStreamSettingQuery' => 'airtime/om/BaseCcStreamSettingQuery.php', - 'CcLoginAttemptsTableMap' => 'airtime/map/CcLoginAttemptsTableMap.php', - 'CcLoginAttemptsPeer' => 'airtime/CcLoginAttemptsPeer.php', - 'CcLoginAttempts' => 'airtime/CcLoginAttempts.php', - 'CcLoginAttemptsQuery' => 'airtime/CcLoginAttemptsQuery.php', - 'BaseCcLoginAttemptsPeer' => 'airtime/om/BaseCcLoginAttemptsPeer.php', - 'BaseCcLoginAttempts' => 'airtime/om/BaseCcLoginAttempts.php', - 'BaseCcLoginAttemptsQuery' => 'airtime/om/BaseCcLoginAttemptsQuery.php', - 'CcServiceRegisterTableMap' => 'airtime/map/CcServiceRegisterTableMap.php', - 'CcServiceRegisterPeer' => 'airtime/CcServiceRegisterPeer.php', - 'CcServiceRegister' => 'airtime/CcServiceRegister.php', - 'CcServiceRegisterQuery' => 'airtime/CcServiceRegisterQuery.php', - 'BaseCcServiceRegisterPeer' => 'airtime/om/BaseCcServiceRegisterPeer.php', - 'BaseCcServiceRegister' => 'airtime/om/BaseCcServiceRegister.php', - 'BaseCcServiceRegisterQuery' => 'airtime/om/BaseCcServiceRegisterQuery.php', -); \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.0.1/pypo.cfg.201 b/install_minimal/upgrades/airtime-2.0.1/pypo.cfg.201 deleted file mode 100644 index 3280ba540..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/pypo.cfg.201 +++ /dev/null @@ -1,73 +0,0 @@ -############################################ -# pypo - configuration # -############################################ - -# Set the type of client you are using. -# Currently supported types: -# 1) "obp" = Open Broadcast Platform -# 2) "airtime" -# -api_client = "airtime" - -############################################ -# Cache Directories # -# *include* trailing slash !! # -############################################ -cache_dir = '/var/tmp/airtime/pypo/cache/' -file_dir = '/var/tmp/airtime/pypo/files/' -tmp_dir = '/var/tmp/airtime/pypo/tmp/' - -############################################ -# Setup Directories # -# Do *not* include trailing slash !! # -############################################ -cache_base_dir = '/var/tmp/airtime/pypo' -bin_dir = '/usr/lib/airtime/pypo' -log_base_dir = '/var/log/airtime' -pypo_log_dir = '/var/log/airtime/pypo' -liquidsoap_log_dir = '/var/log/airtime/pypo-liquidsoap' - -############################################ -# Liquidsoap settings # -############################################ -ls_host = '127.0.0.1' -ls_port = '1234' - -############################################ -# RabbitMQ settings # -############################################ -rabbitmq_host = 'localhost' -rabbitmq_user = 'guest' -rabbitmq_password = 'guest' -rabbitmq_vhost = '/' - -############################################ -# pypo preferences # -############################################ -prepare_ahead = 24 #in hours -cache_for = 24 #how long to hold the cache, in hours - -# Poll interval in seconds. -# -# This will rarely need to be changed because any schedule changes are -# automatically sent to pypo immediately. -# -# This is how often the poll script downloads new schedules and files from the -# server in the event that no changes are made to the schedule. -# -poll_interval = 3600 # in seconds. - - -# Push interval in seconds. -# -# This is how often the push script checks whether it has something new to -# push to liquidsoap. -# -# It's hard to imagine a situation where this should be more than 1 second. -# -push_interval = 1 # in seconds - -# 'pre' or 'otf'. 'pre' cues while playlist preparation -# while 'otf' (on the fly) cues while loading into ls -# (needs the post_processor patch) -cue_style = 'pre' diff --git a/install_minimal/upgrades/airtime-2.0.1/recorder.cfg.201 b/install_minimal/upgrades/airtime-2.0.1/recorder.cfg.201 deleted file mode 100644 index 9ac92ce44..000000000 --- a/install_minimal/upgrades/airtime-2.0.1/recorder.cfg.201 +++ /dev/null @@ -1,30 +0,0 @@ -api_client = "airtime" - -# where the binary files live -bin_dir = '/usr/lib/airtime/show-recorder' - -# base path to store recordered shows at -base_recorded_files = '/var/tmp/airtime/show-recorder/' - -# where the logging files live -log_dir = '/var/log/airtime/show-recorder' - -############################################ -# RabbitMQ settings # -############################################ -rabbitmq_host = 'localhost' -rabbitmq_user = 'guest' -rabbitmq_password = 'guest' -rabbitmq_vhost = '/' - -############################################ -# Recorded Audio settings # -############################################ -record_bitrate = 256 -record_samplerate = 44100 -record_channels = 2 -record_sample_size = 16 -record_timeout = 3600 - -#can be either ogg|mp3, mp3 recording requires installation of the package "lame" -record_file_type = 'ogg' \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.0.2/UpgradeCommon.php b/install_minimal/upgrades/airtime-2.0.2/UpgradeCommon.php deleted file mode 100644 index 052765a6f..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/UpgradeCommon.php +++ /dev/null @@ -1,250 +0,0 @@ -fetchColumn(); - - date_default_timezone_set($timezone); - } - - public static function connectToDatabase($p_exitOnError = true) - { - try { - $con = Propel::getConnection(); - } catch (Exception $e) { - echo $e->getMessage().PHP_EOL; - echo "Database connection problem.".PHP_EOL; - echo "Check if database exists with corresponding permissions.".PHP_EOL; - if ($p_exitOnError) { - exit(1); - } - return false; - } - return true; - } - - - public static function DbTableExists($p_name) - { - $con = Propel::getConnection(); - try { - $sql = "SELECT * FROM ".$p_name." LIMIT 1"; - $con->query($sql); - } catch (PDOException $e){ - return false; - } - return true; - } - - private static function GetAirtimeSrcDir() - { - return __DIR__."/../../../airtime_mvc"; - } - - public static function MigrateTablesToVersion($dir, $version) - { - echo "Upgrading database, may take several minutes, please wait".PHP_EOL; - - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/../../DoctrineMigrations/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction migrations:migrate $version"; - system($command); - } - - public static function BypassMigrations($dir, $version) - { - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/../../DoctrineMigrations/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction --add migrations:version $version"; - system($command); - } - - public static function upgradeConfigFiles(){ - - $configFiles = array(UpgradeCommon::CONF_FILE_AIRTIME, - UpgradeCommon::CONF_FILE_PYPO, - UpgradeCommon::CONF_FILE_LIQUIDSOAP, - UpgradeCommon::CONF_FILE_MEDIAMONITOR, - UpgradeCommon::CONF_FILE_API_CLIENT); - - // Backup the config files - $suffix = date("Ymdhis")."-".UpgradeCommon::VERSION_NUMBER; - foreach ($configFiles as $conf) { - // do not back up monit cfg - if (file_exists($conf)) { - echo "Backing up $conf to $conf$suffix.bak".PHP_EOL; - //copy($conf, $conf.$suffix.".bak"); - exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes - } - } - - self::CreateIniFiles(UpgradeCommon::CONF_BACKUP_SUFFIX); - self::MergeConfigFiles($configFiles, $suffix); - } - - /** - * This function creates the /etc/airtime configuration folder - * and copies the default config files to it. - */ - public static function CreateIniFiles($suffix) - { - if (!file_exists("/etc/airtime/")){ - if (!mkdir("/etc/airtime/", 0755, true)){ - echo "Could not create /etc/airtime/ directory. Exiting."; - exit(1); - } - } - - if (!copy(__DIR__."/airtime.conf.$suffix", self::CONF_FILE_AIRTIME)){ - echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/pypo.cfg.$suffix", self::CONF_FILE_PYPO)){ - echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/media-monitor.cfg.$suffix", self::CONF_FILE_MEDIAMONITOR)){ - echo "Could not copy meadia-monitor.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/api_client.cfg.$suffix", self::CONF_FILE_API_CLIENT)){ - echo "Could not copy api_client.cfg to /etc/monit/conf.d/. Exiting."; - exit(1); - } - } - - private static function MergeConfigFiles($configFiles, $suffix) { - foreach ($configFiles as $conf) { - // we want to use new liquidsoap.cfg so don't merge - // also for monit - if( $conf == self::CONF_FILE_LIQUIDSOAP){ - continue; - } - if (file_exists("$conf$suffix.bak")) { - - if($conf === self::CONF_FILE_AIRTIME) { - // Parse with sections - $newSettings = parse_ini_file($conf, true); - $oldSettings = parse_ini_file("$conf$suffix.bak", true); - } - else { - $newSettings = self::ReadPythonConfig($conf); - $oldSettings = self::ReadPythonConfig("$conf$suffix.bak"); - } - - $settings = array_keys($newSettings); - - foreach($settings as $section) { - if(isset($oldSettings[$section])) { - if(is_array($oldSettings[$section])) { - $sectionKeys = array_keys($newSettings[$section]); - foreach($sectionKeys as $sectionKey) { - // skip airtim_dir as we want to use new value - if($sectionKey != "airtime_dir"){ - if(isset($oldSettings[$section][$sectionKey])) { - self::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]); - } - } - } - } - else { - self::UpdateIniValue($conf, $section, $oldSettings[$section]); - } - } - } - } - } - } - - private static function ReadPythonConfig($p_filename) - { - $values = array(); - - $fh = fopen($p_filename, 'r'); - - while(!feof($fh)){ - $line = fgets($fh); - if(substr(trim($line), 0, 1) == '#' || trim($line) == ""){ - continue; - }else{ - $info = explode('=', $line, 2); - $values[trim($info[0])] = trim($info[1]); - } - } - - return $values; - } - - /** - * This function updates an INI style config file. - * - * A property and the value the property should be changed to are - * supplied. If the property is not found, then no changes are made. - * - * @param string $p_filename - * The path the to the file. - * @param string $p_property - * The property to look for in order to change its value. - * @param string $p_value - * The value the property should be changed to. - * - */ - private static function UpdateIniValue($p_filename, $p_property, $p_value) - { - $lines = file($p_filename); - $n=count($lines); - foreach ($lines as &$line) { - if ($line[0] != "#"){ - $key_value = explode("=", $line); - $key = trim($key_value[0]); - - if ($key == $p_property){ - $line = "$p_property = $p_value".PHP_EOL; - } - } - } - - $fp=fopen($p_filename, 'w'); - for($i=0; $i<$n; $i++){ - fwrite($fp, $lines[$i]); - } - fclose($fp); - } - - public static function queryDb($p_sql){ - $con = Propel::getConnection(); - - try { - $result = $con->query($p_sql); - } catch (Exception $e) { - echo "Error executing $p_sql. Exiting."; - exit(1); - } - - return $result; - } -} diff --git a/install_minimal/upgrades/airtime-2.0.2/airtime-monit.cfg.202 b/install_minimal/upgrades/airtime-2.0.2/airtime-monit.cfg.202 deleted file mode 100644 index ba4f0878d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/airtime-monit.cfg.202 +++ /dev/null @@ -1,24 +0,0 @@ - set daemon 10 # Poll at 10 second intervals - #set logfile syslog facility log_daemon - set logfile /var/log/monit.log - - set httpd port 2812 and use address 127.0.0.1 - allow localhost - allow admin:monit - - check process airtime-playout - with pidfile "/var/run/airtime-playout.pid" - start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds - stop program = "/etc/init.d/airtime-playout stop" - check process airtime-liquidsoap - with pidfile "/var/run/airtime-liquidsoap.pid" - start program = "/etc/init.d/airtime-playout monit-restart" with timeout 5 seconds - stop program = "/etc/init.d/airtime-playout stop" - check process airtime-media-monitor - with pidfile "/var/run/airtime-media-monitor.pid" - start program = "/etc/init.d/airtime-media-monitor start" with timeout 10 seconds - stop program = "/etc/init.d/airtime-media-monitor stop" - check process airtime-show-recorder - with pidfile "/var/run/airtime-show-recorder.pid" - start program = "/etc/init.d/airtime-show-recorder start" with timeout 10 seconds - stop program = "/etc/init.d/airtime-show-recorder stop" diff --git a/install_minimal/upgrades/airtime-2.0.2/airtime-upgrade.php b/install_minimal/upgrades/airtime-2.0.2/airtime-upgrade.php deleted file mode 100644 index 43a33a660..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/airtime-upgrade.php +++ /dev/null @@ -1,81 +0,0 @@ -.log" -#log_level = 3 - -########################################### -# Icecast Stream settings # -########################################### -s1_host = "127.0.0.1" -s2_host = "127.0.0.1" -s3_host = "127.0.0.1" -s1_port = 8000 -s2_port = 8000 -s3_port = 8000 -s1_user = "" -s2_user = "" -s3_user = "" -s1_pass = "hackme" -s2_pass = "hackme" -s3_pass = "hackme" - -# Icecast mountpoint names -s1_mount = "airtime_128.ogg" -s2_mount = "airtime_128.ogg" -s3_mount = "airtime_160.mp3" - -# Webstream metadata settings -s1_url = "http://airtime.sourcefabric.org" -s2_url = "http://airtime.sourcefabric.org" -s3_url = "http://airtime.sourcefabric.org" -s1_description = "Airtime Radio! stream1" -s2_description = "Airtime Radio! stream2" -s3_description = "Airtime Radio! stream3" -s1_genre = "genre" -s2_genre = "genre" -s3_genre = "genre" - -# Audio stream metadata for vorbis/ogg is disabled by default -# due to a number of client media players that disconnect -# when the metadata changes to a new track. Some versions of -# mplayer and VLC have this problem. Enable this option at your -# own risk! -icecast_vorbis_metadata = false diff --git a/install_minimal/upgrades/airtime-2.0.2/media-monitor.cfg.202 b/install_minimal/upgrades/airtime-2.0.2/media-monitor.cfg.202 deleted file mode 100644 index 44819833b..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/media-monitor.cfg.202 +++ /dev/null @@ -1,22 +0,0 @@ -api_client = "airtime" - -# where the binary files live -bin_dir = '/usr/lib/airtime/media-monitor' - -# where the logging files live -log_dir = '/var/log/airtime/media-monitor' - - -############################################ -# RabbitMQ settings # -############################################ -rabbitmq_host = 'localhost' -rabbitmq_user = 'guest' -rabbitmq_password = 'guest' -rabbitmq_vhost = '/' - -############################################ -# Media-Monitor preferences # -############################################ -check_filesystem_events = 5 #how long to queue up events performed on the files themselves. -check_airtime_events = 30 #how long to queue metadata input from airtime. diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime-conf.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime-conf.php deleted file mode 100644 index a25701479..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime-conf.php +++ /dev/null @@ -1,28 +0,0 @@ - - array ( - 'airtime' => - array ( - 'adapter' => 'pgsql', - 'connection' => - array ( - 'dsn' => "pgsql:host=$dbhost;port=5432;dbname=$dbname;user=$dbuser;password=$dbpass", - ), - ), - 'default' => 'airtime', - ), - 'generator_version' => '1.5.2', -); -$conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php'); -return $conf; diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccess.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccess.php deleted file mode 100644 index 2b3d4443d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcAccess.php +++ /dev/null @@ -1,18 +0,0 @@ -length; - } - - public function setDbLength($time) - { - $this->length = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; - return Common::setTimeInSub($this, 'LENGTH', $time); - } - - -} // CcFiles diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFilesPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFilesPeer.php deleted file mode 100644 index 0e2fbbe86..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcFilesPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - public function computeLength() - { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME); - - $sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length' - . ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME - . ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1'; - - $stmt = $con->prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - -} // CcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistPeer.php deleted file mode 100644 index 4f7c82791..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -fadein; - } - - public function setDbFadein($time) - { - $this->fadein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - Common::setTimeInSub($this, 'FADEIN', $time); - } - - public function getDbFadeout() - { - return $this->fadeout; - } - - public function setDbFadeout($time) - { - $this->fadeout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - Common::setTimeInSub($this, 'FADEOUT', $time); - } - - public function getDbCuein() - { - return $this->cuein; - } - - public function setDbCuein($time) - { - $this->cuein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - Common::setTimeInSub($this, 'CUEIN', $time); - } - - public function getDbCueout() - { - return $this->cueout; - } - - public function setDbCueout($time) - { - $this->cueout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - Common::setTimeInSub($this, 'CUEOUT', $time); - } - - public function getDbCliplength() - { - return $this->cliplength; - } - - public function setDbCliplength($time) - { - $this->cliplength = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - Common::setTimeInSub($this, 'CLIPLENGTH', $time); - } - - - - -} // CcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontentsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontentsPeer.php deleted file mode 100644 index 00210575b..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/CcPlaylistcontentsPeer.php +++ /dev/null @@ -1,18 +0,0 @@ -prepare($sql); - $stmt->bindValue(':f1', $time); - $stmt->bindValue(':p1', $row->getDbId()); - $stmt->execute(); - } -} diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcAccessTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcAccessTableMap.php deleted file mode 100644 index 5b0584f3f..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcAccessTableMap.php +++ /dev/null @@ -1,61 +0,0 @@ -setName('cc_access'); - $this->setPhpName('CcAccess'); - $this->setClassname('CcAccess'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_access_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null); - $this->addColumn('TOKEN', 'Token', 'BIGINT', false, null, null); - $this->addColumn('CHSUM', 'Chsum', 'CHAR', true, 32, ''); - $this->addColumn('EXT', 'Ext', 'VARCHAR', true, 128, ''); - $this->addColumn('TYPE', 'Type', 'VARCHAR', true, 20, ''); - $this->addColumn('PARENT', 'Parent', 'BIGINT', false, null, null); - $this->addForeignKey('OWNER', 'Owner', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('owner' => 'id', ), null, null); - } // buildRelations() - -} // CcAccessTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcBackupTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcBackupTableMap.php deleted file mode 100644 index 35ea58159..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcBackupTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_backup'); - $this->setPhpName('CcBackup'); - $this->setClassname('CcBackup'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('TOKEN', 'Token', 'VARCHAR', true, 64, null); - $this->addColumn('SESSIONID', 'Sessionid', 'VARCHAR', true, 64, null); - $this->addColumn('STATUS', 'Status', 'VARCHAR', true, 32, null); - $this->addColumn('FROMTIME', 'Fromtime', 'TIMESTAMP', true, null, null); - $this->addColumn('TOTIME', 'Totime', 'TIMESTAMP', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcBackupTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcCountryTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcCountryTableMap.php deleted file mode 100644 index b839d0359..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcCountryTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_country'); - $this->setPhpName('CcCountry'); - $this->setClassname('CcCountry'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('ISOCODE', 'DbIsoCode', 'CHAR', true, 3, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcCountryTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcFilesTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcFilesTableMap.php deleted file mode 100644 index 38d2e3955..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcFilesTableMap.php +++ /dev/null @@ -1,115 +0,0 @@ -setName('cc_files'); - $this->setPhpName('CcFiles'); - $this->setClassname('CcFiles'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_files_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('GUNID', 'DbGunid', 'CHAR', true, 32, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('MIME', 'DbMime', 'VARCHAR', true, 255, ''); - $this->addColumn('FTYPE', 'DbFtype', 'VARCHAR', true, 128, ''); - $this->addForeignKey('DIRECTORY', 'DbDirectory', 'INTEGER', 'cc_music_dirs', 'ID', false, null, null); - $this->addColumn('FILEPATH', 'DbFilepath', 'LONGVARCHAR', false, null, ''); - $this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty'); - $this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0); - $this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null); - $this->addColumn('MD5', 'DbMd5', 'CHAR', false, 32, null); - $this->addColumn('TRACK_TITLE', 'DbTrackTitle', 'VARCHAR', false, 512, null); - $this->addColumn('ARTIST_NAME', 'DbArtistName', 'VARCHAR', false, 512, null); - $this->addColumn('BIT_RATE', 'DbBitRate', 'VARCHAR', false, 32, null); - $this->addColumn('SAMPLE_RATE', 'DbSampleRate', 'VARCHAR', false, 32, null); - $this->addColumn('FORMAT', 'DbFormat', 'VARCHAR', false, 128, null); - $this->addColumn('LENGTH', 'DbLength', 'TIME', false, null, null); - $this->addColumn('ALBUM_TITLE', 'DbAlbumTitle', 'VARCHAR', false, 512, null); - $this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 64, null); - $this->addColumn('COMMENTS', 'DbComments', 'LONGVARCHAR', false, null, null); - $this->addColumn('YEAR', 'DbYear', 'VARCHAR', false, 16, null); - $this->addColumn('TRACK_NUMBER', 'DbTrackNumber', 'INTEGER', false, null, null); - $this->addColumn('CHANNELS', 'DbChannels', 'INTEGER', false, null, null); - $this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 1024, null); - $this->addColumn('BPM', 'DbBpm', 'VARCHAR', false, 8, null); - $this->addColumn('RATING', 'DbRating', 'VARCHAR', false, 8, null); - $this->addColumn('ENCODED_BY', 'DbEncodedBy', 'VARCHAR', false, 255, null); - $this->addColumn('DISC_NUMBER', 'DbDiscNumber', 'VARCHAR', false, 8, null); - $this->addColumn('MOOD', 'DbMood', 'VARCHAR', false, 64, null); - $this->addColumn('LABEL', 'DbLabel', 'VARCHAR', false, 512, null); - $this->addColumn('COMPOSER', 'DbComposer', 'VARCHAR', false, 512, null); - $this->addColumn('ENCODER', 'DbEncoder', 'VARCHAR', false, 64, null); - $this->addColumn('CHECKSUM', 'DbChecksum', 'VARCHAR', false, 256, null); - $this->addColumn('LYRICS', 'DbLyrics', 'LONGVARCHAR', false, null, null); - $this->addColumn('ORCHESTRA', 'DbOrchestra', 'VARCHAR', false, 512, null); - $this->addColumn('CONDUCTOR', 'DbConductor', 'VARCHAR', false, 512, null); - $this->addColumn('LYRICIST', 'DbLyricist', 'VARCHAR', false, 512, null); - $this->addColumn('ORIGINAL_LYRICIST', 'DbOriginalLyricist', 'VARCHAR', false, 512, null); - $this->addColumn('RADIO_STATION_NAME', 'DbRadioStationName', 'VARCHAR', false, 512, null); - $this->addColumn('INFO_URL', 'DbInfoUrl', 'VARCHAR', false, 512, null); - $this->addColumn('ARTIST_URL', 'DbArtistUrl', 'VARCHAR', false, 512, null); - $this->addColumn('AUDIO_SOURCE_URL', 'DbAudioSourceUrl', 'VARCHAR', false, 512, null); - $this->addColumn('RADIO_STATION_URL', 'DbRadioStationUrl', 'VARCHAR', false, 512, null); - $this->addColumn('BUY_THIS_URL', 'DbBuyThisUrl', 'VARCHAR', false, 512, null); - $this->addColumn('ISRC_NUMBER', 'DbIsrcNumber', 'VARCHAR', false, 512, null); - $this->addColumn('CATALOG_NUMBER', 'DbCatalogNumber', 'VARCHAR', false, 512, null); - $this->addColumn('ORIGINAL_ARTIST', 'DbOriginalArtist', 'VARCHAR', false, 512, null); - $this->addColumn('COPYRIGHT', 'DbCopyright', 'VARCHAR', false, 512, null); - $this->addColumn('REPORT_DATETIME', 'DbReportDatetime', 'VARCHAR', false, 32, null); - $this->addColumn('REPORT_LOCATION', 'DbReportLocation', 'VARCHAR', false, 512, null); - $this->addColumn('REPORT_ORGANIZATION', 'DbReportOrganization', 'VARCHAR', false, 512, null); - $this->addColumn('SUBJECT', 'DbSubject', 'VARCHAR', false, 512, null); - $this->addColumn('CONTRIBUTOR', 'DbContributor', 'VARCHAR', false, 512, null); - $this->addColumn('LANGUAGE', 'DbLanguage', 'VARCHAR', false, 512, null); - $this->addColumn('SOUNDCLOUD_ID', 'DbSoundcloudId', 'INTEGER', false, null, null); - $this->addColumn('SOUNDCLOUD_ERROR_CODE', 'DbSoundcloudErrorCode', 'INTEGER', false, null, null); - $this->addColumn('SOUNDCLOUD_ERROR_MSG', 'DbSoundcloudErrorMsg', 'VARCHAR', false, 512, null); - $this->addColumn('SOUNDCLOUD_LINK_TO_FILE', 'DbSoundcloudLinkToFile', 'VARCHAR', false, 4096, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null); - $this->addRelation('CcMusicDirs', 'CcMusicDirs', RelationMap::MANY_TO_ONE, array('directory' => 'id', ), 'CASCADE', null); - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'file_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcFilesTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcLoginAttemptsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcLoginAttemptsTableMap.php deleted file mode 100644 index 32ce73743..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcLoginAttemptsTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_login_attempts'); - $this->setPhpName('CcLoginAttempts'); - $this->setClassname('CcLoginAttempts'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('IP', 'DbIP', 'VARCHAR', true, 32, null); - $this->addColumn('ATTEMPTS', 'DbAttempts', 'INTEGER', false, null, 0); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcLoginAttemptsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcMusicDirsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcMusicDirsTableMap.php deleted file mode 100644 index 022ef658c..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcMusicDirsTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_music_dirs'); - $this->setPhpName('CcMusicDirs'); - $this->setClassname('CcMusicDirs'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_music_dirs_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('DIRECTORY', 'Directory', 'LONGVARCHAR', false, null, null); - $this->addColumn('TYPE', 'Type', 'VARCHAR', false, 255, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'directory', ), 'CASCADE', null); - } // buildRelations() - -} // CcMusicDirsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPermsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPermsTableMap.php deleted file mode 100644 index 481d17c96..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPermsTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_perms'); - $this->setPhpName('CcPerms'); - $this->setClassname('CcPerms'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('PERMID', 'Permid', 'INTEGER', true, null, null); - $this->addForeignKey('SUBJ', 'Subj', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('ACTION', 'Action', 'VARCHAR', false, 20, null); - $this->addColumn('OBJ', 'Obj', 'INTEGER', false, null, null); - $this->addColumn('TYPE', 'Type', 'CHAR', false, 1, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subj' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPermsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistTableMap.php deleted file mode 100644 index e4ad1bbd5..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistTableMap.php +++ /dev/null @@ -1,61 +0,0 @@ -setName('cc_playlist'); - $this->setPhpName('CcPlaylist'); - $this->setClassname('CcPlaylist'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_playlist_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('STATE', 'DbState', 'VARCHAR', true, 128, 'empty'); - $this->addColumn('CURRENTLYACCESSING', 'DbCurrentlyaccessing', 'INTEGER', true, null, 0); - $this->addForeignKey('EDITEDBY', 'DbEditedby', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('MTIME', 'DbMtime', 'TIMESTAMP', false, 6, null); - $this->addColumn('CREATOR', 'DbCreator', 'VARCHAR', false, 32, null); - $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('editedby' => 'id', ), null, null); - $this->addRelation('CcPlaylistcontents', 'CcPlaylistcontents', RelationMap::ONE_TO_MANY, array('id' => 'playlist_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPlaylistTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistcontentsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistcontentsTableMap.php deleted file mode 100644 index b00f39ade..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPlaylistcontentsTableMap.php +++ /dev/null @@ -1,62 +0,0 @@ -setName('cc_playlistcontents'); - $this->setPhpName('CcPlaylistcontents'); - $this->setClassname('CcPlaylistcontents'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_playlistcontents_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', 'cc_playlist', 'ID', false, null, null); - $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); - $this->addColumn('CLIPLENGTH', 'DbCliplength', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUEIN', 'DbCuein', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUEOUT', 'DbCueout', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADEIN', 'DbFadein', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADEOUT', 'DbFadeout', 'TIME', false, null, '00:00:00'); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::MANY_TO_ONE, array('playlist_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPlaylistcontentsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPrefTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPrefTableMap.php deleted file mode 100644 index 1d22a122d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcPrefTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_pref'); - $this->setPhpName('CcPref'); - $this->setClassname('CcPref'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_pref_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addForeignKey('SUBJID', 'Subjid', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('KEYSTR', 'Keystr', 'VARCHAR', false, 255, null); - $this->addColumn('VALSTR', 'Valstr', 'LONGVARCHAR', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjid' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcPrefTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcScheduleTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcScheduleTableMap.php deleted file mode 100644 index 12fa8d712..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcScheduleTableMap.php +++ /dev/null @@ -1,80 +0,0 @@ -setName('cc_schedule'); - $this->setPhpName('CcSchedule'); - $this->setClassname('CcSchedule'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_schedule_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('PLAYLIST_ID', 'DbPlaylistId', 'INTEGER', false, null, null); - $this->addColumn('STARTS', 'DbStarts', 'TIMESTAMP', true, null, null); - $this->addColumn('ENDS', 'DbEnds', 'TIMESTAMP', true, null, null); - $this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', false, null, null); - $this->addForeignKey('FILE_ID', 'DbFileId', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('CLIP_LENGTH', 'DbClipLength', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00'); - $this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00'); - $this->addColumn('CUE_IN', 'DbCueIn', '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('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false); - $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'aggregate_column_relation' => array('foreign_table' => 'cc_show_instances', 'update_method' => 'updateDbTimeFilled', ), - ); - } // getBehaviors() - -} // CcScheduleTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcServiceRegisterTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcServiceRegisterTableMap.php deleted file mode 100644 index f4eae5e60..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcServiceRegisterTableMap.php +++ /dev/null @@ -1,52 +0,0 @@ -setName('cc_service_register'); - $this->setPhpName('CcServiceRegister'); - $this->setClassname('CcServiceRegister'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('NAME', 'DbName', 'VARCHAR', true, 32, null); - $this->addColumn('IP', 'DbIp', 'VARCHAR', true, 18, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcServiceRegisterTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSessTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSessTableMap.php deleted file mode 100644 index 66605b4eb..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSessTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_sess'); - $this->setPhpName('CcSess'); - $this->setClassname('CcSess'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('SESSID', 'Sessid', 'CHAR', true, 32, null); - $this->addForeignKey('USERID', 'Userid', 'INTEGER', 'cc_subjs', 'ID', false, null, null); - $this->addColumn('LOGIN', 'Login', 'VARCHAR', false, 255, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('userid' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcSessTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowDaysTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowDaysTableMap.php deleted file mode 100644 index 7d6b8a10e..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowDaysTableMap.php +++ /dev/null @@ -1,63 +0,0 @@ -setName('cc_show_days'); - $this->setPhpName('CcShowDays'); - $this->setClassname('CcShowDays'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_days_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null); - $this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null); - $this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null); - $this->addColumn('TIMEZONE', 'DbTimezone', 'VARCHAR', true, 255, null); - $this->addColumn('DURATION', 'DbDuration', 'VARCHAR', true, 255, null); - $this->addColumn('DAY', 'DbDay', 'TINYINT', false, 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->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0); - // 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); - } // buildRelations() - -} // CcShowDaysTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowHostsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowHostsTableMap.php deleted file mode 100644 index c76efdbd3..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowHostsTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_hosts'); - $this->setPhpName('CcShowHosts'); - $this->setClassname('CcShowHosts'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_hosts_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('SHOW_ID', 'DbShow', 'INTEGER', 'cc_show', 'ID', true, null, null); - $this->addForeignKey('SUBJS_ID', 'DbHost', 'INTEGER', 'cc_subjs', '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('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subjs_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowHostsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowInstancesTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowInstancesTableMap.php deleted file mode 100644 index 75e7da2c7..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowInstancesTableMap.php +++ /dev/null @@ -1,79 +0,0 @@ -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); - $this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0); - $this->addColumn('REBROADCAST', 'DbRebroadcast', 'TINYINT', false, null, 0); - $this->addForeignKey('INSTANCE_ID', 'DbOriginalShow', 'INTEGER', 'cc_show_instances', 'ID', false, null, null); - $this->addForeignKey('FILE_ID', 'DbRecordedFile', 'INTEGER', 'cc_files', 'ID', false, null, null); - $this->addColumn('TIME_FILLED', 'DbTimeFilled', 'TIME', false, null, null); - $this->addColumn('MODIFIED_INSTANCE', 'DbModifiedInstance', 'BOOLEAN', true, null, false); - // 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('CcShowInstancesRelatedByDbOriginalShow', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'CASCADE', null); - $this->addRelation('CcShowInstancesRelatedByDbId', 'CcShowInstances', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); - $this->addRelation('CcSchedule', 'CcSchedule', RelationMap::ONE_TO_MANY, array('id' => 'instance_id', ), 'CASCADE', null); - } // buildRelations() - - /** - * - * Gets the list of behaviors registered for this table - * - * @return array Associative array (name => parameters) of behaviors - */ - public function getBehaviors() - { - return array( - 'aggregate_column' => array('name' => 'time_filled', 'expression' => 'SUM(clip_length)', 'foreign_table' => 'cc_schedule', ), - ); - } // getBehaviors() - -} // CcShowInstancesTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowRebroadcastTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowRebroadcastTableMap.php deleted file mode 100644 index 60a9ba980..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowRebroadcastTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_rebroadcast'); - $this->setPhpName('CcShowRebroadcast'); - $this->setClassname('CcShowRebroadcast'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_rebroadcast_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('DAY_OFFSET', 'DbDayOffset', 'VARCHAR', true, 255, null); - $this->addColumn('START_TIME', 'DbStartTime', 'TIME', 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); - } // buildRelations() - -} // CcShowRebroadcastTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowScheduleTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowScheduleTableMap.php deleted file mode 100644 index 96528559c..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowScheduleTableMap.php +++ /dev/null @@ -1,56 +0,0 @@ -setName('cc_show_schedule'); - $this->setPhpName('CcShowSchedule'); - $this->setClassname('CcShowSchedule'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_schedule_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null); - $this->addColumn('POSITION', 'DbPosition', 'INTEGER', false, null, null); - $this->addColumn('GROUP_ID', 'DbGroupId', 'INTEGER', true, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcShowInstances', 'CcShowInstances', RelationMap::MANY_TO_ONE, array('instance_id' => 'id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowScheduleTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowTableMap.php deleted file mode 100644 index b558b6e93..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcShowTableMap.php +++ /dev/null @@ -1,62 +0,0 @@ -setName('cc_show'); - $this->setPhpName('CcShow'); - $this->setClassname('CcShow'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_show_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('NAME', 'DbName', 'VARCHAR', true, 255, ''); - $this->addColumn('URL', 'DbUrl', 'VARCHAR', false, 255, ''); - $this->addColumn('GENRE', 'DbGenre', 'VARCHAR', false, 255, ''); - $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); - $this->addColumn('COLOR', 'DbColor', 'VARCHAR', false, 6, null); - $this->addColumn('BACKGROUND_COLOR', 'DbBackgroundColor', 'VARCHAR', false, 6, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - 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('CcShowRebroadcast', 'CcShowRebroadcast', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); - $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'show_id', ), 'CASCADE', null); - } // buildRelations() - -} // CcShowTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSmembTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSmembTableMap.php deleted file mode 100644 index 236cdd016..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSmembTableMap.php +++ /dev/null @@ -1,55 +0,0 @@ -setName('cc_smemb'); - $this->setPhpName('CcSmemb'); - $this->setClassname('CcSmemb'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('UID', 'Uid', 'INTEGER', true, null, 0); - $this->addColumn('GID', 'Gid', 'INTEGER', true, null, 0); - $this->addColumn('LEVEL', 'Level', 'INTEGER', true, null, 0); - $this->addColumn('MID', 'Mid', 'INTEGER', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcSmembTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcStreamSettingTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcStreamSettingTableMap.php deleted file mode 100644 index d401ce096..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcStreamSettingTableMap.php +++ /dev/null @@ -1,53 +0,0 @@ -setName('cc_stream_setting'); - $this->setPhpName('CcStreamSetting'); - $this->setClassname('CcStreamSetting'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(false); - // columns - $this->addPrimaryKey('KEYNAME', 'DbKeyName', 'VARCHAR', true, 64, null); - $this->addColumn('VALUE', 'DbValue', 'VARCHAR', false, 255, null); - $this->addColumn('TYPE', 'DbType', 'VARCHAR', true, 16, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcStreamSettingTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSubjsTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSubjsTableMap.php deleted file mode 100644 index 49e883968..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcSubjsTableMap.php +++ /dev/null @@ -1,70 +0,0 @@ -setName('cc_subjs'); - $this->setPhpName('CcSubjs'); - $this->setClassname('CcSubjs'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_subjs_id_seq'); - // columns - $this->addPrimaryKey('ID', 'DbId', 'INTEGER', true, null, null); - $this->addColumn('LOGIN', 'DbLogin', 'VARCHAR', true, 255, ''); - $this->addColumn('PASS', 'DbPass', 'VARCHAR', true, 255, ''); - $this->addColumn('TYPE', 'DbType', 'CHAR', true, 1, 'U'); - $this->addColumn('FIRST_NAME', 'DbFirstName', 'VARCHAR', true, 255, ''); - $this->addColumn('LAST_NAME', 'DbLastName', 'VARCHAR', true, 255, ''); - $this->addColumn('LASTLOGIN', 'DbLastlogin', 'TIMESTAMP', false, null, null); - $this->addColumn('LASTFAIL', 'DbLastfail', 'TIMESTAMP', false, null, null); - $this->addColumn('SKYPE_CONTACT', 'DbSkypeContact', 'VARCHAR', false, 255, null); - $this->addColumn('JABBER_CONTACT', 'DbJabberContact', 'VARCHAR', false, 255, null); - $this->addColumn('EMAIL', 'DbEmail', 'VARCHAR', false, 255, null); - $this->addColumn('LOGIN_ATTEMPTS', 'DbLoginAttempts', 'INTEGER', false, null, 0); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - $this->addRelation('CcAccess', 'CcAccess', RelationMap::ONE_TO_MANY, array('id' => 'owner', ), null, null); - $this->addRelation('CcFiles', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null); - $this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null); - $this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null); - $this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null); - $this->addRelation('CcPref', 'CcPref', RelationMap::ONE_TO_MANY, array('id' => 'subjid', ), 'CASCADE', null); - $this->addRelation('CcSess', 'CcSess', RelationMap::ONE_TO_MANY, array('id' => 'userid', ), 'CASCADE', null); - } // buildRelations() - -} // CcSubjsTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcTransTableMap.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcTransTableMap.php deleted file mode 100644 index 4c5d35e1a..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/map/CcTransTableMap.php +++ /dev/null @@ -1,75 +0,0 @@ -setName('cc_trans'); - $this->setPhpName('CcTrans'); - $this->setClassname('CcTrans'); - $this->setPackage('airtime'); - $this->setUseIdGenerator(true); - $this->setPrimaryKeyMethodInfo('cc_trans_id_seq'); - // columns - $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); - $this->addColumn('TRTOK', 'Trtok', 'CHAR', true, 16, null); - $this->addColumn('DIRECTION', 'Direction', 'VARCHAR', true, 128, null); - $this->addColumn('STATE', 'State', 'VARCHAR', true, 128, null); - $this->addColumn('TRTYPE', 'Trtype', 'VARCHAR', true, 128, null); - $this->addColumn('LOCK', 'Lock', 'CHAR', true, 1, 'N'); - $this->addColumn('TARGET', 'Target', 'VARCHAR', false, 255, null); - $this->addColumn('RTRTOK', 'Rtrtok', 'CHAR', false, 16, null); - $this->addColumn('MDTRTOK', 'Mdtrtok', 'CHAR', false, 16, null); - $this->addColumn('GUNID', 'Gunid', 'CHAR', false, 32, null); - $this->addColumn('PDTOKEN', 'Pdtoken', 'BIGINT', false, null, null); - $this->addColumn('URL', 'Url', 'VARCHAR', false, 255, null); - $this->addColumn('LOCALFILE', 'Localfile', 'VARCHAR', false, 255, null); - $this->addColumn('FNAME', 'Fname', 'VARCHAR', false, 255, null); - $this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null); - $this->addColumn('EXPECTEDSUM', 'Expectedsum', 'CHAR', false, 32, null); - $this->addColumn('REALSUM', 'Realsum', 'CHAR', false, 32, null); - $this->addColumn('EXPECTEDSIZE', 'Expectedsize', 'INTEGER', false, null, null); - $this->addColumn('REALSIZE', 'Realsize', 'INTEGER', false, null, null); - $this->addColumn('UID', 'Uid', 'INTEGER', false, null, null); - $this->addColumn('ERRMSG', 'Errmsg', 'VARCHAR', false, 255, null); - $this->addColumn('JOBPID', 'Jobpid', 'INTEGER', false, null, null); - $this->addColumn('START', 'Start', 'TIMESTAMP', false, null, null); - $this->addColumn('TS', 'Ts', 'TIMESTAMP', false, null, null); - // validators - } // initialize() - - /** - * Build the RelationMap objects for this table relationships - */ - public function buildRelations() - { - } // buildRelations() - -} // CcTransTableMap diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccess.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccess.php deleted file mode 100644 index 8f2de9dca..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccess.php +++ /dev/null @@ -1,1236 +0,0 @@ -chsum = ''; - $this->ext = ''; - $this->type = ''; - } - - /** - * Initializes internal state of BaseCcAccess object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getGunid() - { - return $this->gunid; - } - - /** - * Get the [token] column value. - * - * @return string - */ - public function getToken() - { - return $this->token; - } - - /** - * Get the [chsum] column value. - * - * @return string - */ - public function getChsum() - { - return $this->chsum; - } - - /** - * Get the [ext] column value. - * - * @return string - */ - public function getExt() - { - return $this->ext; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Get the [parent] column value. - * - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Get the [owner] column value. - * - * @return int - */ - public function getOwner() - { - return $this->owner; - } - - /** - * Get the [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcAccessPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcAccessPeer::GUNID; - } - - return $this; - } // setGunid() - - /** - * Set the value of [token] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setToken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->token !== $v) { - $this->token = $v; - $this->modifiedColumns[] = CcAccessPeer::TOKEN; - } - - return $this; - } // setToken() - - /** - * Set the value of [chsum] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setChsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->chsum !== $v || $this->isNew()) { - $this->chsum = $v; - $this->modifiedColumns[] = CcAccessPeer::CHSUM; - } - - return $this; - } // setChsum() - - /** - * Set the value of [ext] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setExt($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ext !== $v || $this->isNew()) { - $this->ext = $v; - $this->modifiedColumns[] = CcAccessPeer::EXT; - } - - return $this; - } // setExt() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v || $this->isNew()) { - $this->type = $v; - $this->modifiedColumns[] = CcAccessPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Set the value of [parent] column. - * - * @param string $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setParent($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->parent !== $v) { - $this->parent = $v; - $this->modifiedColumns[] = CcAccessPeer::PARENT; - } - - return $this; - } // setParent() - - /** - * Set the value of [owner] column. - * - * @param int $v new value - * @return CcAccess The current object (for fluent API support) - */ - public function setOwner($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->owner !== $v) { - $this->owner = $v; - $this->modifiedColumns[] = CcAccessPeer::OWNER; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setOwner() - - /** - * Sets the value of [ts] 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 CcAccess The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcAccessPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->chsum !== '') { - return false; - } - - if ($this->ext !== '') { - return false; - } - - if ($this->type !== '') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->gunid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->token = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->chsum = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->ext = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->type = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->parent = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->owner = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->ts = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 9; // 9 = CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcAccess object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->owner !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcAccessPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcAccessQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcAccessPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcAccessPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcAccessPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcAccessPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcAccessPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcAccessPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcAccessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getGunid(); - break; - case 2: - return $this->getToken(); - break; - case 3: - return $this->getChsum(); - break; - case 4: - return $this->getExt(); - break; - case 5: - return $this->getType(); - break; - case 6: - return $this->getParent(); - break; - case 7: - return $this->getOwner(); - break; - case 8: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcAccessPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getGunid(), - $keys[2] => $this->getToken(), - $keys[3] => $this->getChsum(), - $keys[4] => $this->getExt(), - $keys[5] => $this->getType(), - $keys[6] => $this->getParent(), - $keys[7] => $this->getOwner(), - $keys[8] => $this->getTs(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcAccessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setGunid($value); - break; - case 2: - $this->setToken($value); - break; - case 3: - $this->setChsum($value); - break; - case 4: - $this->setExt($value); - break; - case 5: - $this->setType($value); - break; - case 6: - $this->setParent($value); - break; - case 7: - $this->setOwner($value); - break; - case 8: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcAccessPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setGunid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setToken($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setChsum($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setExt($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setType($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setParent($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setOwner($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setTs($arr[$keys[8]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcAccessPeer::ID)) $criteria->add(CcAccessPeer::ID, $this->id); - if ($this->isColumnModified(CcAccessPeer::GUNID)) $criteria->add(CcAccessPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcAccessPeer::TOKEN)) $criteria->add(CcAccessPeer::TOKEN, $this->token); - if ($this->isColumnModified(CcAccessPeer::CHSUM)) $criteria->add(CcAccessPeer::CHSUM, $this->chsum); - if ($this->isColumnModified(CcAccessPeer::EXT)) $criteria->add(CcAccessPeer::EXT, $this->ext); - if ($this->isColumnModified(CcAccessPeer::TYPE)) $criteria->add(CcAccessPeer::TYPE, $this->type); - if ($this->isColumnModified(CcAccessPeer::PARENT)) $criteria->add(CcAccessPeer::PARENT, $this->parent); - if ($this->isColumnModified(CcAccessPeer::OWNER)) $criteria->add(CcAccessPeer::OWNER, $this->owner); - if ($this->isColumnModified(CcAccessPeer::TS)) $criteria->add(CcAccessPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcAccess (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setGunid($this->gunid); - $copyObj->setToken($this->token); - $copyObj->setChsum($this->chsum); - $copyObj->setExt($this->ext); - $copyObj->setType($this->type); - $copyObj->setParent($this->parent); - $copyObj->setOwner($this->owner); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcAccess Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcAccessPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcAccessPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcAccess The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setOwner(NULL); - } else { - $this->setOwner($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcAccess($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->owner !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->owner, $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->aCcSubjs->addCcAccesss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->gunid = null; - $this->token = null; - $this->chsum = null; - $this->ext = null; - $this->type = null; - $this->parent = null; - $this->owner = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcAccess diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessPeer.php deleted file mode 100644 index c14312b14..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessPeer.php +++ /dev/null @@ -1,1008 +0,0 @@ - array ('Id', 'Gunid', 'Token', 'Chsum', 'Ext', 'Type', 'Parent', 'Owner', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'gunid', 'token', 'chsum', 'ext', 'type', 'parent', 'owner', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::TOKEN, self::CHSUM, self::EXT, self::TYPE, self::PARENT, self::OWNER, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'TOKEN', 'CHSUM', 'EXT', 'TYPE', 'PARENT', 'OWNER', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'token', 'chsum', 'ext', 'type', 'parent', 'owner', 'ts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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 ('Id' => 0, 'Gunid' => 1, 'Token' => 2, 'Chsum' => 3, 'Ext' => 4, 'Type' => 5, 'Parent' => 6, 'Owner' => 7, 'Ts' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'gunid' => 1, 'token' => 2, 'chsum' => 3, 'ext' => 4, 'type' => 5, 'parent' => 6, 'owner' => 7, 'ts' => 8, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::TOKEN => 2, self::CHSUM => 3, self::EXT => 4, self::TYPE => 5, self::PARENT => 6, self::OWNER => 7, self::TS => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'TOKEN' => 2, 'CHSUM' => 3, 'EXT' => 4, 'TYPE' => 5, 'PARENT' => 6, 'OWNER' => 7, 'TS' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'token' => 2, 'chsum' => 3, 'ext' => 4, 'type' => 5, 'parent' => 6, 'owner' => 7, 'ts' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcAccessPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcAccessPeer::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(CcAccessPeer::ID); - $criteria->addSelectColumn(CcAccessPeer::GUNID); - $criteria->addSelectColumn(CcAccessPeer::TOKEN); - $criteria->addSelectColumn(CcAccessPeer::CHSUM); - $criteria->addSelectColumn(CcAccessPeer::EXT); - $criteria->addSelectColumn(CcAccessPeer::TYPE); - $criteria->addSelectColumn(CcAccessPeer::PARENT); - $criteria->addSelectColumn(CcAccessPeer::OWNER); - $criteria->addSelectColumn(CcAccessPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.TOKEN'); - $criteria->addSelectColumn($alias . '.CHSUM'); - $criteria->addSelectColumn($alias . '.EXT'); - $criteria->addSelectColumn($alias . '.TYPE'); - $criteria->addSelectColumn($alias . '.PARENT'); - $criteria->addSelectColumn($alias . '.OWNER'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::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 CcAccess - * @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 = CcAccessPeer::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 CcAccessPeer::populateObjects(CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcAccessPeer::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 CcAccess $value A CcAccess object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcAccess $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcAccess object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcAccess) { - $key = (string) $value->getId(); - } 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 CcAccess 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 CcAccess 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_access - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcAccessPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcAccessPeer::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; - CcAccessPeer::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 (CcAccess object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcAccessPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcAccessPeer::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 + CcAccessPeer::NUM_COLUMNS; - } else { - $cls = CcAccessPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcAccessPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::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 CcAccess objects pre-filled with their CcSubjs 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 CcAccess objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcAccessPeer::addSelectColumns($criteria); - $startcol = (CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcAccessPeer::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 = CcAccessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcAccessPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcAccess) to $obj2 (CcSubjs) - $obj2->addCcAccess($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(CcAccessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::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 CcAccess 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 CcAccess 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); - } - - CcAccessPeer::addSelectColumns($criteria); - $startcol2 = (CcAccessPeer::NUM_COLUMNS - CcAccessPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcAccessPeer::OWNER, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcAccessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcAccessPeer::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 = CcAccessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcAccessPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcAccess) to the collection in $obj2 (CcSubjs) - $obj2->addCcAccess($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(BaseCcAccessPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcAccessPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcAccessTableMap()); - } - } - - /** - * 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 ? CcAccessPeer::CLASS_DEFAULT : CcAccessPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcAccess or Criteria object. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcAccess object - } - - if ($criteria->containsKey(CcAccessPeer::ID) && $criteria->keyContainsValue(CcAccessPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcAccessPeer::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 CcAccess or Criteria object. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcAccessPeer::ID); - $value = $criteria->remove(CcAccessPeer::ID); - if ($value) { - $selectCriteria->add(CcAccessPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcAccessPeer::TABLE_NAME); - } - - } else { // $values is CcAccess 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_access 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(CcAccessPeer::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(CcAccessPeer::TABLE_NAME, $con, CcAccessPeer::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). - CcAccessPeer::clearInstancePool(); - CcAccessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcAccess or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcAccess 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(CcAccessPeer::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. - CcAccessPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcAccess) { // it's a model object - // invalidate the cache for this single object - CcAccessPeer::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(CcAccessPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcAccessPeer::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); - CcAccessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcAccess 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 CcAccess $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(CcAccess $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcAccessPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, CcAccessPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcAccess - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcAccessPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $pk); - - $v = CcAccessPeer::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(CcAccessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcAccessPeer::DATABASE_NAME); - $criteria->add(CcAccessPeer::ID, $pks, Criteria::IN); - $objs = CcAccessPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcAccessPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcAccessPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessQuery.php deleted file mode 100644 index 652550f18..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcAccessQuery.php +++ /dev/null @@ -1,477 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcAccess|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcAccessPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcAccessQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcAccessPeer::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 CcAccessQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcAccessPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcAccessQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcAccessPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $gunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByGunid($gunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($gunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $gunid)) { - $gunid = str_replace('*', '%', $gunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::GUNID, $gunid, $comparison); - } - - /** - * Filter the query on the token column - * - * @param string|array $token 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByToken($token = null, $comparison = null) - { - if (is_array($token)) { - $useMinMax = false; - if (isset($token['min'])) { - $this->addUsingAlias(CcAccessPeer::TOKEN, $token['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($token['max'])) { - $this->addUsingAlias(CcAccessPeer::TOKEN, $token['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::TOKEN, $token, $comparison); - } - - /** - * Filter the query on the chsum column - * - * @param string $chsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByChsum($chsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($chsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $chsum)) { - $chsum = str_replace('*', '%', $chsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::CHSUM, $chsum, $comparison); - } - - /** - * Filter the query on the ext column - * - * @param string $ext The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByExt($ext = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($ext)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $ext)) { - $ext = str_replace('*', '%', $ext); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::EXT, $ext, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcAccessPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query on the parent column - * - * @param string|array $parent 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByParent($parent = null, $comparison = null) - { - if (is_array($parent)) { - $useMinMax = false; - if (isset($parent['min'])) { - $this->addUsingAlias(CcAccessPeer::PARENT, $parent['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($parent['max'])) { - $this->addUsingAlias(CcAccessPeer::PARENT, $parent['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::PARENT, $parent, $comparison); - } - - /** - * Filter the query on the owner column - * - * @param int|array $owner 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByOwner($owner = null, $comparison = null) - { - if (is_array($owner)) { - $useMinMax = false; - if (isset($owner['min'])) { - $this->addUsingAlias(CcAccessPeer::OWNER, $owner['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($owner['max'])) { - $this->addUsingAlias(CcAccessPeer::OWNER, $owner['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::OWNER, $owner, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcAccessQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcAccessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcAccessPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcAccessPeer::TS, $ts, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcAccessPeer::OWNER, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcAccess $ccAccess Object to remove from the list of results - * - * @return CcAccessQuery The current query, for fluid interface - */ - public function prune($ccAccess = null) - { - if ($ccAccess) { - $this->addUsingAlias(CcAccessPeer::ID, $ccAccess->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcAccessQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackup.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackup.php deleted file mode 100644 index 41be024bb..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackup.php +++ /dev/null @@ -1,956 +0,0 @@ -token; - } - - /** - * Get the [sessionid] column value. - * - * @return string - */ - public function getSessionid() - { - return $this->sessionid; - } - - /** - * Get the [status] column value. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Get the [optionally formatted] temporal [fromtime] 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 getFromtime($format = 'Y-m-d H:i:s') - { - if ($this->fromtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fromtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fromtime, 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 [optionally formatted] temporal [totime] 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 getTotime($format = 'Y-m-d H:i:s') - { - if ($this->totime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->totime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->totime, 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); - } - } - - /** - * Set the value of [token] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setToken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->token !== $v) { - $this->token = $v; - $this->modifiedColumns[] = CcBackupPeer::TOKEN; - } - - return $this; - } // setToken() - - /** - * Set the value of [sessionid] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setSessionid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sessionid !== $v) { - $this->sessionid = $v; - $this->modifiedColumns[] = CcBackupPeer::SESSIONID; - } - - return $this; - } // setSessionid() - - /** - * Set the value of [status] column. - * - * @param string $v new value - * @return CcBackup The current object (for fluent API support) - */ - public function setStatus($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->status !== $v) { - $this->status = $v; - $this->modifiedColumns[] = CcBackupPeer::STATUS; - } - - return $this; - } // setStatus() - - /** - * Sets the value of [fromtime] 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 CcBackup The current object (for fluent API support) - */ - public function setFromtime($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->fromtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fromtime !== null && $tmpDt = new DateTime($this->fromtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->fromtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcBackupPeer::FROMTIME; - } - } // if either are not null - - return $this; - } // setFromtime() - - /** - * Sets the value of [totime] 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 CcBackup The current object (for fluent API support) - */ - public function setTotime($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->totime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->totime !== null && $tmpDt = new DateTime($this->totime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->totime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcBackupPeer::TOTIME; - } - } // if either are not null - - return $this; - } // setTotime() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->token = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->sessionid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->status = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->fromtime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->totime = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcBackupPeer::NUM_COLUMNS - CcBackupPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcBackup object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcBackupPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcBackupQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcBackupPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcBackupPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcBackupPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcBackupPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getToken(); - break; - case 1: - return $this->getSessionid(); - break; - case 2: - return $this->getStatus(); - break; - case 3: - return $this->getFromtime(); - break; - case 4: - return $this->getTotime(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcBackupPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getToken(), - $keys[1] => $this->getSessionid(), - $keys[2] => $this->getStatus(), - $keys[3] => $this->getFromtime(), - $keys[4] => $this->getTotime(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcBackupPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setToken($value); - break; - case 1: - $this->setSessionid($value); - break; - case 2: - $this->setStatus($value); - break; - case 3: - $this->setFromtime($value); - break; - case 4: - $this->setTotime($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcBackupPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setToken($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSessionid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setStatus($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setFromtime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTotime($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcBackupPeer::TOKEN)) $criteria->add(CcBackupPeer::TOKEN, $this->token); - if ($this->isColumnModified(CcBackupPeer::SESSIONID)) $criteria->add(CcBackupPeer::SESSIONID, $this->sessionid); - if ($this->isColumnModified(CcBackupPeer::STATUS)) $criteria->add(CcBackupPeer::STATUS, $this->status); - if ($this->isColumnModified(CcBackupPeer::FROMTIME)) $criteria->add(CcBackupPeer::FROMTIME, $this->fromtime); - if ($this->isColumnModified(CcBackupPeer::TOTIME)) $criteria->add(CcBackupPeer::TOTIME, $this->totime); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $this->token); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getToken(); - } - - /** - * Generic method to set the primary key (token column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setToken($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getToken(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcBackup (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setToken($this->token); - $copyObj->setSessionid($this->sessionid); - $copyObj->setStatus($this->status); - $copyObj->setFromtime($this->fromtime); - $copyObj->setTotime($this->totime); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcBackup Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcBackupPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcBackupPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->token = null; - $this->sessionid = null; - $this->status = null; - $this->fromtime = null; - $this->totime = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcBackup diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupPeer.php deleted file mode 100644 index 304acc302..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupPeer.php +++ /dev/null @@ -1,750 +0,0 @@ - array ('Token', 'Sessionid', 'Status', 'Fromtime', 'Totime', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ), - BasePeer::TYPE_COLNAME => array (self::TOKEN, self::SESSIONID, self::STATUS, self::FROMTIME, self::TOTIME, ), - BasePeer::TYPE_RAW_COLNAME => array ('TOKEN', 'SESSIONID', 'STATUS', 'FROMTIME', 'TOTIME', ), - BasePeer::TYPE_FIELDNAME => array ('token', 'sessionid', 'status', 'fromtime', 'totime', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Token' => 0, 'Sessionid' => 1, 'Status' => 2, 'Fromtime' => 3, 'Totime' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ), - BasePeer::TYPE_COLNAME => array (self::TOKEN => 0, self::SESSIONID => 1, self::STATUS => 2, self::FROMTIME => 3, self::TOTIME => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('TOKEN' => 0, 'SESSIONID' => 1, 'STATUS' => 2, 'FROMTIME' => 3, 'TOTIME' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('token' => 0, 'sessionid' => 1, 'status' => 2, 'fromtime' => 3, 'totime' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcBackupPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcBackupPeer::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(CcBackupPeer::TOKEN); - $criteria->addSelectColumn(CcBackupPeer::SESSIONID); - $criteria->addSelectColumn(CcBackupPeer::STATUS); - $criteria->addSelectColumn(CcBackupPeer::FROMTIME); - $criteria->addSelectColumn(CcBackupPeer::TOTIME); - } else { - $criteria->addSelectColumn($alias . '.TOKEN'); - $criteria->addSelectColumn($alias . '.SESSIONID'); - $criteria->addSelectColumn($alias . '.STATUS'); - $criteria->addSelectColumn($alias . '.FROMTIME'); - $criteria->addSelectColumn($alias . '.TOTIME'); - } - } - - /** - * 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(CcBackupPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcBackupPeer::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(CcBackupPeer::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 CcBackup - * @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 = CcBackupPeer::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 CcBackupPeer::populateObjects(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcBackupPeer::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 CcBackup $value A CcBackup object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcBackup $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getToken(); - } // 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 CcBackup object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcBackup) { - $key = (string) $value->getToken(); - } 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 CcBackup 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 CcBackup 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_backup - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcBackupPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcBackupPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcBackupPeer::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; - CcBackupPeer::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 (CcBackup object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcBackupPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcBackupPeer::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 + CcBackupPeer::NUM_COLUMNS; - } else { - $cls = CcBackupPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcBackupPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcBackupPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcBackupPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcBackupTableMap()); - } - } - - /** - * 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 ? CcBackupPeer::CLASS_DEFAULT : CcBackupPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcBackup or Criteria object. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcBackup object - } - - - // 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 CcBackup or Criteria object. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcBackupPeer::TOKEN); - $value = $criteria->remove(CcBackupPeer::TOKEN); - if ($value) { - $selectCriteria->add(CcBackupPeer::TOKEN, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcBackupPeer::TABLE_NAME); - } - - } else { // $values is CcBackup 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_backup 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(CcBackupPeer::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(CcBackupPeer::TABLE_NAME, $con, CcBackupPeer::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). - CcBackupPeer::clearInstancePool(); - CcBackupPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcBackup or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcBackup 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(CcBackupPeer::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. - CcBackupPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcBackup) { // it's a model object - // invalidate the cache for this single object - CcBackupPeer::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(CcBackupPeer::TOKEN, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcBackupPeer::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); - CcBackupPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcBackup 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 CcBackup $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(CcBackup $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcBackupPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, CcBackupPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcBackup - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcBackupPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $pk); - - $v = CcBackupPeer::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(CcBackupPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcBackupPeer::DATABASE_NAME); - $criteria->add(CcBackupPeer::TOKEN, $pks, Criteria::IN); - $objs = CcBackupPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcBackupPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcBackupPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupQuery.php deleted file mode 100644 index 2e80333fb..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcBackupQuery.php +++ /dev/null @@ -1,292 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcBackup|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcBackupPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcBackupQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcBackupPeer::TOKEN, $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 CcBackupQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcBackupPeer::TOKEN, $keys, Criteria::IN); - } - - /** - * Filter the query on the token column - * - * @param string $token The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterByToken($token = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($token)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $token)) { - $token = str_replace('*', '%', $token); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::TOKEN, $token, $comparison); - } - - /** - * Filter the query on the sessionid column - * - * @param string $sessionid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterBySessionid($sessionid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($sessionid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $sessionid)) { - $sessionid = str_replace('*', '%', $sessionid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::SESSIONID, $sessionid, $comparison); - } - - /** - * Filter the query on the status column - * - * @param string $status The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function filterByStatus($status = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($status)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $status)) { - $status = str_replace('*', '%', $status); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcBackupPeer::STATUS, $status, $comparison); - } - - /** - * Filter the query on the fromtime column - * - * @param string|array $fromtime 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 CcBackupQuery The current query, for fluid interface - */ - public function filterByFromtime($fromtime = null, $comparison = null) - { - if (is_array($fromtime)) { - $useMinMax = false; - if (isset($fromtime['min'])) { - $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($fromtime['max'])) { - $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcBackupPeer::FROMTIME, $fromtime, $comparison); - } - - /** - * Filter the query on the totime column - * - * @param string|array $totime 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 CcBackupQuery The current query, for fluid interface - */ - public function filterByTotime($totime = null, $comparison = null) - { - if (is_array($totime)) { - $useMinMax = false; - if (isset($totime['min'])) { - $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($totime['max'])) { - $this->addUsingAlias(CcBackupPeer::TOTIME, $totime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcBackupPeer::TOTIME, $totime, $comparison); - } - - /** - * Exclude object from result - * - * @param CcBackup $ccBackup Object to remove from the list of results - * - * @return CcBackupQuery The current query, for fluid interface - */ - public function prune($ccBackup = null) - { - if ($ccBackup) { - $this->addUsingAlias(CcBackupPeer::TOKEN, $ccBackup->getToken(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcBackupQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountry.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountry.php deleted file mode 100644 index 3f92c5493..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountry.php +++ /dev/null @@ -1,708 +0,0 @@ -isocode; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Set the value of [isocode] column. - * - * @param string $v new value - * @return CcCountry The current object (for fluent API support) - */ - public function setDbIsoCode($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->isocode !== $v) { - $this->isocode = $v; - $this->modifiedColumns[] = CcCountryPeer::ISOCODE; - } - - return $this; - } // setDbIsoCode() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcCountry The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = CcCountryPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->isocode = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcCountryPeer::NUM_COLUMNS - CcCountryPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcCountry object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcCountryPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcCountryQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcCountryPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcCountryPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcCountryPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbIsoCode(); - break; - case 1: - return $this->getDbName(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcCountryPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbIsoCode(), - $keys[1] => $this->getDbName(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcCountryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbIsoCode($value); - break; - case 1: - $this->setDbName($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcCountryPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbIsoCode($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbName($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcCountryPeer::ISOCODE)) $criteria->add(CcCountryPeer::ISOCODE, $this->isocode); - if ($this->isColumnModified(CcCountryPeer::NAME)) $criteria->add(CcCountryPeer::NAME, $this->name); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $this->isocode); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbIsoCode(); - } - - /** - * Generic method to set the primary key (isocode column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbIsoCode($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbIsoCode(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcCountry (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbIsoCode($this->isocode); - $copyObj->setDbName($this->name); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcCountry Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcCountryPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcCountryPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->isocode = null; - $this->name = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcCountry diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryPeer.php deleted file mode 100644 index ee16e55bf..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbIsoCode', 'DbName', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode', 'dbName', ), - BasePeer::TYPE_COLNAME => array (self::ISOCODE, self::NAME, ), - BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE', 'NAME', ), - BasePeer::TYPE_FIELDNAME => array ('isocode', 'name', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbIsoCode' => 0, 'DbName' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIsoCode' => 0, 'dbName' => 1, ), - BasePeer::TYPE_COLNAME => array (self::ISOCODE => 0, self::NAME => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('ISOCODE' => 0, 'NAME' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('isocode' => 0, 'name' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcCountryPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcCountryPeer::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(CcCountryPeer::ISOCODE); - $criteria->addSelectColumn(CcCountryPeer::NAME); - } else { - $criteria->addSelectColumn($alias . '.ISOCODE'); - $criteria->addSelectColumn($alias . '.NAME'); - } - } - - /** - * 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(CcCountryPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcCountryPeer::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(CcCountryPeer::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 CcCountry - * @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 = CcCountryPeer::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 CcCountryPeer::populateObjects(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcCountryPeer::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 CcCountry $value A CcCountry object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcCountry $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbIsoCode(); - } // 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 CcCountry object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcCountry) { - $key = (string) $value->getDbIsoCode(); - } 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 CcCountry 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 CcCountry 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_country - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcCountryPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcCountryPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcCountryPeer::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; - CcCountryPeer::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 (CcCountry object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcCountryPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcCountryPeer::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 + CcCountryPeer::NUM_COLUMNS; - } else { - $cls = CcCountryPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcCountryPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcCountryPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcCountryPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcCountryTableMap()); - } - } - - /** - * 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 ? CcCountryPeer::CLASS_DEFAULT : CcCountryPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcCountry or Criteria object. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcCountry object - } - - - // 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 CcCountry or Criteria object. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcCountryPeer::ISOCODE); - $value = $criteria->remove(CcCountryPeer::ISOCODE); - if ($value) { - $selectCriteria->add(CcCountryPeer::ISOCODE, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcCountryPeer::TABLE_NAME); - } - - } else { // $values is CcCountry 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_country 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(CcCountryPeer::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(CcCountryPeer::TABLE_NAME, $con, CcCountryPeer::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). - CcCountryPeer::clearInstancePool(); - CcCountryPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcCountry or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcCountry 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(CcCountryPeer::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. - CcCountryPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcCountry) { // it's a model object - // invalidate the cache for this single object - CcCountryPeer::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(CcCountryPeer::ISOCODE, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcCountryPeer::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); - CcCountryPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcCountry 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 CcCountry $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(CcCountry $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcCountryPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, CcCountryPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcCountry - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcCountryPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $pk); - - $v = CcCountryPeer::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(CcCountryPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcCountryPeer::DATABASE_NAME); - $criteria->add(CcCountryPeer::ISOCODE, $pks, Criteria::IN); - $objs = CcCountryPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcCountryPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcCountryPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryQuery.php deleted file mode 100644 index 4e634ea19..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcCountryQuery.php +++ /dev/null @@ -1,196 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcCountry|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcCountryPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcCountryQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $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 CcCountryQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $keys, Criteria::IN); - } - - /** - * Filter the query on the isocode column - * - * @param string $dbIsoCode The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function filterByDbIsoCode($dbIsoCode = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIsoCode)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIsoCode)) { - $dbIsoCode = str_replace('*', '%', $dbIsoCode); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcCountryPeer::ISOCODE, $dbIsoCode, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcCountryPeer::NAME, $dbName, $comparison); - } - - /** - * Exclude object from result - * - * @param CcCountry $ccCountry Object to remove from the list of results - * - * @return CcCountryQuery The current query, for fluid interface - */ - public function prune($ccCountry = null) - { - if ($ccCountry) { - $this->addUsingAlias(CcCountryPeer::ISOCODE, $ccCountry->getDbIsoCode(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcCountryQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFiles.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFiles.php deleted file mode 100644 index 0882018d1..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFiles.php +++ /dev/null @@ -1,4325 +0,0 @@ -name = ''; - $this->mime = ''; - $this->ftype = ''; - $this->filepath = ''; - $this->state = 'empty'; - $this->currentlyaccessing = 0; - } - - /** - * Initializes internal state of BaseCcFiles object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getDbGunid() - { - return $this->gunid; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [mime] column value. - * - * @return string - */ - public function getDbMime() - { - return $this->mime; - } - - /** - * Get the [ftype] column value. - * - * @return string - */ - public function getDbFtype() - { - return $this->ftype; - } - - /** - * Get the [directory] column value. - * - * @return int - */ - public function getDbDirectory() - { - return $this->directory; - } - - /** - * Get the [filepath] column value. - * - * @return string - */ - public function getDbFilepath() - { - return $this->filepath; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getDbState() - { - return $this->state; - } - - /** - * Get the [currentlyaccessing] column value. - * - * @return int - */ - public function getDbCurrentlyaccessing() - { - return $this->currentlyaccessing; - } - - /** - * Get the [editedby] column value. - * - * @return int - */ - public function getDbEditedby() - { - return $this->editedby; - } - - /** - * Get the [optionally formatted] temporal [mtime] 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 getDbMtime($format = 'Y-m-d H:i:s') - { - if ($this->mtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->mtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->mtime, 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 [md5] column value. - * - * @return string - */ - public function getDbMd5() - { - return $this->md5; - } - - /** - * Get the [track_title] column value. - * - * @return string - */ - public function getDbTrackTitle() - { - return $this->track_title; - } - - /** - * Get the [artist_name] column value. - * - * @return string - */ - public function getDbArtistName() - { - return $this->artist_name; - } - - /** - * Get the [bit_rate] column value. - * - * @return string - */ - public function getDbBitRate() - { - return $this->bit_rate; - } - - /** - * Get the [sample_rate] column value. - * - * @return string - */ - public function getDbSampleRate() - { - return $this->sample_rate; - } - - /** - * Get the [format] column value. - * - * @return string - */ - public function getDbFormat() - { - return $this->format; - } - - /** - * Get the [optionally formatted] temporal [length] 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 getDbLength($format = '%X') - { - if ($this->length === null) { - return null; - } - - - - try { - $dt = new DateTime($this->length); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->length, 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 [album_title] column value. - * - * @return string - */ - public function getDbAlbumTitle() - { - return $this->album_title; - } - - /** - * Get the [genre] column value. - * - * @return string - */ - public function getDbGenre() - { - return $this->genre; - } - - /** - * Get the [comments] column value. - * - * @return string - */ - public function getDbComments() - { - return $this->comments; - } - - /** - * Get the [year] column value. - * - * @return string - */ - public function getDbYear() - { - return $this->year; - } - - /** - * Get the [track_number] column value. - * - * @return int - */ - public function getDbTrackNumber() - { - return $this->track_number; - } - - /** - * Get the [channels] column value. - * - * @return int - */ - public function getDbChannels() - { - return $this->channels; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getDbUrl() - { - return $this->url; - } - - /** - * Get the [bpm] column value. - * - * @return string - */ - public function getDbBpm() - { - return $this->bpm; - } - - /** - * Get the [rating] column value. - * - * @return string - */ - public function getDbRating() - { - return $this->rating; - } - - /** - * Get the [encoded_by] column value. - * - * @return string - */ - public function getDbEncodedBy() - { - return $this->encoded_by; - } - - /** - * Get the [disc_number] column value. - * - * @return string - */ - public function getDbDiscNumber() - { - return $this->disc_number; - } - - /** - * Get the [mood] column value. - * - * @return string - */ - public function getDbMood() - { - return $this->mood; - } - - /** - * Get the [label] column value. - * - * @return string - */ - public function getDbLabel() - { - return $this->label; - } - - /** - * Get the [composer] column value. - * - * @return string - */ - public function getDbComposer() - { - return $this->composer; - } - - /** - * Get the [encoder] column value. - * - * @return string - */ - public function getDbEncoder() - { - return $this->encoder; - } - - /** - * Get the [checksum] column value. - * - * @return string - */ - public function getDbChecksum() - { - return $this->checksum; - } - - /** - * Get the [lyrics] column value. - * - * @return string - */ - public function getDbLyrics() - { - return $this->lyrics; - } - - /** - * Get the [orchestra] column value. - * - * @return string - */ - public function getDbOrchestra() - { - return $this->orchestra; - } - - /** - * Get the [conductor] column value. - * - * @return string - */ - public function getDbConductor() - { - return $this->conductor; - } - - /** - * Get the [lyricist] column value. - * - * @return string - */ - public function getDbLyricist() - { - return $this->lyricist; - } - - /** - * Get the [original_lyricist] column value. - * - * @return string - */ - public function getDbOriginalLyricist() - { - return $this->original_lyricist; - } - - /** - * Get the [radio_station_name] column value. - * - * @return string - */ - public function getDbRadioStationName() - { - return $this->radio_station_name; - } - - /** - * Get the [info_url] column value. - * - * @return string - */ - public function getDbInfoUrl() - { - return $this->info_url; - } - - /** - * Get the [artist_url] column value. - * - * @return string - */ - public function getDbArtistUrl() - { - return $this->artist_url; - } - - /** - * Get the [audio_source_url] column value. - * - * @return string - */ - public function getDbAudioSourceUrl() - { - return $this->audio_source_url; - } - - /** - * Get the [radio_station_url] column value. - * - * @return string - */ - public function getDbRadioStationUrl() - { - return $this->radio_station_url; - } - - /** - * Get the [buy_this_url] column value. - * - * @return string - */ - public function getDbBuyThisUrl() - { - return $this->buy_this_url; - } - - /** - * Get the [isrc_number] column value. - * - * @return string - */ - public function getDbIsrcNumber() - { - return $this->isrc_number; - } - - /** - * Get the [catalog_number] column value. - * - * @return string - */ - public function getDbCatalogNumber() - { - return $this->catalog_number; - } - - /** - * Get the [original_artist] column value. - * - * @return string - */ - public function getDbOriginalArtist() - { - return $this->original_artist; - } - - /** - * Get the [copyright] column value. - * - * @return string - */ - public function getDbCopyright() - { - return $this->copyright; - } - - /** - * Get the [report_datetime] column value. - * - * @return string - */ - public function getDbReportDatetime() - { - return $this->report_datetime; - } - - /** - * Get the [report_location] column value. - * - * @return string - */ - public function getDbReportLocation() - { - return $this->report_location; - } - - /** - * Get the [report_organization] column value. - * - * @return string - */ - public function getDbReportOrganization() - { - return $this->report_organization; - } - - /** - * Get the [subject] column value. - * - * @return string - */ - public function getDbSubject() - { - return $this->subject; - } - - /** - * Get the [contributor] column value. - * - * @return string - */ - public function getDbContributor() - { - return $this->contributor; - } - - /** - * Get the [language] column value. - * - * @return string - */ - public function getDbLanguage() - { - return $this->language; - } - - /** - * Get the [soundcloud_id] column value. - * - * @return int - */ - public function getDbSoundcloudId() - { - return $this->soundcloud_id; - } - - /** - * Get the [soundcloud_error_code] column value. - * - * @return int - */ - public function getDbSoundcloudErrorCode() - { - return $this->soundcloud_error_code; - } - - /** - * Get the [soundcloud_error_msg] column value. - * - * @return string - */ - public function getDbSoundcloudErrorMsg() - { - return $this->soundcloud_error_msg; - } - - /** - * Get the [soundcloud_link_to_file] column value. - * - * @return string - */ - public function getDbSoundcloudLinkToFile() - { - return $this->soundcloud_link_to_file; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcFilesPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcFilesPeer::GUNID; - } - - return $this; - } // setDbGunid() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcFilesPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [mime] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMime($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mime !== $v || $this->isNew()) { - $this->mime = $v; - $this->modifiedColumns[] = CcFilesPeer::MIME; - } - - return $this; - } // setDbMime() - - /** - * Set the value of [ftype] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFtype($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ftype !== $v || $this->isNew()) { - $this->ftype = $v; - $this->modifiedColumns[] = CcFilesPeer::FTYPE; - } - - return $this; - } // setDbFtype() - - /** - * Set the value of [directory] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbDirectory($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->directory !== $v) { - $this->directory = $v; - $this->modifiedColumns[] = CcFilesPeer::DIRECTORY; - } - - if ($this->aCcMusicDirs !== null && $this->aCcMusicDirs->getId() !== $v) { - $this->aCcMusicDirs = null; - } - - return $this; - } // setDbDirectory() - - /** - * Set the value of [filepath] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFilepath($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->filepath !== $v || $this->isNew()) { - $this->filepath = $v; - $this->modifiedColumns[] = CcFilesPeer::FILEPATH; - } - - return $this; - } // setDbFilepath() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v || $this->isNew()) { - $this->state = $v; - $this->modifiedColumns[] = CcFilesPeer::STATE; - } - - return $this; - } // setDbState() - - /** - * Set the value of [currentlyaccessing] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCurrentlyaccessing($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->currentlyaccessing !== $v || $this->isNew()) { - $this->currentlyaccessing = $v; - $this->modifiedColumns[] = CcFilesPeer::CURRENTLYACCESSING; - } - - return $this; - } // setDbCurrentlyaccessing() - - /** - * Set the value of [editedby] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEditedby($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->editedby !== $v) { - $this->editedby = $v; - $this->modifiedColumns[] = CcFilesPeer::EDITEDBY; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbEditedby() - - /** - * Sets the value of [mtime] 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 CcFiles The current object (for fluent API support) - */ - public function setDbMtime($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->mtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->mtime !== null && $tmpDt = new DateTime($this->mtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->mtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcFilesPeer::MTIME; - } - } // if either are not null - - return $this; - } // setDbMtime() - - /** - * Set the value of [md5] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMd5($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->md5 !== $v) { - $this->md5 = $v; - $this->modifiedColumns[] = CcFilesPeer::MD5; - } - - return $this; - } // setDbMd5() - - /** - * Set the value of [track_title] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbTrackTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->track_title !== $v) { - $this->track_title = $v; - $this->modifiedColumns[] = CcFilesPeer::TRACK_TITLE; - } - - return $this; - } // setDbTrackTitle() - - /** - * Set the value of [artist_name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbArtistName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->artist_name !== $v) { - $this->artist_name = $v; - $this->modifiedColumns[] = CcFilesPeer::ARTIST_NAME; - } - - return $this; - } // setDbArtistName() - - /** - * Set the value of [bit_rate] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBitRate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->bit_rate !== $v) { - $this->bit_rate = $v; - $this->modifiedColumns[] = CcFilesPeer::BIT_RATE; - } - - return $this; - } // setDbBitRate() - - /** - * Set the value of [sample_rate] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSampleRate($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sample_rate !== $v) { - $this->sample_rate = $v; - $this->modifiedColumns[] = CcFilesPeer::SAMPLE_RATE; - } - - return $this; - } // setDbSampleRate() - - /** - * Set the value of [format] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbFormat($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->format !== $v) { - $this->format = $v; - $this->modifiedColumns[] = CcFilesPeer::FORMAT; - } - - return $this; - } // setDbFormat() - - /** - * Sets the value of [length] 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 CcFiles The current object (for fluent API support) - */ - public function setDbLength($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->length !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->length !== null && $tmpDt = new DateTime($this->length)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->length = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcFilesPeer::LENGTH; - } - } // if either are not null - - return $this; - } // setDbLength() - - /** - * Set the value of [album_title] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbAlbumTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->album_title !== $v) { - $this->album_title = $v; - $this->modifiedColumns[] = CcFilesPeer::ALBUM_TITLE; - } - - return $this; - } // setDbAlbumTitle() - - /** - * Set the value of [genre] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbGenre($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->genre !== $v) { - $this->genre = $v; - $this->modifiedColumns[] = CcFilesPeer::GENRE; - } - - return $this; - } // setDbGenre() - - /** - * Set the value of [comments] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbComments($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->comments !== $v) { - $this->comments = $v; - $this->modifiedColumns[] = CcFilesPeer::COMMENTS; - } - - return $this; - } // setDbComments() - - /** - * Set the value of [year] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbYear($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->year !== $v) { - $this->year = $v; - $this->modifiedColumns[] = CcFilesPeer::YEAR; - } - - return $this; - } // setDbYear() - - /** - * Set the value of [track_number] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbTrackNumber($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->track_number !== $v) { - $this->track_number = $v; - $this->modifiedColumns[] = CcFilesPeer::TRACK_NUMBER; - } - - return $this; - } // setDbTrackNumber() - - /** - * Set the value of [channels] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbChannels($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->channels !== $v) { - $this->channels = $v; - $this->modifiedColumns[] = CcFilesPeer::CHANNELS; - } - - return $this; - } // setDbChannels() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v) { - $this->url = $v; - $this->modifiedColumns[] = CcFilesPeer::URL; - } - - return $this; - } // setDbUrl() - - /** - * Set the value of [bpm] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBpm($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->bpm !== $v) { - $this->bpm = $v; - $this->modifiedColumns[] = CcFilesPeer::BPM; - } - - return $this; - } // setDbBpm() - - /** - * Set the value of [rating] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRating($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->rating !== $v) { - $this->rating = $v; - $this->modifiedColumns[] = CcFilesPeer::RATING; - } - - return $this; - } // setDbRating() - - /** - * Set the value of [encoded_by] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEncodedBy($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->encoded_by !== $v) { - $this->encoded_by = $v; - $this->modifiedColumns[] = CcFilesPeer::ENCODED_BY; - } - - return $this; - } // setDbEncodedBy() - - /** - * Set the value of [disc_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbDiscNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->disc_number !== $v) { - $this->disc_number = $v; - $this->modifiedColumns[] = CcFilesPeer::DISC_NUMBER; - } - - return $this; - } // setDbDiscNumber() - - /** - * Set the value of [mood] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbMood($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mood !== $v) { - $this->mood = $v; - $this->modifiedColumns[] = CcFilesPeer::MOOD; - } - - return $this; - } // setDbMood() - - /** - * Set the value of [label] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLabel($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->label !== $v) { - $this->label = $v; - $this->modifiedColumns[] = CcFilesPeer::LABEL; - } - - return $this; - } // setDbLabel() - - /** - * Set the value of [composer] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbComposer($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->composer !== $v) { - $this->composer = $v; - $this->modifiedColumns[] = CcFilesPeer::COMPOSER; - } - - return $this; - } // setDbComposer() - - /** - * Set the value of [encoder] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbEncoder($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->encoder !== $v) { - $this->encoder = $v; - $this->modifiedColumns[] = CcFilesPeer::ENCODER; - } - - return $this; - } // setDbEncoder() - - /** - * Set the value of [checksum] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbChecksum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->checksum !== $v) { - $this->checksum = $v; - $this->modifiedColumns[] = CcFilesPeer::CHECKSUM; - } - - return $this; - } // setDbChecksum() - - /** - * Set the value of [lyrics] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLyrics($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lyrics !== $v) { - $this->lyrics = $v; - $this->modifiedColumns[] = CcFilesPeer::LYRICS; - } - - return $this; - } // setDbLyrics() - - /** - * Set the value of [orchestra] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOrchestra($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->orchestra !== $v) { - $this->orchestra = $v; - $this->modifiedColumns[] = CcFilesPeer::ORCHESTRA; - } - - return $this; - } // setDbOrchestra() - - /** - * Set the value of [conductor] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbConductor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->conductor !== $v) { - $this->conductor = $v; - $this->modifiedColumns[] = CcFilesPeer::CONDUCTOR; - } - - return $this; - } // setDbConductor() - - /** - * Set the value of [lyricist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLyricist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lyricist !== $v) { - $this->lyricist = $v; - $this->modifiedColumns[] = CcFilesPeer::LYRICIST; - } - - return $this; - } // setDbLyricist() - - /** - * Set the value of [original_lyricist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOriginalLyricist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->original_lyricist !== $v) { - $this->original_lyricist = $v; - $this->modifiedColumns[] = CcFilesPeer::ORIGINAL_LYRICIST; - } - - return $this; - } // setDbOriginalLyricist() - - /** - * Set the value of [radio_station_name] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRadioStationName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->radio_station_name !== $v) { - $this->radio_station_name = $v; - $this->modifiedColumns[] = CcFilesPeer::RADIO_STATION_NAME; - } - - return $this; - } // setDbRadioStationName() - - /** - * Set the value of [info_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbInfoUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->info_url !== $v) { - $this->info_url = $v; - $this->modifiedColumns[] = CcFilesPeer::INFO_URL; - } - - return $this; - } // setDbInfoUrl() - - /** - * Set the value of [artist_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbArtistUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->artist_url !== $v) { - $this->artist_url = $v; - $this->modifiedColumns[] = CcFilesPeer::ARTIST_URL; - } - - return $this; - } // setDbArtistUrl() - - /** - * Set the value of [audio_source_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbAudioSourceUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->audio_source_url !== $v) { - $this->audio_source_url = $v; - $this->modifiedColumns[] = CcFilesPeer::AUDIO_SOURCE_URL; - } - - return $this; - } // setDbAudioSourceUrl() - - /** - * Set the value of [radio_station_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbRadioStationUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->radio_station_url !== $v) { - $this->radio_station_url = $v; - $this->modifiedColumns[] = CcFilesPeer::RADIO_STATION_URL; - } - - return $this; - } // setDbRadioStationUrl() - - /** - * Set the value of [buy_this_url] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbBuyThisUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->buy_this_url !== $v) { - $this->buy_this_url = $v; - $this->modifiedColumns[] = CcFilesPeer::BUY_THIS_URL; - } - - return $this; - } // setDbBuyThisUrl() - - /** - * Set the value of [isrc_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbIsrcNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->isrc_number !== $v) { - $this->isrc_number = $v; - $this->modifiedColumns[] = CcFilesPeer::ISRC_NUMBER; - } - - return $this; - } // setDbIsrcNumber() - - /** - * Set the value of [catalog_number] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCatalogNumber($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->catalog_number !== $v) { - $this->catalog_number = $v; - $this->modifiedColumns[] = CcFilesPeer::CATALOG_NUMBER; - } - - return $this; - } // setDbCatalogNumber() - - /** - * Set the value of [original_artist] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbOriginalArtist($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->original_artist !== $v) { - $this->original_artist = $v; - $this->modifiedColumns[] = CcFilesPeer::ORIGINAL_ARTIST; - } - - return $this; - } // setDbOriginalArtist() - - /** - * Set the value of [copyright] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbCopyright($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->copyright !== $v) { - $this->copyright = $v; - $this->modifiedColumns[] = CcFilesPeer::COPYRIGHT; - } - - return $this; - } // setDbCopyright() - - /** - * Set the value of [report_datetime] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportDatetime($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_datetime !== $v) { - $this->report_datetime = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_DATETIME; - } - - return $this; - } // setDbReportDatetime() - - /** - * Set the value of [report_location] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportLocation($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_location !== $v) { - $this->report_location = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_LOCATION; - } - - return $this; - } // setDbReportLocation() - - /** - * Set the value of [report_organization] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbReportOrganization($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->report_organization !== $v) { - $this->report_organization = $v; - $this->modifiedColumns[] = CcFilesPeer::REPORT_ORGANIZATION; - } - - return $this; - } // setDbReportOrganization() - - /** - * Set the value of [subject] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSubject($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->subject !== $v) { - $this->subject = $v; - $this->modifiedColumns[] = CcFilesPeer::SUBJECT; - } - - return $this; - } // setDbSubject() - - /** - * Set the value of [contributor] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbContributor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->contributor !== $v) { - $this->contributor = $v; - $this->modifiedColumns[] = CcFilesPeer::CONTRIBUTOR; - } - - return $this; - } // setDbContributor() - - /** - * Set the value of [language] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbLanguage($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->language !== $v) { - $this->language = $v; - $this->modifiedColumns[] = CcFilesPeer::LANGUAGE; - } - - return $this; - } // setDbLanguage() - - /** - * Set the value of [soundcloud_id] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->soundcloud_id !== $v) { - $this->soundcloud_id = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ID; - } - - return $this; - } // setDbSoundcloudId() - - /** - * Set the value of [soundcloud_error_code] column. - * - * @param int $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudErrorCode($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->soundcloud_error_code !== $v) { - $this->soundcloud_error_code = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_CODE; - } - - return $this; - } // setDbSoundcloudErrorCode() - - /** - * Set the value of [soundcloud_error_msg] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudErrorMsg($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->soundcloud_error_msg !== $v) { - $this->soundcloud_error_msg = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_ERROR_MSG; - } - - return $this; - } // setDbSoundcloudErrorMsg() - - /** - * Set the value of [soundcloud_link_to_file] column. - * - * @param string $v new value - * @return CcFiles The current object (for fluent API support) - */ - public function setDbSoundcloudLinkToFile($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->soundcloud_link_to_file !== $v) { - $this->soundcloud_link_to_file = $v; - $this->modifiedColumns[] = CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE; - } - - return $this; - } // setDbSoundcloudLinkToFile() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->mime !== '') { - return false; - } - - if ($this->ftype !== '') { - return false; - } - - if ($this->filepath !== '') { - return false; - } - - if ($this->state !== 'empty') { - return false; - } - - if ($this->currentlyaccessing !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->gunid = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->mime = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->ftype = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->directory = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->filepath = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->state = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->currentlyaccessing = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null; - $this->editedby = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null; - $this->mtime = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->md5 = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; - $this->track_title = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; - $this->artist_name = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null; - $this->bit_rate = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null; - $this->sample_rate = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null; - $this->format = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null; - $this->length = ($row[$startcol + 17] !== null) ? (string) $row[$startcol + 17] : null; - $this->album_title = ($row[$startcol + 18] !== null) ? (string) $row[$startcol + 18] : null; - $this->genre = ($row[$startcol + 19] !== null) ? (string) $row[$startcol + 19] : null; - $this->comments = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null; - $this->year = ($row[$startcol + 21] !== null) ? (string) $row[$startcol + 21] : null; - $this->track_number = ($row[$startcol + 22] !== null) ? (int) $row[$startcol + 22] : null; - $this->channels = ($row[$startcol + 23] !== null) ? (int) $row[$startcol + 23] : null; - $this->url = ($row[$startcol + 24] !== null) ? (string) $row[$startcol + 24] : null; - $this->bpm = ($row[$startcol + 25] !== null) ? (string) $row[$startcol + 25] : null; - $this->rating = ($row[$startcol + 26] !== null) ? (string) $row[$startcol + 26] : null; - $this->encoded_by = ($row[$startcol + 27] !== null) ? (string) $row[$startcol + 27] : null; - $this->disc_number = ($row[$startcol + 28] !== null) ? (string) $row[$startcol + 28] : null; - $this->mood = ($row[$startcol + 29] !== null) ? (string) $row[$startcol + 29] : null; - $this->label = ($row[$startcol + 30] !== null) ? (string) $row[$startcol + 30] : null; - $this->composer = ($row[$startcol + 31] !== null) ? (string) $row[$startcol + 31] : null; - $this->encoder = ($row[$startcol + 32] !== null) ? (string) $row[$startcol + 32] : null; - $this->checksum = ($row[$startcol + 33] !== null) ? (string) $row[$startcol + 33] : null; - $this->lyrics = ($row[$startcol + 34] !== null) ? (string) $row[$startcol + 34] : null; - $this->orchestra = ($row[$startcol + 35] !== null) ? (string) $row[$startcol + 35] : null; - $this->conductor = ($row[$startcol + 36] !== null) ? (string) $row[$startcol + 36] : null; - $this->lyricist = ($row[$startcol + 37] !== null) ? (string) $row[$startcol + 37] : null; - $this->original_lyricist = ($row[$startcol + 38] !== null) ? (string) $row[$startcol + 38] : null; - $this->radio_station_name = ($row[$startcol + 39] !== null) ? (string) $row[$startcol + 39] : null; - $this->info_url = ($row[$startcol + 40] !== null) ? (string) $row[$startcol + 40] : null; - $this->artist_url = ($row[$startcol + 41] !== null) ? (string) $row[$startcol + 41] : null; - $this->audio_source_url = ($row[$startcol + 42] !== null) ? (string) $row[$startcol + 42] : null; - $this->radio_station_url = ($row[$startcol + 43] !== null) ? (string) $row[$startcol + 43] : null; - $this->buy_this_url = ($row[$startcol + 44] !== null) ? (string) $row[$startcol + 44] : null; - $this->isrc_number = ($row[$startcol + 45] !== null) ? (string) $row[$startcol + 45] : null; - $this->catalog_number = ($row[$startcol + 46] !== null) ? (string) $row[$startcol + 46] : null; - $this->original_artist = ($row[$startcol + 47] !== null) ? (string) $row[$startcol + 47] : null; - $this->copyright = ($row[$startcol + 48] !== null) ? (string) $row[$startcol + 48] : null; - $this->report_datetime = ($row[$startcol + 49] !== null) ? (string) $row[$startcol + 49] : null; - $this->report_location = ($row[$startcol + 50] !== null) ? (string) $row[$startcol + 50] : null; - $this->report_organization = ($row[$startcol + 51] !== null) ? (string) $row[$startcol + 51] : null; - $this->subject = ($row[$startcol + 52] !== null) ? (string) $row[$startcol + 52] : null; - $this->contributor = ($row[$startcol + 53] !== null) ? (string) $row[$startcol + 53] : null; - $this->language = ($row[$startcol + 54] !== null) ? (string) $row[$startcol + 54] : null; - $this->soundcloud_id = ($row[$startcol + 55] !== null) ? (int) $row[$startcol + 55] : null; - $this->soundcloud_error_code = ($row[$startcol + 56] !== null) ? (int) $row[$startcol + 56] : null; - $this->soundcloud_error_msg = ($row[$startcol + 57] !== null) ? (string) $row[$startcol + 57] : null; - $this->soundcloud_link_to_file = ($row[$startcol + 58] !== null) ? (string) $row[$startcol + 58] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 59; // 59 = CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcFiles object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcMusicDirs !== null && $this->directory !== $this->aCcMusicDirs->getId()) { - $this->aCcMusicDirs = null; - } - if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcFilesPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - $this->aCcMusicDirs = null; - $this->collCcShowInstancess = null; - - $this->collCcPlaylistcontentss = null; - - $this->collCcSchedules = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcFilesQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcFilesPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->aCcMusicDirs !== null) { - if ($this->aCcMusicDirs->isModified() || $this->aCcMusicDirs->isNew()) { - $affectedRows += $this->aCcMusicDirs->save($con); - } - $this->setCcMusicDirs($this->aCcMusicDirs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcFilesPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcFilesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcFilesPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcFilesPeer::doUpdate($this, $con); - } - - $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->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - if ($this->aCcMusicDirs !== null) { - if (!$this->aCcMusicDirs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcMusicDirs->getValidationFailures()); - } - } - - - if (($retval = CcFilesPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancess !== null) { - foreach ($this->collCcShowInstancess as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcFilesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbGunid(); - break; - case 2: - return $this->getDbName(); - break; - case 3: - return $this->getDbMime(); - break; - case 4: - return $this->getDbFtype(); - break; - case 5: - return $this->getDbDirectory(); - break; - case 6: - return $this->getDbFilepath(); - break; - case 7: - return $this->getDbState(); - break; - case 8: - return $this->getDbCurrentlyaccessing(); - break; - case 9: - return $this->getDbEditedby(); - break; - case 10: - return $this->getDbMtime(); - break; - case 11: - return $this->getDbMd5(); - break; - case 12: - return $this->getDbTrackTitle(); - break; - case 13: - return $this->getDbArtistName(); - break; - case 14: - return $this->getDbBitRate(); - break; - case 15: - return $this->getDbSampleRate(); - break; - case 16: - return $this->getDbFormat(); - break; - case 17: - return $this->getDbLength(); - break; - case 18: - return $this->getDbAlbumTitle(); - break; - case 19: - return $this->getDbGenre(); - break; - case 20: - return $this->getDbComments(); - break; - case 21: - return $this->getDbYear(); - break; - case 22: - return $this->getDbTrackNumber(); - break; - case 23: - return $this->getDbChannels(); - break; - case 24: - return $this->getDbUrl(); - break; - case 25: - return $this->getDbBpm(); - break; - case 26: - return $this->getDbRating(); - break; - case 27: - return $this->getDbEncodedBy(); - break; - case 28: - return $this->getDbDiscNumber(); - break; - case 29: - return $this->getDbMood(); - break; - case 30: - return $this->getDbLabel(); - break; - case 31: - return $this->getDbComposer(); - break; - case 32: - return $this->getDbEncoder(); - break; - case 33: - return $this->getDbChecksum(); - break; - case 34: - return $this->getDbLyrics(); - break; - case 35: - return $this->getDbOrchestra(); - break; - case 36: - return $this->getDbConductor(); - break; - case 37: - return $this->getDbLyricist(); - break; - case 38: - return $this->getDbOriginalLyricist(); - break; - case 39: - return $this->getDbRadioStationName(); - break; - case 40: - return $this->getDbInfoUrl(); - break; - case 41: - return $this->getDbArtistUrl(); - break; - case 42: - return $this->getDbAudioSourceUrl(); - break; - case 43: - return $this->getDbRadioStationUrl(); - break; - case 44: - return $this->getDbBuyThisUrl(); - break; - case 45: - return $this->getDbIsrcNumber(); - break; - case 46: - return $this->getDbCatalogNumber(); - break; - case 47: - return $this->getDbOriginalArtist(); - break; - case 48: - return $this->getDbCopyright(); - break; - case 49: - return $this->getDbReportDatetime(); - break; - case 50: - return $this->getDbReportLocation(); - break; - case 51: - return $this->getDbReportOrganization(); - break; - case 52: - return $this->getDbSubject(); - break; - case 53: - return $this->getDbContributor(); - break; - case 54: - return $this->getDbLanguage(); - break; - case 55: - return $this->getDbSoundcloudId(); - break; - case 56: - return $this->getDbSoundcloudErrorCode(); - break; - case 57: - return $this->getDbSoundcloudErrorMsg(); - break; - case 58: - return $this->getDbSoundcloudLinkToFile(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcFilesPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbGunid(), - $keys[2] => $this->getDbName(), - $keys[3] => $this->getDbMime(), - $keys[4] => $this->getDbFtype(), - $keys[5] => $this->getDbDirectory(), - $keys[6] => $this->getDbFilepath(), - $keys[7] => $this->getDbState(), - $keys[8] => $this->getDbCurrentlyaccessing(), - $keys[9] => $this->getDbEditedby(), - $keys[10] => $this->getDbMtime(), - $keys[11] => $this->getDbMd5(), - $keys[12] => $this->getDbTrackTitle(), - $keys[13] => $this->getDbArtistName(), - $keys[14] => $this->getDbBitRate(), - $keys[15] => $this->getDbSampleRate(), - $keys[16] => $this->getDbFormat(), - $keys[17] => $this->getDbLength(), - $keys[18] => $this->getDbAlbumTitle(), - $keys[19] => $this->getDbGenre(), - $keys[20] => $this->getDbComments(), - $keys[21] => $this->getDbYear(), - $keys[22] => $this->getDbTrackNumber(), - $keys[23] => $this->getDbChannels(), - $keys[24] => $this->getDbUrl(), - $keys[25] => $this->getDbBpm(), - $keys[26] => $this->getDbRating(), - $keys[27] => $this->getDbEncodedBy(), - $keys[28] => $this->getDbDiscNumber(), - $keys[29] => $this->getDbMood(), - $keys[30] => $this->getDbLabel(), - $keys[31] => $this->getDbComposer(), - $keys[32] => $this->getDbEncoder(), - $keys[33] => $this->getDbChecksum(), - $keys[34] => $this->getDbLyrics(), - $keys[35] => $this->getDbOrchestra(), - $keys[36] => $this->getDbConductor(), - $keys[37] => $this->getDbLyricist(), - $keys[38] => $this->getDbOriginalLyricist(), - $keys[39] => $this->getDbRadioStationName(), - $keys[40] => $this->getDbInfoUrl(), - $keys[41] => $this->getDbArtistUrl(), - $keys[42] => $this->getDbAudioSourceUrl(), - $keys[43] => $this->getDbRadioStationUrl(), - $keys[44] => $this->getDbBuyThisUrl(), - $keys[45] => $this->getDbIsrcNumber(), - $keys[46] => $this->getDbCatalogNumber(), - $keys[47] => $this->getDbOriginalArtist(), - $keys[48] => $this->getDbCopyright(), - $keys[49] => $this->getDbReportDatetime(), - $keys[50] => $this->getDbReportLocation(), - $keys[51] => $this->getDbReportOrganization(), - $keys[52] => $this->getDbSubject(), - $keys[53] => $this->getDbContributor(), - $keys[54] => $this->getDbLanguage(), - $keys[55] => $this->getDbSoundcloudId(), - $keys[56] => $this->getDbSoundcloudErrorCode(), - $keys[57] => $this->getDbSoundcloudErrorMsg(), - $keys[58] => $this->getDbSoundcloudLinkToFile(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcMusicDirs) { - $result['CcMusicDirs'] = $this->aCcMusicDirs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcFilesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbGunid($value); - break; - case 2: - $this->setDbName($value); - break; - case 3: - $this->setDbMime($value); - break; - case 4: - $this->setDbFtype($value); - break; - case 5: - $this->setDbDirectory($value); - break; - case 6: - $this->setDbFilepath($value); - break; - case 7: - $this->setDbState($value); - break; - case 8: - $this->setDbCurrentlyaccessing($value); - break; - case 9: - $this->setDbEditedby($value); - break; - case 10: - $this->setDbMtime($value); - break; - case 11: - $this->setDbMd5($value); - break; - case 12: - $this->setDbTrackTitle($value); - break; - case 13: - $this->setDbArtistName($value); - break; - case 14: - $this->setDbBitRate($value); - break; - case 15: - $this->setDbSampleRate($value); - break; - case 16: - $this->setDbFormat($value); - break; - case 17: - $this->setDbLength($value); - break; - case 18: - $this->setDbAlbumTitle($value); - break; - case 19: - $this->setDbGenre($value); - break; - case 20: - $this->setDbComments($value); - break; - case 21: - $this->setDbYear($value); - break; - case 22: - $this->setDbTrackNumber($value); - break; - case 23: - $this->setDbChannels($value); - break; - case 24: - $this->setDbUrl($value); - break; - case 25: - $this->setDbBpm($value); - break; - case 26: - $this->setDbRating($value); - break; - case 27: - $this->setDbEncodedBy($value); - break; - case 28: - $this->setDbDiscNumber($value); - break; - case 29: - $this->setDbMood($value); - break; - case 30: - $this->setDbLabel($value); - break; - case 31: - $this->setDbComposer($value); - break; - case 32: - $this->setDbEncoder($value); - break; - case 33: - $this->setDbChecksum($value); - break; - case 34: - $this->setDbLyrics($value); - break; - case 35: - $this->setDbOrchestra($value); - break; - case 36: - $this->setDbConductor($value); - break; - case 37: - $this->setDbLyricist($value); - break; - case 38: - $this->setDbOriginalLyricist($value); - break; - case 39: - $this->setDbRadioStationName($value); - break; - case 40: - $this->setDbInfoUrl($value); - break; - case 41: - $this->setDbArtistUrl($value); - break; - case 42: - $this->setDbAudioSourceUrl($value); - break; - case 43: - $this->setDbRadioStationUrl($value); - break; - case 44: - $this->setDbBuyThisUrl($value); - break; - case 45: - $this->setDbIsrcNumber($value); - break; - case 46: - $this->setDbCatalogNumber($value); - break; - case 47: - $this->setDbOriginalArtist($value); - break; - case 48: - $this->setDbCopyright($value); - break; - case 49: - $this->setDbReportDatetime($value); - break; - case 50: - $this->setDbReportLocation($value); - break; - case 51: - $this->setDbReportOrganization($value); - break; - case 52: - $this->setDbSubject($value); - break; - case 53: - $this->setDbContributor($value); - break; - case 54: - $this->setDbLanguage($value); - break; - case 55: - $this->setDbSoundcloudId($value); - break; - case 56: - $this->setDbSoundcloudErrorCode($value); - break; - case 57: - $this->setDbSoundcloudErrorMsg($value); - break; - case 58: - $this->setDbSoundcloudLinkToFile($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcFilesPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbGunid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbName($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbMime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbFtype($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbDirectory($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbFilepath($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbState($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbEditedby($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbMtime($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDbMd5($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setDbTrackTitle($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setDbArtistName($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setDbBitRate($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setDbSampleRate($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setDbFormat($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setDbLength($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setDbAlbumTitle($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setDbGenre($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setDbComments($arr[$keys[20]]); - if (array_key_exists($keys[21], $arr)) $this->setDbYear($arr[$keys[21]]); - if (array_key_exists($keys[22], $arr)) $this->setDbTrackNumber($arr[$keys[22]]); - if (array_key_exists($keys[23], $arr)) $this->setDbChannels($arr[$keys[23]]); - if (array_key_exists($keys[24], $arr)) $this->setDbUrl($arr[$keys[24]]); - if (array_key_exists($keys[25], $arr)) $this->setDbBpm($arr[$keys[25]]); - if (array_key_exists($keys[26], $arr)) $this->setDbRating($arr[$keys[26]]); - if (array_key_exists($keys[27], $arr)) $this->setDbEncodedBy($arr[$keys[27]]); - if (array_key_exists($keys[28], $arr)) $this->setDbDiscNumber($arr[$keys[28]]); - if (array_key_exists($keys[29], $arr)) $this->setDbMood($arr[$keys[29]]); - if (array_key_exists($keys[30], $arr)) $this->setDbLabel($arr[$keys[30]]); - if (array_key_exists($keys[31], $arr)) $this->setDbComposer($arr[$keys[31]]); - if (array_key_exists($keys[32], $arr)) $this->setDbEncoder($arr[$keys[32]]); - if (array_key_exists($keys[33], $arr)) $this->setDbChecksum($arr[$keys[33]]); - if (array_key_exists($keys[34], $arr)) $this->setDbLyrics($arr[$keys[34]]); - if (array_key_exists($keys[35], $arr)) $this->setDbOrchestra($arr[$keys[35]]); - if (array_key_exists($keys[36], $arr)) $this->setDbConductor($arr[$keys[36]]); - if (array_key_exists($keys[37], $arr)) $this->setDbLyricist($arr[$keys[37]]); - if (array_key_exists($keys[38], $arr)) $this->setDbOriginalLyricist($arr[$keys[38]]); - if (array_key_exists($keys[39], $arr)) $this->setDbRadioStationName($arr[$keys[39]]); - if (array_key_exists($keys[40], $arr)) $this->setDbInfoUrl($arr[$keys[40]]); - if (array_key_exists($keys[41], $arr)) $this->setDbArtistUrl($arr[$keys[41]]); - if (array_key_exists($keys[42], $arr)) $this->setDbAudioSourceUrl($arr[$keys[42]]); - if (array_key_exists($keys[43], $arr)) $this->setDbRadioStationUrl($arr[$keys[43]]); - if (array_key_exists($keys[44], $arr)) $this->setDbBuyThisUrl($arr[$keys[44]]); - if (array_key_exists($keys[45], $arr)) $this->setDbIsrcNumber($arr[$keys[45]]); - if (array_key_exists($keys[46], $arr)) $this->setDbCatalogNumber($arr[$keys[46]]); - if (array_key_exists($keys[47], $arr)) $this->setDbOriginalArtist($arr[$keys[47]]); - if (array_key_exists($keys[48], $arr)) $this->setDbCopyright($arr[$keys[48]]); - if (array_key_exists($keys[49], $arr)) $this->setDbReportDatetime($arr[$keys[49]]); - if (array_key_exists($keys[50], $arr)) $this->setDbReportLocation($arr[$keys[50]]); - if (array_key_exists($keys[51], $arr)) $this->setDbReportOrganization($arr[$keys[51]]); - if (array_key_exists($keys[52], $arr)) $this->setDbSubject($arr[$keys[52]]); - if (array_key_exists($keys[53], $arr)) $this->setDbContributor($arr[$keys[53]]); - if (array_key_exists($keys[54], $arr)) $this->setDbLanguage($arr[$keys[54]]); - if (array_key_exists($keys[55], $arr)) $this->setDbSoundcloudId($arr[$keys[55]]); - if (array_key_exists($keys[56], $arr)) $this->setDbSoundcloudErrorCode($arr[$keys[56]]); - if (array_key_exists($keys[57], $arr)) $this->setDbSoundcloudErrorMsg($arr[$keys[57]]); - if (array_key_exists($keys[58], $arr)) $this->setDbSoundcloudLinkToFile($arr[$keys[58]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcFilesPeer::ID)) $criteria->add(CcFilesPeer::ID, $this->id); - if ($this->isColumnModified(CcFilesPeer::GUNID)) $criteria->add(CcFilesPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcFilesPeer::NAME)) $criteria->add(CcFilesPeer::NAME, $this->name); - if ($this->isColumnModified(CcFilesPeer::MIME)) $criteria->add(CcFilesPeer::MIME, $this->mime); - if ($this->isColumnModified(CcFilesPeer::FTYPE)) $criteria->add(CcFilesPeer::FTYPE, $this->ftype); - if ($this->isColumnModified(CcFilesPeer::DIRECTORY)) $criteria->add(CcFilesPeer::DIRECTORY, $this->directory); - if ($this->isColumnModified(CcFilesPeer::FILEPATH)) $criteria->add(CcFilesPeer::FILEPATH, $this->filepath); - if ($this->isColumnModified(CcFilesPeer::STATE)) $criteria->add(CcFilesPeer::STATE, $this->state); - if ($this->isColumnModified(CcFilesPeer::CURRENTLYACCESSING)) $criteria->add(CcFilesPeer::CURRENTLYACCESSING, $this->currentlyaccessing); - if ($this->isColumnModified(CcFilesPeer::EDITEDBY)) $criteria->add(CcFilesPeer::EDITEDBY, $this->editedby); - if ($this->isColumnModified(CcFilesPeer::MTIME)) $criteria->add(CcFilesPeer::MTIME, $this->mtime); - if ($this->isColumnModified(CcFilesPeer::MD5)) $criteria->add(CcFilesPeer::MD5, $this->md5); - if ($this->isColumnModified(CcFilesPeer::TRACK_TITLE)) $criteria->add(CcFilesPeer::TRACK_TITLE, $this->track_title); - if ($this->isColumnModified(CcFilesPeer::ARTIST_NAME)) $criteria->add(CcFilesPeer::ARTIST_NAME, $this->artist_name); - if ($this->isColumnModified(CcFilesPeer::BIT_RATE)) $criteria->add(CcFilesPeer::BIT_RATE, $this->bit_rate); - if ($this->isColumnModified(CcFilesPeer::SAMPLE_RATE)) $criteria->add(CcFilesPeer::SAMPLE_RATE, $this->sample_rate); - if ($this->isColumnModified(CcFilesPeer::FORMAT)) $criteria->add(CcFilesPeer::FORMAT, $this->format); - if ($this->isColumnModified(CcFilesPeer::LENGTH)) $criteria->add(CcFilesPeer::LENGTH, $this->length); - if ($this->isColumnModified(CcFilesPeer::ALBUM_TITLE)) $criteria->add(CcFilesPeer::ALBUM_TITLE, $this->album_title); - if ($this->isColumnModified(CcFilesPeer::GENRE)) $criteria->add(CcFilesPeer::GENRE, $this->genre); - if ($this->isColumnModified(CcFilesPeer::COMMENTS)) $criteria->add(CcFilesPeer::COMMENTS, $this->comments); - if ($this->isColumnModified(CcFilesPeer::YEAR)) $criteria->add(CcFilesPeer::YEAR, $this->year); - if ($this->isColumnModified(CcFilesPeer::TRACK_NUMBER)) $criteria->add(CcFilesPeer::TRACK_NUMBER, $this->track_number); - if ($this->isColumnModified(CcFilesPeer::CHANNELS)) $criteria->add(CcFilesPeer::CHANNELS, $this->channels); - if ($this->isColumnModified(CcFilesPeer::URL)) $criteria->add(CcFilesPeer::URL, $this->url); - if ($this->isColumnModified(CcFilesPeer::BPM)) $criteria->add(CcFilesPeer::BPM, $this->bpm); - if ($this->isColumnModified(CcFilesPeer::RATING)) $criteria->add(CcFilesPeer::RATING, $this->rating); - if ($this->isColumnModified(CcFilesPeer::ENCODED_BY)) $criteria->add(CcFilesPeer::ENCODED_BY, $this->encoded_by); - if ($this->isColumnModified(CcFilesPeer::DISC_NUMBER)) $criteria->add(CcFilesPeer::DISC_NUMBER, $this->disc_number); - if ($this->isColumnModified(CcFilesPeer::MOOD)) $criteria->add(CcFilesPeer::MOOD, $this->mood); - if ($this->isColumnModified(CcFilesPeer::LABEL)) $criteria->add(CcFilesPeer::LABEL, $this->label); - if ($this->isColumnModified(CcFilesPeer::COMPOSER)) $criteria->add(CcFilesPeer::COMPOSER, $this->composer); - if ($this->isColumnModified(CcFilesPeer::ENCODER)) $criteria->add(CcFilesPeer::ENCODER, $this->encoder); - if ($this->isColumnModified(CcFilesPeer::CHECKSUM)) $criteria->add(CcFilesPeer::CHECKSUM, $this->checksum); - if ($this->isColumnModified(CcFilesPeer::LYRICS)) $criteria->add(CcFilesPeer::LYRICS, $this->lyrics); - if ($this->isColumnModified(CcFilesPeer::ORCHESTRA)) $criteria->add(CcFilesPeer::ORCHESTRA, $this->orchestra); - if ($this->isColumnModified(CcFilesPeer::CONDUCTOR)) $criteria->add(CcFilesPeer::CONDUCTOR, $this->conductor); - if ($this->isColumnModified(CcFilesPeer::LYRICIST)) $criteria->add(CcFilesPeer::LYRICIST, $this->lyricist); - if ($this->isColumnModified(CcFilesPeer::ORIGINAL_LYRICIST)) $criteria->add(CcFilesPeer::ORIGINAL_LYRICIST, $this->original_lyricist); - if ($this->isColumnModified(CcFilesPeer::RADIO_STATION_NAME)) $criteria->add(CcFilesPeer::RADIO_STATION_NAME, $this->radio_station_name); - if ($this->isColumnModified(CcFilesPeer::INFO_URL)) $criteria->add(CcFilesPeer::INFO_URL, $this->info_url); - if ($this->isColumnModified(CcFilesPeer::ARTIST_URL)) $criteria->add(CcFilesPeer::ARTIST_URL, $this->artist_url); - if ($this->isColumnModified(CcFilesPeer::AUDIO_SOURCE_URL)) $criteria->add(CcFilesPeer::AUDIO_SOURCE_URL, $this->audio_source_url); - if ($this->isColumnModified(CcFilesPeer::RADIO_STATION_URL)) $criteria->add(CcFilesPeer::RADIO_STATION_URL, $this->radio_station_url); - if ($this->isColumnModified(CcFilesPeer::BUY_THIS_URL)) $criteria->add(CcFilesPeer::BUY_THIS_URL, $this->buy_this_url); - if ($this->isColumnModified(CcFilesPeer::ISRC_NUMBER)) $criteria->add(CcFilesPeer::ISRC_NUMBER, $this->isrc_number); - if ($this->isColumnModified(CcFilesPeer::CATALOG_NUMBER)) $criteria->add(CcFilesPeer::CATALOG_NUMBER, $this->catalog_number); - if ($this->isColumnModified(CcFilesPeer::ORIGINAL_ARTIST)) $criteria->add(CcFilesPeer::ORIGINAL_ARTIST, $this->original_artist); - if ($this->isColumnModified(CcFilesPeer::COPYRIGHT)) $criteria->add(CcFilesPeer::COPYRIGHT, $this->copyright); - if ($this->isColumnModified(CcFilesPeer::REPORT_DATETIME)) $criteria->add(CcFilesPeer::REPORT_DATETIME, $this->report_datetime); - if ($this->isColumnModified(CcFilesPeer::REPORT_LOCATION)) $criteria->add(CcFilesPeer::REPORT_LOCATION, $this->report_location); - if ($this->isColumnModified(CcFilesPeer::REPORT_ORGANIZATION)) $criteria->add(CcFilesPeer::REPORT_ORGANIZATION, $this->report_organization); - if ($this->isColumnModified(CcFilesPeer::SUBJECT)) $criteria->add(CcFilesPeer::SUBJECT, $this->subject); - if ($this->isColumnModified(CcFilesPeer::CONTRIBUTOR)) $criteria->add(CcFilesPeer::CONTRIBUTOR, $this->contributor); - if ($this->isColumnModified(CcFilesPeer::LANGUAGE)) $criteria->add(CcFilesPeer::LANGUAGE, $this->language); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ID)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ID, $this->soundcloud_id); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_CODE)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $this->soundcloud_error_code); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_ERROR_MSG)) $criteria->add(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $this->soundcloud_error_msg); - if ($this->isColumnModified(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE)) $criteria->add(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, $this->soundcloud_link_to_file); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcFiles (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbGunid($this->gunid); - $copyObj->setDbName($this->name); - $copyObj->setDbMime($this->mime); - $copyObj->setDbFtype($this->ftype); - $copyObj->setDbDirectory($this->directory); - $copyObj->setDbFilepath($this->filepath); - $copyObj->setDbState($this->state); - $copyObj->setDbCurrentlyaccessing($this->currentlyaccessing); - $copyObj->setDbEditedby($this->editedby); - $copyObj->setDbMtime($this->mtime); - $copyObj->setDbMd5($this->md5); - $copyObj->setDbTrackTitle($this->track_title); - $copyObj->setDbArtistName($this->artist_name); - $copyObj->setDbBitRate($this->bit_rate); - $copyObj->setDbSampleRate($this->sample_rate); - $copyObj->setDbFormat($this->format); - $copyObj->setDbLength($this->length); - $copyObj->setDbAlbumTitle($this->album_title); - $copyObj->setDbGenre($this->genre); - $copyObj->setDbComments($this->comments); - $copyObj->setDbYear($this->year); - $copyObj->setDbTrackNumber($this->track_number); - $copyObj->setDbChannels($this->channels); - $copyObj->setDbUrl($this->url); - $copyObj->setDbBpm($this->bpm); - $copyObj->setDbRating($this->rating); - $copyObj->setDbEncodedBy($this->encoded_by); - $copyObj->setDbDiscNumber($this->disc_number); - $copyObj->setDbMood($this->mood); - $copyObj->setDbLabel($this->label); - $copyObj->setDbComposer($this->composer); - $copyObj->setDbEncoder($this->encoder); - $copyObj->setDbChecksum($this->checksum); - $copyObj->setDbLyrics($this->lyrics); - $copyObj->setDbOrchestra($this->orchestra); - $copyObj->setDbConductor($this->conductor); - $copyObj->setDbLyricist($this->lyricist); - $copyObj->setDbOriginalLyricist($this->original_lyricist); - $copyObj->setDbRadioStationName($this->radio_station_name); - $copyObj->setDbInfoUrl($this->info_url); - $copyObj->setDbArtistUrl($this->artist_url); - $copyObj->setDbAudioSourceUrl($this->audio_source_url); - $copyObj->setDbRadioStationUrl($this->radio_station_url); - $copyObj->setDbBuyThisUrl($this->buy_this_url); - $copyObj->setDbIsrcNumber($this->isrc_number); - $copyObj->setDbCatalogNumber($this->catalog_number); - $copyObj->setDbOriginalArtist($this->original_artist); - $copyObj->setDbCopyright($this->copyright); - $copyObj->setDbReportDatetime($this->report_datetime); - $copyObj->setDbReportLocation($this->report_location); - $copyObj->setDbReportOrganization($this->report_organization); - $copyObj->setDbSubject($this->subject); - $copyObj->setDbContributor($this->contributor); - $copyObj->setDbLanguage($this->language); - $copyObj->setDbSoundcloudId($this->soundcloud_id); - $copyObj->setDbSoundcloudErrorCode($this->soundcloud_error_code); - $copyObj->setDbSoundcloudErrorMsg($this->soundcloud_error_msg); - $copyObj->setDbSoundcloudLinkToFile($this->soundcloud_link_to_file); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $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->getCcPlaylistcontentss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylistcontents($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSchedules() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSchedule($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcFiles Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcFilesPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcFilesPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcFiles The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbEditedby(NULL); - } else { - $this->setDbEditedby($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcFiles($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->editedby !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->editedby, $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->aCcSubjs->addCcFiless($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Declares an association between this object and a CcMusicDirs object. - * - * @param CcMusicDirs $v - * @return CcFiles The current object (for fluent API support) - * @throws PropelException - */ - public function setCcMusicDirs(CcMusicDirs $v = null) - { - if ($v === null) { - $this->setDbDirectory(NULL); - } else { - $this->setDbDirectory($v->getId()); - } - - $this->aCcMusicDirs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcMusicDirs object, it will not be re-added. - if ($v !== null) { - $v->addCcFiles($this); - } - - return $this; - } - - - /** - * Get the associated CcMusicDirs object - * - * @param PropelPDO Optional Connection object. - * @return CcMusicDirs The associated CcMusicDirs object. - * @throws PropelException - */ - public function getCcMusicDirs(PropelPDO $con = null) - { - if ($this->aCcMusicDirs === null && ($this->directory !== null)) { - $this->aCcMusicDirs = CcMusicDirsQuery::create()->findPk($this->directory, $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->aCcMusicDirs->addCcFiless($this); - */ - } - return $this->aCcMusicDirs; - } - - /** - * 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 CcFiles 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) - ->filterByCcFiles($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 - ->filterByCcFiles($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->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShowInstancesRelatedByDbOriginalShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShowInstancesRelatedByDbOriginalShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - /** - * Clears out the collCcPlaylistcontentss 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 addCcPlaylistcontentss() - */ - public function clearCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylistcontentss collection. - * - * By default this just sets the collCcPlaylistcontentss collection to an empty array (like clearcollCcPlaylistcontentss()); - * 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 initCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = new PropelObjectCollection(); - $this->collCcPlaylistcontentss->setModel('CcPlaylistcontents'); - } - - /** - * Gets an array of CcPlaylistcontents 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 CcFiles 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 CcPlaylistcontents[] List of CcPlaylistcontents objects - * @throws PropelException - */ - public function getCcPlaylistcontentss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - // return empty collection - $this->initCcPlaylistcontentss(); - } else { - $collCcPlaylistcontentss = CcPlaylistcontentsQuery::create(null, $criteria) - ->filterByCcFiles($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylistcontentss; - } - $this->collCcPlaylistcontentss = $collCcPlaylistcontentss; - } - } - return $this->collCcPlaylistcontentss; - } - - /** - * Returns the number of related CcPlaylistcontents objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylistcontents objects. - * @throws PropelException - */ - public function countCcPlaylistcontentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - return 0; - } else { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcFiles($this) - ->count($con); - } - } else { - return count($this->collCcPlaylistcontentss); - } - } - - /** - * Method called to associate a CcPlaylistcontents object to this object - * through the CcPlaylistcontents foreign key attribute. - * - * @param CcPlaylistcontents $l CcPlaylistcontents - * @return void - * @throws PropelException - */ - public function addCcPlaylistcontents(CcPlaylistcontents $l) - { - if ($this->collCcPlaylistcontentss === null) { - $this->initCcPlaylistcontentss(); - } - if (!$this->collCcPlaylistcontentss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylistcontentss[]= $l; - $l->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcPlaylistcontentss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects - */ - public function getCcPlaylistcontentssJoinCcPlaylist($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - $query->joinWith('CcPlaylist', $join_behavior); - - return $this->getCcPlaylistcontentss($query, $con); - } - - /** - * Clears out the collCcSchedules 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 addCcSchedules() - */ - public function clearCcSchedules() - { - $this->collCcSchedules = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSchedules collection. - * - * By default this just sets the collCcSchedules collection to an empty array (like clearcollCcSchedules()); - * 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 initCcSchedules() - { - $this->collCcSchedules = new PropelObjectCollection(); - $this->collCcSchedules->setModel('CcSchedule'); - } - - /** - * Gets an array of CcSchedule 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 CcFiles 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 CcSchedule[] List of CcSchedule objects - * @throws PropelException - */ - public function getCcSchedules($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - // return empty collection - $this->initCcSchedules(); - } else { - $collCcSchedules = CcScheduleQuery::create(null, $criteria) - ->filterByCcFiles($this) - ->find($con); - if (null !== $criteria) { - return $collCcSchedules; - } - $this->collCcSchedules = $collCcSchedules; - } - } - return $this->collCcSchedules; - } - - /** - * Returns the number of related CcSchedule objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSchedule objects. - * @throws PropelException - */ - public function countCcSchedules(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - return 0; - } else { - $query = CcScheduleQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcFiles($this) - ->count($con); - } - } else { - return count($this->collCcSchedules); - } - } - - /** - * Method called to associate a CcSchedule object to this object - * through the CcSchedule foreign key attribute. - * - * @param CcSchedule $l CcSchedule - * @return void - * @throws PropelException - */ - public function addCcSchedule(CcSchedule $l) - { - if ($this->collCcSchedules === null) { - $this->initCcSchedules(); - } - if (!$this->collCcSchedules->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSchedules[]= $l; - $l->setCcFiles($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcFiles is new, it will return - * an empty collection; or if this CcFiles has previously - * been saved, it will retrieve related CcSchedules from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcFiles. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcSchedule[] List of CcSchedule objects - */ - public function getCcSchedulesJoinCcShowInstances($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcScheduleQuery::create(null, $criteria); - $query->joinWith('CcShowInstances', $join_behavior); - - return $this->getCcSchedules($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->gunid = null; - $this->name = null; - $this->mime = null; - $this->ftype = null; - $this->directory = null; - $this->filepath = null; - $this->state = null; - $this->currentlyaccessing = null; - $this->editedby = null; - $this->mtime = null; - $this->md5 = null; - $this->track_title = null; - $this->artist_name = null; - $this->bit_rate = null; - $this->sample_rate = null; - $this->format = null; - $this->length = null; - $this->album_title = null; - $this->genre = null; - $this->comments = null; - $this->year = null; - $this->track_number = null; - $this->channels = null; - $this->url = null; - $this->bpm = null; - $this->rating = null; - $this->encoded_by = null; - $this->disc_number = null; - $this->mood = null; - $this->label = null; - $this->composer = null; - $this->encoder = null; - $this->checksum = null; - $this->lyrics = null; - $this->orchestra = null; - $this->conductor = null; - $this->lyricist = null; - $this->original_lyricist = null; - $this->radio_station_name = null; - $this->info_url = null; - $this->artist_url = null; - $this->audio_source_url = null; - $this->radio_station_url = null; - $this->buy_this_url = null; - $this->isrc_number = null; - $this->catalog_number = null; - $this->original_artist = null; - $this->copyright = null; - $this->report_datetime = null; - $this->report_location = null; - $this->report_organization = null; - $this->subject = null; - $this->contributor = null; - $this->language = null; - $this->soundcloud_id = null; - $this->soundcloud_error_code = null; - $this->soundcloud_error_msg = null; - $this->soundcloud_link_to_file = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancess) { - foreach ((array) $this->collCcShowInstancess as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPlaylistcontentss) { - foreach ((array) $this->collCcPlaylistcontentss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSchedules) { - foreach ((array) $this->collCcSchedules as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancess = null; - $this->collCcPlaylistcontentss = null; - $this->collCcSchedules = null; - $this->aCcSubjs = null; - $this->aCcMusicDirs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcFiles diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesPeer.php deleted file mode 100644 index e08728cfd..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesPeer.php +++ /dev/null @@ -1,1654 +0,0 @@ - array ('DbId', 'DbGunid', 'DbName', 'DbMime', 'DbFtype', 'DbDirectory', 'DbFilepath', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbMd5', 'DbTrackTitle', 'DbArtistName', 'DbBitRate', 'DbSampleRate', 'DbFormat', 'DbLength', 'DbAlbumTitle', 'DbGenre', 'DbComments', 'DbYear', 'DbTrackNumber', 'DbChannels', 'DbUrl', 'DbBpm', 'DbRating', 'DbEncodedBy', 'DbDiscNumber', 'DbMood', 'DbLabel', 'DbComposer', 'DbEncoder', 'DbChecksum', 'DbLyrics', 'DbOrchestra', 'DbConductor', 'DbLyricist', 'DbOriginalLyricist', 'DbRadioStationName', 'DbInfoUrl', 'DbArtistUrl', 'DbAudioSourceUrl', 'DbRadioStationUrl', 'DbBuyThisUrl', 'DbIsrcNumber', 'DbCatalogNumber', 'DbOriginalArtist', 'DbCopyright', 'DbReportDatetime', 'DbReportLocation', 'DbReportOrganization', 'DbSubject', 'DbContributor', 'DbLanguage', 'DbSoundcloudId', 'DbSoundcloudErrorCode', 'DbSoundcloudErrorMsg', 'DbSoundcloudLinkToFile', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbGunid', 'dbName', 'dbMime', 'dbFtype', 'dbDirectory', 'dbFilepath', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbMd5', 'dbTrackTitle', 'dbArtistName', 'dbBitRate', 'dbSampleRate', 'dbFormat', 'dbLength', 'dbAlbumTitle', 'dbGenre', 'dbComments', 'dbYear', 'dbTrackNumber', 'dbChannels', 'dbUrl', 'dbBpm', 'dbRating', 'dbEncodedBy', 'dbDiscNumber', 'dbMood', 'dbLabel', 'dbComposer', 'dbEncoder', 'dbChecksum', 'dbLyrics', 'dbOrchestra', 'dbConductor', 'dbLyricist', 'dbOriginalLyricist', 'dbRadioStationName', 'dbInfoUrl', 'dbArtistUrl', 'dbAudioSourceUrl', 'dbRadioStationUrl', 'dbBuyThisUrl', 'dbIsrcNumber', 'dbCatalogNumber', 'dbOriginalArtist', 'dbCopyright', 'dbReportDatetime', 'dbReportLocation', 'dbReportOrganization', 'dbSubject', 'dbContributor', 'dbLanguage', 'dbSoundcloudId', 'dbSoundcloudErrorCode', 'dbSoundcloudErrorMsg', 'dbSoundcloudLinkToFile', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::GUNID, self::NAME, self::MIME, self::FTYPE, self::DIRECTORY, self::FILEPATH, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::MD5, self::TRACK_TITLE, self::ARTIST_NAME, self::BIT_RATE, self::SAMPLE_RATE, self::FORMAT, self::LENGTH, self::ALBUM_TITLE, self::GENRE, self::COMMENTS, self::YEAR, self::TRACK_NUMBER, self::CHANNELS, self::URL, self::BPM, self::RATING, self::ENCODED_BY, self::DISC_NUMBER, self::MOOD, self::LABEL, self::COMPOSER, self::ENCODER, self::CHECKSUM, self::LYRICS, self::ORCHESTRA, self::CONDUCTOR, self::LYRICIST, self::ORIGINAL_LYRICIST, self::RADIO_STATION_NAME, self::INFO_URL, self::ARTIST_URL, self::AUDIO_SOURCE_URL, self::RADIO_STATION_URL, self::BUY_THIS_URL, self::ISRC_NUMBER, self::CATALOG_NUMBER, self::ORIGINAL_ARTIST, self::COPYRIGHT, self::REPORT_DATETIME, self::REPORT_LOCATION, self::REPORT_ORGANIZATION, self::SUBJECT, self::CONTRIBUTOR, self::LANGUAGE, self::SOUNDCLOUD_ID, self::SOUNDCLOUD_ERROR_CODE, self::SOUNDCLOUD_ERROR_MSG, self::SOUNDCLOUD_LINK_TO_FILE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GUNID', 'NAME', 'MIME', 'FTYPE', 'DIRECTORY', 'FILEPATH', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'MD5', 'TRACK_TITLE', 'ARTIST_NAME', 'BIT_RATE', 'SAMPLE_RATE', 'FORMAT', 'LENGTH', 'ALBUM_TITLE', 'GENRE', 'COMMENTS', 'YEAR', 'TRACK_NUMBER', 'CHANNELS', 'URL', 'BPM', 'RATING', 'ENCODED_BY', 'DISC_NUMBER', 'MOOD', 'LABEL', 'COMPOSER', 'ENCODER', 'CHECKSUM', 'LYRICS', 'ORCHESTRA', 'CONDUCTOR', 'LYRICIST', 'ORIGINAL_LYRICIST', 'RADIO_STATION_NAME', 'INFO_URL', 'ARTIST_URL', 'AUDIO_SOURCE_URL', 'RADIO_STATION_URL', 'BUY_THIS_URL', 'ISRC_NUMBER', 'CATALOG_NUMBER', 'ORIGINAL_ARTIST', 'COPYRIGHT', 'REPORT_DATETIME', 'REPORT_LOCATION', 'REPORT_ORGANIZATION', 'SUBJECT', 'CONTRIBUTOR', 'LANGUAGE', 'SOUNDCLOUD_ID', 'SOUNDCLOUD_ERROR_CODE', 'SOUNDCLOUD_ERROR_MSG', 'SOUNDCLOUD_LINK_TO_FILE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'gunid', 'name', 'mime', 'ftype', 'directory', 'filepath', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'md5', 'track_title', 'artist_name', 'bit_rate', 'sample_rate', 'format', 'length', 'album_title', 'genre', 'comments', 'year', 'track_number', 'channels', 'url', 'bpm', 'rating', 'encoded_by', 'disc_number', 'mood', 'label', 'composer', 'encoder', 'checksum', 'lyrics', 'orchestra', 'conductor', 'lyricist', 'original_lyricist', 'radio_station_name', 'info_url', 'artist_url', 'audio_source_url', 'radio_station_url', 'buy_this_url', 'isrc_number', 'catalog_number', 'original_artist', 'copyright', 'report_datetime', 'report_location', 'report_organization', 'subject', 'contributor', 'language', 'soundcloud_id', 'soundcloud_error_code', 'soundcloud_error_msg', 'soundcloud_link_to_file', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, ) - ); - - /** - * 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, 'DbGunid' => 1, 'DbName' => 2, 'DbMime' => 3, 'DbFtype' => 4, 'DbDirectory' => 5, 'DbFilepath' => 6, 'DbState' => 7, 'DbCurrentlyaccessing' => 8, 'DbEditedby' => 9, 'DbMtime' => 10, 'DbMd5' => 11, 'DbTrackTitle' => 12, 'DbArtistName' => 13, 'DbBitRate' => 14, 'DbSampleRate' => 15, 'DbFormat' => 16, 'DbLength' => 17, 'DbAlbumTitle' => 18, 'DbGenre' => 19, 'DbComments' => 20, 'DbYear' => 21, 'DbTrackNumber' => 22, 'DbChannels' => 23, 'DbUrl' => 24, 'DbBpm' => 25, 'DbRating' => 26, 'DbEncodedBy' => 27, 'DbDiscNumber' => 28, 'DbMood' => 29, 'DbLabel' => 30, 'DbComposer' => 31, 'DbEncoder' => 32, 'DbChecksum' => 33, 'DbLyrics' => 34, 'DbOrchestra' => 35, 'DbConductor' => 36, 'DbLyricist' => 37, 'DbOriginalLyricist' => 38, 'DbRadioStationName' => 39, 'DbInfoUrl' => 40, 'DbArtistUrl' => 41, 'DbAudioSourceUrl' => 42, 'DbRadioStationUrl' => 43, 'DbBuyThisUrl' => 44, 'DbIsrcNumber' => 45, 'DbCatalogNumber' => 46, 'DbOriginalArtist' => 47, 'DbCopyright' => 48, 'DbReportDatetime' => 49, 'DbReportLocation' => 50, 'DbReportOrganization' => 51, 'DbSubject' => 52, 'DbContributor' => 53, 'DbLanguage' => 54, 'DbSoundcloudId' => 55, 'DbSoundcloudErrorCode' => 56, 'DbSoundcloudErrorMsg' => 57, 'DbSoundcloudLinkToFile' => 58, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbGunid' => 1, 'dbName' => 2, 'dbMime' => 3, 'dbFtype' => 4, 'dbDirectory' => 5, 'dbFilepath' => 6, 'dbState' => 7, 'dbCurrentlyaccessing' => 8, 'dbEditedby' => 9, 'dbMtime' => 10, 'dbMd5' => 11, 'dbTrackTitle' => 12, 'dbArtistName' => 13, 'dbBitRate' => 14, 'dbSampleRate' => 15, 'dbFormat' => 16, 'dbLength' => 17, 'dbAlbumTitle' => 18, 'dbGenre' => 19, 'dbComments' => 20, 'dbYear' => 21, 'dbTrackNumber' => 22, 'dbChannels' => 23, 'dbUrl' => 24, 'dbBpm' => 25, 'dbRating' => 26, 'dbEncodedBy' => 27, 'dbDiscNumber' => 28, 'dbMood' => 29, 'dbLabel' => 30, 'dbComposer' => 31, 'dbEncoder' => 32, 'dbChecksum' => 33, 'dbLyrics' => 34, 'dbOrchestra' => 35, 'dbConductor' => 36, 'dbLyricist' => 37, 'dbOriginalLyricist' => 38, 'dbRadioStationName' => 39, 'dbInfoUrl' => 40, 'dbArtistUrl' => 41, 'dbAudioSourceUrl' => 42, 'dbRadioStationUrl' => 43, 'dbBuyThisUrl' => 44, 'dbIsrcNumber' => 45, 'dbCatalogNumber' => 46, 'dbOriginalArtist' => 47, 'dbCopyright' => 48, 'dbReportDatetime' => 49, 'dbReportLocation' => 50, 'dbReportOrganization' => 51, 'dbSubject' => 52, 'dbContributor' => 53, 'dbLanguage' => 54, 'dbSoundcloudId' => 55, 'dbSoundcloudErrorCode' => 56, 'dbSoundcloudErrorMsg' => 57, 'dbSoundcloudLinkToFile' => 58, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::GUNID => 1, self::NAME => 2, self::MIME => 3, self::FTYPE => 4, self::DIRECTORY => 5, self::FILEPATH => 6, self::STATE => 7, self::CURRENTLYACCESSING => 8, self::EDITEDBY => 9, self::MTIME => 10, self::MD5 => 11, self::TRACK_TITLE => 12, self::ARTIST_NAME => 13, self::BIT_RATE => 14, self::SAMPLE_RATE => 15, self::FORMAT => 16, self::LENGTH => 17, self::ALBUM_TITLE => 18, self::GENRE => 19, self::COMMENTS => 20, self::YEAR => 21, self::TRACK_NUMBER => 22, self::CHANNELS => 23, self::URL => 24, self::BPM => 25, self::RATING => 26, self::ENCODED_BY => 27, self::DISC_NUMBER => 28, self::MOOD => 29, self::LABEL => 30, self::COMPOSER => 31, self::ENCODER => 32, self::CHECKSUM => 33, self::LYRICS => 34, self::ORCHESTRA => 35, self::CONDUCTOR => 36, self::LYRICIST => 37, self::ORIGINAL_LYRICIST => 38, self::RADIO_STATION_NAME => 39, self::INFO_URL => 40, self::ARTIST_URL => 41, self::AUDIO_SOURCE_URL => 42, self::RADIO_STATION_URL => 43, self::BUY_THIS_URL => 44, self::ISRC_NUMBER => 45, self::CATALOG_NUMBER => 46, self::ORIGINAL_ARTIST => 47, self::COPYRIGHT => 48, self::REPORT_DATETIME => 49, self::REPORT_LOCATION => 50, self::REPORT_ORGANIZATION => 51, self::SUBJECT => 52, self::CONTRIBUTOR => 53, self::LANGUAGE => 54, self::SOUNDCLOUD_ID => 55, self::SOUNDCLOUD_ERROR_CODE => 56, self::SOUNDCLOUD_ERROR_MSG => 57, self::SOUNDCLOUD_LINK_TO_FILE => 58, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GUNID' => 1, 'NAME' => 2, 'MIME' => 3, 'FTYPE' => 4, 'DIRECTORY' => 5, 'FILEPATH' => 6, 'STATE' => 7, 'CURRENTLYACCESSING' => 8, 'EDITEDBY' => 9, 'MTIME' => 10, 'MD5' => 11, 'TRACK_TITLE' => 12, 'ARTIST_NAME' => 13, 'BIT_RATE' => 14, 'SAMPLE_RATE' => 15, 'FORMAT' => 16, 'LENGTH' => 17, 'ALBUM_TITLE' => 18, 'GENRE' => 19, 'COMMENTS' => 20, 'YEAR' => 21, 'TRACK_NUMBER' => 22, 'CHANNELS' => 23, 'URL' => 24, 'BPM' => 25, 'RATING' => 26, 'ENCODED_BY' => 27, 'DISC_NUMBER' => 28, 'MOOD' => 29, 'LABEL' => 30, 'COMPOSER' => 31, 'ENCODER' => 32, 'CHECKSUM' => 33, 'LYRICS' => 34, 'ORCHESTRA' => 35, 'CONDUCTOR' => 36, 'LYRICIST' => 37, 'ORIGINAL_LYRICIST' => 38, 'RADIO_STATION_NAME' => 39, 'INFO_URL' => 40, 'ARTIST_URL' => 41, 'AUDIO_SOURCE_URL' => 42, 'RADIO_STATION_URL' => 43, 'BUY_THIS_URL' => 44, 'ISRC_NUMBER' => 45, 'CATALOG_NUMBER' => 46, 'ORIGINAL_ARTIST' => 47, 'COPYRIGHT' => 48, 'REPORT_DATETIME' => 49, 'REPORT_LOCATION' => 50, 'REPORT_ORGANIZATION' => 51, 'SUBJECT' => 52, 'CONTRIBUTOR' => 53, 'LANGUAGE' => 54, 'SOUNDCLOUD_ID' => 55, 'SOUNDCLOUD_ERROR_CODE' => 56, 'SOUNDCLOUD_ERROR_MSG' => 57, 'SOUNDCLOUD_LINK_TO_FILE' => 58, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'gunid' => 1, 'name' => 2, 'mime' => 3, 'ftype' => 4, 'directory' => 5, 'filepath' => 6, 'state' => 7, 'currentlyaccessing' => 8, 'editedby' => 9, 'mtime' => 10, 'md5' => 11, 'track_title' => 12, 'artist_name' => 13, 'bit_rate' => 14, 'sample_rate' => 15, 'format' => 16, 'length' => 17, 'album_title' => 18, 'genre' => 19, 'comments' => 20, 'year' => 21, 'track_number' => 22, 'channels' => 23, 'url' => 24, 'bpm' => 25, 'rating' => 26, 'encoded_by' => 27, 'disc_number' => 28, 'mood' => 29, 'label' => 30, 'composer' => 31, 'encoder' => 32, 'checksum' => 33, 'lyrics' => 34, 'orchestra' => 35, 'conductor' => 36, 'lyricist' => 37, 'original_lyricist' => 38, 'radio_station_name' => 39, 'info_url' => 40, 'artist_url' => 41, 'audio_source_url' => 42, 'radio_station_url' => 43, 'buy_this_url' => 44, 'isrc_number' => 45, 'catalog_number' => 46, 'original_artist' => 47, 'copyright' => 48, 'report_datetime' => 49, 'report_location' => 50, 'report_organization' => 51, 'subject' => 52, 'contributor' => 53, 'language' => 54, 'soundcloud_id' => 55, 'soundcloud_error_code' => 56, 'soundcloud_error_msg' => 57, 'soundcloud_link_to_file' => 58, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcFilesPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcFilesPeer::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(CcFilesPeer::ID); - $criteria->addSelectColumn(CcFilesPeer::GUNID); - $criteria->addSelectColumn(CcFilesPeer::NAME); - $criteria->addSelectColumn(CcFilesPeer::MIME); - $criteria->addSelectColumn(CcFilesPeer::FTYPE); - $criteria->addSelectColumn(CcFilesPeer::DIRECTORY); - $criteria->addSelectColumn(CcFilesPeer::FILEPATH); - $criteria->addSelectColumn(CcFilesPeer::STATE); - $criteria->addSelectColumn(CcFilesPeer::CURRENTLYACCESSING); - $criteria->addSelectColumn(CcFilesPeer::EDITEDBY); - $criteria->addSelectColumn(CcFilesPeer::MTIME); - $criteria->addSelectColumn(CcFilesPeer::MD5); - $criteria->addSelectColumn(CcFilesPeer::TRACK_TITLE); - $criteria->addSelectColumn(CcFilesPeer::ARTIST_NAME); - $criteria->addSelectColumn(CcFilesPeer::BIT_RATE); - $criteria->addSelectColumn(CcFilesPeer::SAMPLE_RATE); - $criteria->addSelectColumn(CcFilesPeer::FORMAT); - $criteria->addSelectColumn(CcFilesPeer::LENGTH); - $criteria->addSelectColumn(CcFilesPeer::ALBUM_TITLE); - $criteria->addSelectColumn(CcFilesPeer::GENRE); - $criteria->addSelectColumn(CcFilesPeer::COMMENTS); - $criteria->addSelectColumn(CcFilesPeer::YEAR); - $criteria->addSelectColumn(CcFilesPeer::TRACK_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::CHANNELS); - $criteria->addSelectColumn(CcFilesPeer::URL); - $criteria->addSelectColumn(CcFilesPeer::BPM); - $criteria->addSelectColumn(CcFilesPeer::RATING); - $criteria->addSelectColumn(CcFilesPeer::ENCODED_BY); - $criteria->addSelectColumn(CcFilesPeer::DISC_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::MOOD); - $criteria->addSelectColumn(CcFilesPeer::LABEL); - $criteria->addSelectColumn(CcFilesPeer::COMPOSER); - $criteria->addSelectColumn(CcFilesPeer::ENCODER); - $criteria->addSelectColumn(CcFilesPeer::CHECKSUM); - $criteria->addSelectColumn(CcFilesPeer::LYRICS); - $criteria->addSelectColumn(CcFilesPeer::ORCHESTRA); - $criteria->addSelectColumn(CcFilesPeer::CONDUCTOR); - $criteria->addSelectColumn(CcFilesPeer::LYRICIST); - $criteria->addSelectColumn(CcFilesPeer::ORIGINAL_LYRICIST); - $criteria->addSelectColumn(CcFilesPeer::RADIO_STATION_NAME); - $criteria->addSelectColumn(CcFilesPeer::INFO_URL); - $criteria->addSelectColumn(CcFilesPeer::ARTIST_URL); - $criteria->addSelectColumn(CcFilesPeer::AUDIO_SOURCE_URL); - $criteria->addSelectColumn(CcFilesPeer::RADIO_STATION_URL); - $criteria->addSelectColumn(CcFilesPeer::BUY_THIS_URL); - $criteria->addSelectColumn(CcFilesPeer::ISRC_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::CATALOG_NUMBER); - $criteria->addSelectColumn(CcFilesPeer::ORIGINAL_ARTIST); - $criteria->addSelectColumn(CcFilesPeer::COPYRIGHT); - $criteria->addSelectColumn(CcFilesPeer::REPORT_DATETIME); - $criteria->addSelectColumn(CcFilesPeer::REPORT_LOCATION); - $criteria->addSelectColumn(CcFilesPeer::REPORT_ORGANIZATION); - $criteria->addSelectColumn(CcFilesPeer::SUBJECT); - $criteria->addSelectColumn(CcFilesPeer::CONTRIBUTOR); - $criteria->addSelectColumn(CcFilesPeer::LANGUAGE); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ID); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_CODE); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_ERROR_MSG); - $criteria->addSelectColumn(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.MIME'); - $criteria->addSelectColumn($alias . '.FTYPE'); - $criteria->addSelectColumn($alias . '.DIRECTORY'); - $criteria->addSelectColumn($alias . '.FILEPATH'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.CURRENTLYACCESSING'); - $criteria->addSelectColumn($alias . '.EDITEDBY'); - $criteria->addSelectColumn($alias . '.MTIME'); - $criteria->addSelectColumn($alias . '.MD5'); - $criteria->addSelectColumn($alias . '.TRACK_TITLE'); - $criteria->addSelectColumn($alias . '.ARTIST_NAME'); - $criteria->addSelectColumn($alias . '.BIT_RATE'); - $criteria->addSelectColumn($alias . '.SAMPLE_RATE'); - $criteria->addSelectColumn($alias . '.FORMAT'); - $criteria->addSelectColumn($alias . '.LENGTH'); - $criteria->addSelectColumn($alias . '.ALBUM_TITLE'); - $criteria->addSelectColumn($alias . '.GENRE'); - $criteria->addSelectColumn($alias . '.COMMENTS'); - $criteria->addSelectColumn($alias . '.YEAR'); - $criteria->addSelectColumn($alias . '.TRACK_NUMBER'); - $criteria->addSelectColumn($alias . '.CHANNELS'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.BPM'); - $criteria->addSelectColumn($alias . '.RATING'); - $criteria->addSelectColumn($alias . '.ENCODED_BY'); - $criteria->addSelectColumn($alias . '.DISC_NUMBER'); - $criteria->addSelectColumn($alias . '.MOOD'); - $criteria->addSelectColumn($alias . '.LABEL'); - $criteria->addSelectColumn($alias . '.COMPOSER'); - $criteria->addSelectColumn($alias . '.ENCODER'); - $criteria->addSelectColumn($alias . '.CHECKSUM'); - $criteria->addSelectColumn($alias . '.LYRICS'); - $criteria->addSelectColumn($alias . '.ORCHESTRA'); - $criteria->addSelectColumn($alias . '.CONDUCTOR'); - $criteria->addSelectColumn($alias . '.LYRICIST'); - $criteria->addSelectColumn($alias . '.ORIGINAL_LYRICIST'); - $criteria->addSelectColumn($alias . '.RADIO_STATION_NAME'); - $criteria->addSelectColumn($alias . '.INFO_URL'); - $criteria->addSelectColumn($alias . '.ARTIST_URL'); - $criteria->addSelectColumn($alias . '.AUDIO_SOURCE_URL'); - $criteria->addSelectColumn($alias . '.RADIO_STATION_URL'); - $criteria->addSelectColumn($alias . '.BUY_THIS_URL'); - $criteria->addSelectColumn($alias . '.ISRC_NUMBER'); - $criteria->addSelectColumn($alias . '.CATALOG_NUMBER'); - $criteria->addSelectColumn($alias . '.ORIGINAL_ARTIST'); - $criteria->addSelectColumn($alias . '.COPYRIGHT'); - $criteria->addSelectColumn($alias . '.REPORT_DATETIME'); - $criteria->addSelectColumn($alias . '.REPORT_LOCATION'); - $criteria->addSelectColumn($alias . '.REPORT_ORGANIZATION'); - $criteria->addSelectColumn($alias . '.SUBJECT'); - $criteria->addSelectColumn($alias . '.CONTRIBUTOR'); - $criteria->addSelectColumn($alias . '.LANGUAGE'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ID'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_CODE'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_ERROR_MSG'); - $criteria->addSelectColumn($alias . '.SOUNDCLOUD_LINK_TO_FILE'); - } - } - - /** - * 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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::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 CcFiles - * @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 = CcFilesPeer::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 CcFilesPeer::populateObjects(CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcFilesPeer::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 CcFiles $value A CcFiles object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcFiles $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 CcFiles object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcFiles) { - $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 CcFiles 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 CcFiles 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_files - * by a foreign key with ON DELETE CASCADE - */ - 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 CcPlaylistcontentsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPlaylistcontentsPeer::clearInstancePool(); - // 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 = CcFilesPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcFilesPeer::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; - CcFilesPeer::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 (CcFiles object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcFilesPeer::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 + CcFilesPeer::NUM_COLUMNS; - } else { - $cls = CcFilesPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcMusicDirs 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 doCountJoinCcMusicDirs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcFiles objects pre-filled with their CcSubjs 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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcFiles) to $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcFiles objects pre-filled with their CcMusicDirs 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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcMusicDirs(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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - CcMusicDirsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcMusicDirsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcFiles) to $obj2 (CcMusicDirs) - $obj2->addCcFiles($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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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 CcFiles 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 CcFiles 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); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcMusicDirsPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - } // if joined row not null - - // Add objects for joined CcMusicDirs rows - - $key3 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcMusicDirsPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcMusicDirsPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcFiles) to the collection in $obj3 (CcMusicDirs) - $obj3->addCcFiles($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinAllExceptCcSubjs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcMusicDirs 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 doCountJoinAllExceptCcMusicDirs(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(CcFilesPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcFilesPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::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 CcFiles objects pre-filled with all related objects except CcSubjs. - * - * @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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcMusicDirsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::DIRECTORY, CcMusicDirsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcMusicDirs rows - - $key2 = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcMusicDirsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcMusicDirsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcMusicDirsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcMusicDirs) - $obj2->addCcFiles($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcFiles objects pre-filled with all related objects except CcMusicDirs. - * - * @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 CcFiles objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcMusicDirs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcFilesPeer::addSelectColumns($criteria); - $startcol2 = (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcFilesPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcFilesPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcFilesPeer::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 = CcFilesPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcFilesPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcFiles) to the collection in $obj2 (CcSubjs) - $obj2->addCcFiles($obj1); - - } // if joined row is 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(BaseCcFilesPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcFilesPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcFilesTableMap()); - } - } - - /** - * 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 ? CcFilesPeer::CLASS_DEFAULT : CcFilesPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcFiles or Criteria object. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcFiles object - } - - if ($criteria->containsKey(CcFilesPeer::ID) && $criteria->keyContainsValue(CcFilesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcFilesPeer::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 CcFiles or Criteria object. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcFilesPeer::ID); - $value = $criteria->remove(CcFilesPeer::ID); - if ($value) { - $selectCriteria->add(CcFilesPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcFilesPeer::TABLE_NAME); - } - - } else { // $values is CcFiles 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_files 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(CcFilesPeer::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(CcFilesPeer::TABLE_NAME, $con, CcFilesPeer::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). - CcFilesPeer::clearInstancePool(); - CcFilesPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcFiles or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcFiles 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(CcFilesPeer::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. - CcFilesPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcFiles) { // it's a model object - // invalidate the cache for this single object - CcFilesPeer::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(CcFilesPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcFilesPeer::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); - CcFilesPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcFiles 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 CcFiles $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(CcFiles $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcFilesPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, CcFilesPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcFiles - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcFilesPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $pk); - - $v = CcFilesPeer::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(CcFilesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcFilesPeer::DATABASE_NAME); - $criteria->add(CcFilesPeer::ID, $pks, Criteria::IN); - $objs = CcFilesPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcFilesPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcFilesPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesQuery.php deleted file mode 100644 index 36c5f71ed..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcFilesQuery.php +++ /dev/null @@ -1,2094 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcFiles|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcFilesPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcFilesQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcFilesPeer::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 CcFilesQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcFilesPeer::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 CcFilesQuery 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(CcFilesPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $dbGunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbGunid($dbGunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGunid)) { - $dbGunid = str_replace('*', '%', $dbGunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::GUNID, $dbGunid, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the mime column - * - * @param string $dbMime The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMime($dbMime = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMime)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMime)) { - $dbMime = str_replace('*', '%', $dbMime); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MIME, $dbMime, $comparison); - } - - /** - * Filter the query on the ftype column - * - * @param string $dbFtype The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFtype($dbFtype = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFtype)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFtype)) { - $dbFtype = str_replace('*', '%', $dbFtype); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FTYPE, $dbFtype, $comparison); - } - - /** - * Filter the query on the directory column - * - * @param int|array $dbDirectory 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbDirectory($dbDirectory = null, $comparison = null) - { - if (is_array($dbDirectory)) { - $useMinMax = false; - if (isset($dbDirectory['min'])) { - $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbDirectory['max'])) { - $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::DIRECTORY, $dbDirectory, $comparison); - } - - /** - * Filter the query on the filepath column - * - * @param string $dbFilepath The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFilepath($dbFilepath = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFilepath)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFilepath)) { - $dbFilepath = str_replace('*', '%', $dbFilepath); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FILEPATH, $dbFilepath, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $dbState The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbState($dbState = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbState)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbState)) { - $dbState = str_replace('*', '%', $dbState); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::STATE, $dbState, $comparison); - } - - /** - * Filter the query on the currentlyaccessing column - * - * @param int|array $dbCurrentlyaccessing 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCurrentlyaccessing($dbCurrentlyaccessing = null, $comparison = null) - { - if (is_array($dbCurrentlyaccessing)) { - $useMinMax = false; - if (isset($dbCurrentlyaccessing['min'])) { - $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCurrentlyaccessing['max'])) { - $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing, $comparison); - } - - /** - * Filter the query on the editedby column - * - * @param int|array $dbEditedby 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEditedby($dbEditedby = null, $comparison = null) - { - if (is_array($dbEditedby)) { - $useMinMax = false; - if (isset($dbEditedby['min'])) { - $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEditedby['max'])) { - $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::EDITEDBY, $dbEditedby, $comparison); - } - - /** - * Filter the query on the mtime column - * - * @param string|array $dbMtime 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMtime($dbMtime = null, $comparison = null) - { - if (is_array($dbMtime)) { - $useMinMax = false; - if (isset($dbMtime['min'])) { - $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbMtime['max'])) { - $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::MTIME, $dbMtime, $comparison); - } - - /** - * Filter the query on the md5 column - * - * @param string $dbMd5 The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMd5($dbMd5 = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMd5)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMd5)) { - $dbMd5 = str_replace('*', '%', $dbMd5); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MD5, $dbMd5, $comparison); - } - - /** - * Filter the query on the track_title column - * - * @param string $dbTrackTitle The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbTrackTitle($dbTrackTitle = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbTrackTitle)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbTrackTitle)) { - $dbTrackTitle = str_replace('*', '%', $dbTrackTitle); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::TRACK_TITLE, $dbTrackTitle, $comparison); - } - - /** - * Filter the query on the artist_name column - * - * @param string $dbArtistName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbArtistName($dbArtistName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbArtistName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbArtistName)) { - $dbArtistName = str_replace('*', '%', $dbArtistName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ARTIST_NAME, $dbArtistName, $comparison); - } - - /** - * Filter the query on the bit_rate column - * - * @param string $dbBitRate The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBitRate($dbBitRate = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBitRate)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBitRate)) { - $dbBitRate = str_replace('*', '%', $dbBitRate); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BIT_RATE, $dbBitRate, $comparison); - } - - /** - * Filter the query on the sample_rate column - * - * @param string $dbSampleRate The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSampleRate($dbSampleRate = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSampleRate)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSampleRate)) { - $dbSampleRate = str_replace('*', '%', $dbSampleRate); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SAMPLE_RATE, $dbSampleRate, $comparison); - } - - /** - * Filter the query on the format column - * - * @param string $dbFormat The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbFormat($dbFormat = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFormat)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFormat)) { - $dbFormat = str_replace('*', '%', $dbFormat); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::FORMAT, $dbFormat, $comparison); - } - - /** - * Filter the query on the length column - * - * @param string|array $dbLength 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLength($dbLength = null, $comparison = null) - { - if (is_array($dbLength)) { - $useMinMax = false; - if (isset($dbLength['min'])) { - $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLength['max'])) { - $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::LENGTH, $dbLength, $comparison); - } - - /** - * Filter the query on the album_title column - * - * @param string $dbAlbumTitle The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbAlbumTitle($dbAlbumTitle = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbAlbumTitle)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbAlbumTitle)) { - $dbAlbumTitle = str_replace('*', '%', $dbAlbumTitle); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ALBUM_TITLE, $dbAlbumTitle, $comparison); - } - - /** - * Filter the query on the genre column - * - * @param string $dbGenre The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbGenre($dbGenre = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGenre)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGenre)) { - $dbGenre = str_replace('*', '%', $dbGenre); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::GENRE, $dbGenre, $comparison); - } - - /** - * Filter the query on the comments column - * - * @param string $dbComments The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbComments($dbComments = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbComments)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbComments)) { - $dbComments = str_replace('*', '%', $dbComments); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COMMENTS, $dbComments, $comparison); - } - - /** - * Filter the query on the year column - * - * @param string $dbYear The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbYear($dbYear = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbYear)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbYear)) { - $dbYear = str_replace('*', '%', $dbYear); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::YEAR, $dbYear, $comparison); - } - - /** - * Filter the query on the track_number column - * - * @param int|array $dbTrackNumber 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbTrackNumber($dbTrackNumber = null, $comparison = null) - { - if (is_array($dbTrackNumber)) { - $useMinMax = false; - if (isset($dbTrackNumber['min'])) { - $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbTrackNumber['max'])) { - $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::TRACK_NUMBER, $dbTrackNumber, $comparison); - } - - /** - * Filter the query on the channels column - * - * @param int|array $dbChannels 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbChannels($dbChannels = null, $comparison = null) - { - if (is_array($dbChannels)) { - $useMinMax = false; - if (isset($dbChannels['min'])) { - $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbChannels['max'])) { - $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::CHANNELS, $dbChannels, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $dbUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbUrl($dbUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbUrl)) { - $dbUrl = str_replace('*', '%', $dbUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::URL, $dbUrl, $comparison); - } - - /** - * Filter the query on the bpm column - * - * @param string $dbBpm The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBpm($dbBpm = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBpm)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBpm)) { - $dbBpm = str_replace('*', '%', $dbBpm); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BPM, $dbBpm, $comparison); - } - - /** - * Filter the query on the rating column - * - * @param string $dbRating The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRating($dbRating = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRating)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRating)) { - $dbRating = str_replace('*', '%', $dbRating); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RATING, $dbRating, $comparison); - } - - /** - * Filter the query on the encoded_by column - * - * @param string $dbEncodedBy The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEncodedBy($dbEncodedBy = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEncodedBy)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEncodedBy)) { - $dbEncodedBy = str_replace('*', '%', $dbEncodedBy); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ENCODED_BY, $dbEncodedBy, $comparison); - } - - /** - * Filter the query on the disc_number column - * - * @param string $dbDiscNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbDiscNumber($dbDiscNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDiscNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDiscNumber)) { - $dbDiscNumber = str_replace('*', '%', $dbDiscNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::DISC_NUMBER, $dbDiscNumber, $comparison); - } - - /** - * Filter the query on the mood column - * - * @param string $dbMood The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbMood($dbMood = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbMood)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbMood)) { - $dbMood = str_replace('*', '%', $dbMood); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::MOOD, $dbMood, $comparison); - } - - /** - * Filter the query on the label column - * - * @param string $dbLabel The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLabel($dbLabel = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLabel)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLabel)) { - $dbLabel = str_replace('*', '%', $dbLabel); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LABEL, $dbLabel, $comparison); - } - - /** - * Filter the query on the composer column - * - * @param string $dbComposer The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbComposer($dbComposer = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbComposer)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbComposer)) { - $dbComposer = str_replace('*', '%', $dbComposer); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COMPOSER, $dbComposer, $comparison); - } - - /** - * Filter the query on the encoder column - * - * @param string $dbEncoder The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbEncoder($dbEncoder = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEncoder)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEncoder)) { - $dbEncoder = str_replace('*', '%', $dbEncoder); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ENCODER, $dbEncoder, $comparison); - } - - /** - * Filter the query on the checksum column - * - * @param string $dbChecksum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbChecksum($dbChecksum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbChecksum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbChecksum)) { - $dbChecksum = str_replace('*', '%', $dbChecksum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CHECKSUM, $dbChecksum, $comparison); - } - - /** - * Filter the query on the lyrics column - * - * @param string $dbLyrics The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLyrics($dbLyrics = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLyrics)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLyrics)) { - $dbLyrics = str_replace('*', '%', $dbLyrics); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LYRICS, $dbLyrics, $comparison); - } - - /** - * Filter the query on the orchestra column - * - * @param string $dbOrchestra The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOrchestra($dbOrchestra = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOrchestra)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOrchestra)) { - $dbOrchestra = str_replace('*', '%', $dbOrchestra); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORCHESTRA, $dbOrchestra, $comparison); - } - - /** - * Filter the query on the conductor column - * - * @param string $dbConductor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbConductor($dbConductor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbConductor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbConductor)) { - $dbConductor = str_replace('*', '%', $dbConductor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CONDUCTOR, $dbConductor, $comparison); - } - - /** - * Filter the query on the lyricist column - * - * @param string $dbLyricist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLyricist($dbLyricist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLyricist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLyricist)) { - $dbLyricist = str_replace('*', '%', $dbLyricist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LYRICIST, $dbLyricist, $comparison); - } - - /** - * Filter the query on the original_lyricist column - * - * @param string $dbOriginalLyricist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOriginalLyricist($dbOriginalLyricist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOriginalLyricist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOriginalLyricist)) { - $dbOriginalLyricist = str_replace('*', '%', $dbOriginalLyricist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORIGINAL_LYRICIST, $dbOriginalLyricist, $comparison); - } - - /** - * Filter the query on the radio_station_name column - * - * @param string $dbRadioStationName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRadioStationName($dbRadioStationName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRadioStationName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRadioStationName)) { - $dbRadioStationName = str_replace('*', '%', $dbRadioStationName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RADIO_STATION_NAME, $dbRadioStationName, $comparison); - } - - /** - * Filter the query on the info_url column - * - * @param string $dbInfoUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbInfoUrl($dbInfoUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbInfoUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbInfoUrl)) { - $dbInfoUrl = str_replace('*', '%', $dbInfoUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::INFO_URL, $dbInfoUrl, $comparison); - } - - /** - * Filter the query on the artist_url column - * - * @param string $dbArtistUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbArtistUrl($dbArtistUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbArtistUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbArtistUrl)) { - $dbArtistUrl = str_replace('*', '%', $dbArtistUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ARTIST_URL, $dbArtistUrl, $comparison); - } - - /** - * Filter the query on the audio_source_url column - * - * @param string $dbAudioSourceUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbAudioSourceUrl($dbAudioSourceUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbAudioSourceUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbAudioSourceUrl)) { - $dbAudioSourceUrl = str_replace('*', '%', $dbAudioSourceUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::AUDIO_SOURCE_URL, $dbAudioSourceUrl, $comparison); - } - - /** - * Filter the query on the radio_station_url column - * - * @param string $dbRadioStationUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbRadioStationUrl($dbRadioStationUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbRadioStationUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbRadioStationUrl)) { - $dbRadioStationUrl = str_replace('*', '%', $dbRadioStationUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::RADIO_STATION_URL, $dbRadioStationUrl, $comparison); - } - - /** - * Filter the query on the buy_this_url column - * - * @param string $dbBuyThisUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbBuyThisUrl($dbBuyThisUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBuyThisUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBuyThisUrl)) { - $dbBuyThisUrl = str_replace('*', '%', $dbBuyThisUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::BUY_THIS_URL, $dbBuyThisUrl, $comparison); - } - - /** - * Filter the query on the isrc_number column - * - * @param string $dbIsrcNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbIsrcNumber($dbIsrcNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIsrcNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIsrcNumber)) { - $dbIsrcNumber = str_replace('*', '%', $dbIsrcNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ISRC_NUMBER, $dbIsrcNumber, $comparison); - } - - /** - * Filter the query on the catalog_number column - * - * @param string $dbCatalogNumber The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCatalogNumber($dbCatalogNumber = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCatalogNumber)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCatalogNumber)) { - $dbCatalogNumber = str_replace('*', '%', $dbCatalogNumber); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CATALOG_NUMBER, $dbCatalogNumber, $comparison); - } - - /** - * Filter the query on the original_artist column - * - * @param string $dbOriginalArtist The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbOriginalArtist($dbOriginalArtist = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbOriginalArtist)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbOriginalArtist)) { - $dbOriginalArtist = str_replace('*', '%', $dbOriginalArtist); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::ORIGINAL_ARTIST, $dbOriginalArtist, $comparison); - } - - /** - * Filter the query on the copyright column - * - * @param string $dbCopyright The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbCopyright($dbCopyright = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCopyright)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCopyright)) { - $dbCopyright = str_replace('*', '%', $dbCopyright); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::COPYRIGHT, $dbCopyright, $comparison); - } - - /** - * Filter the query on the report_datetime column - * - * @param string $dbReportDatetime The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportDatetime($dbReportDatetime = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportDatetime)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportDatetime)) { - $dbReportDatetime = str_replace('*', '%', $dbReportDatetime); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_DATETIME, $dbReportDatetime, $comparison); - } - - /** - * Filter the query on the report_location column - * - * @param string $dbReportLocation The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportLocation($dbReportLocation = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportLocation)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportLocation)) { - $dbReportLocation = str_replace('*', '%', $dbReportLocation); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_LOCATION, $dbReportLocation, $comparison); - } - - /** - * Filter the query on the report_organization column - * - * @param string $dbReportOrganization The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbReportOrganization($dbReportOrganization = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbReportOrganization)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbReportOrganization)) { - $dbReportOrganization = str_replace('*', '%', $dbReportOrganization); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::REPORT_ORGANIZATION, $dbReportOrganization, $comparison); - } - - /** - * Filter the query on the subject column - * - * @param string $dbSubject The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSubject($dbSubject = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSubject)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSubject)) { - $dbSubject = str_replace('*', '%', $dbSubject); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SUBJECT, $dbSubject, $comparison); - } - - /** - * Filter the query on the contributor column - * - * @param string $dbContributor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbContributor($dbContributor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbContributor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbContributor)) { - $dbContributor = str_replace('*', '%', $dbContributor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::CONTRIBUTOR, $dbContributor, $comparison); - } - - /** - * Filter the query on the language column - * - * @param string $dbLanguage The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbLanguage($dbLanguage = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLanguage)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLanguage)) { - $dbLanguage = str_replace('*', '%', $dbLanguage); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::LANGUAGE, $dbLanguage, $comparison); - } - - /** - * Filter the query on the soundcloud_id column - * - * @param int|array $dbSoundcloudId 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudId($dbSoundcloudId = null, $comparison = null) - { - if (is_array($dbSoundcloudId)) { - $useMinMax = false; - if (isset($dbSoundcloudId['min'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbSoundcloudId['max'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ID, $dbSoundcloudId, $comparison); - } - - /** - * Filter the query on the soundcloud_error_code column - * - * @param int|array $dbSoundcloudErrorCode 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudErrorCode($dbSoundcloudErrorCode = null, $comparison = null) - { - if (is_array($dbSoundcloudErrorCode)) { - $useMinMax = false; - if (isset($dbSoundcloudErrorCode['min'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbSoundcloudErrorCode['max'])) { - $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_CODE, $dbSoundcloudErrorCode, $comparison); - } - - /** - * Filter the query on the soundcloud_error_msg column - * - * @param string $dbSoundcloudErrorMsg The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudErrorMsg($dbSoundcloudErrorMsg = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSoundcloudErrorMsg)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSoundcloudErrorMsg)) { - $dbSoundcloudErrorMsg = str_replace('*', '%', $dbSoundcloudErrorMsg); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_ERROR_MSG, $dbSoundcloudErrorMsg, $comparison); - } - - /** - * Filter the query on the soundcloud_link_to_file column - * - * @param string $dbSoundcloudLinkToFile The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByDbSoundcloudLinkToFile($dbSoundcloudLinkToFile = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSoundcloudLinkToFile)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSoundcloudLinkToFile)) { - $dbSoundcloudLinkToFile = str_replace('*', '%', $dbSoundcloudLinkToFile); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcFilesPeer::SOUNDCLOUD_LINK_TO_FILE, $dbSoundcloudLinkToFile, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Filter the query by a related CcMusicDirs object - * - * @param CcMusicDirs $ccMusicDirs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcMusicDirs($ccMusicDirs, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::DIRECTORY, $ccMusicDirs->getId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcMusicDirs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcMusicDirs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcMusicDirs'); - - // 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, 'CcMusicDirs'); - } - - return $this; - } - - /** - * Use the CcMusicDirs relation CcMusicDirs 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 CcMusicDirsQuery A secondary query class using the current class as primary query - */ - public function useCcMusicDirsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcMusicDirs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcMusicDirs', 'CcMusicDirsQuery'); - } - - /** - * 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByCcShowInstances($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccShowInstances->getDbRecordedFile(), $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 CcFilesQuery The current query, for fluid interface - */ - public function joinCcShowInstances($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) - { - return $this - ->joinCcShowInstances($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstances', 'CcShowInstancesQuery'); - } - - /** - * Filter the query by a related CcPlaylistcontents object - * - * @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccPlaylistcontents->getDbFileId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylistcontents relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylistcontents'); - - // 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, 'CcPlaylistcontents'); - } - - return $this; - } - - /** - * Use the CcPlaylistcontents relation CcPlaylistcontents 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 CcPlaylistcontentsQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylistcontents($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery'); - } - - /** - * 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 CcFilesQuery The current query, for fluid interface - */ - public function filterByCcSchedule($ccSchedule, $comparison = null) - { - return $this - ->addUsingAlias(CcFilesPeer::ID, $ccSchedule->getDbFileId(), $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 CcFilesQuery The current query, for fluid interface - */ - public function joinCcSchedule($relationAlias = '', $joinType = Criteria::LEFT_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::LEFT_JOIN) - { - return $this - ->joinCcSchedule($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSchedule', 'CcScheduleQuery'); - } - - /** - * Exclude object from result - * - * @param CcFiles $ccFiles Object to remove from the list of results - * - * @return CcFilesQuery The current query, for fluid interface - */ - public function prune($ccFiles = null) - { - if ($ccFiles) { - $this->addUsingAlias(CcFilesPeer::ID, $ccFiles->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcFilesQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttempts.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttempts.php deleted file mode 100644 index b529e12d5..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttempts.php +++ /dev/null @@ -1,735 +0,0 @@ -attempts = 0; - } - - /** - * Initializes internal state of BaseCcLoginAttempts object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [ip] column value. - * - * @return string - */ - public function getDbIP() - { - return $this->ip; - } - - /** - * Get the [attempts] column value. - * - * @return int - */ - public function getDbAttempts() - { - return $this->attempts; - } - - /** - * Set the value of [ip] column. - * - * @param string $v new value - * @return CcLoginAttempts The current object (for fluent API support) - */ - public function setDbIP($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ip !== $v) { - $this->ip = $v; - $this->modifiedColumns[] = CcLoginAttemptsPeer::IP; - } - - return $this; - } // setDbIP() - - /** - * Set the value of [attempts] column. - * - * @param int $v new value - * @return CcLoginAttempts The current object (for fluent API support) - */ - public function setDbAttempts($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->attempts !== $v || $this->isNew()) { - $this->attempts = $v; - $this->modifiedColumns[] = CcLoginAttemptsPeer::ATTEMPTS; - } - - return $this; - } // setDbAttempts() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->attempts !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->ip = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->attempts = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcLoginAttemptsPeer::NUM_COLUMNS - CcLoginAttemptsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcLoginAttempts object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcLoginAttemptsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcLoginAttemptsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcLoginAttemptsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcLoginAttemptsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcLoginAttemptsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcLoginAttemptsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbIP(); - break; - case 1: - return $this->getDbAttempts(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcLoginAttemptsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbIP(), - $keys[1] => $this->getDbAttempts(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcLoginAttemptsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbIP($value); - break; - case 1: - $this->setDbAttempts($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcLoginAttemptsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbIP($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbAttempts($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcLoginAttemptsPeer::IP)) $criteria->add(CcLoginAttemptsPeer::IP, $this->ip); - if ($this->isColumnModified(CcLoginAttemptsPeer::ATTEMPTS)) $criteria->add(CcLoginAttemptsPeer::ATTEMPTS, $this->attempts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $this->ip); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbIP(); - } - - /** - * Generic method to set the primary key (ip column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbIP($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbIP(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcLoginAttempts (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbIP($this->ip); - $copyObj->setDbAttempts($this->attempts); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcLoginAttempts Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcLoginAttemptsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcLoginAttemptsPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->ip = null; - $this->attempts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcLoginAttempts diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsPeer.php deleted file mode 100644 index 27b4cd90c..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbIP', 'DbAttempts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIP', 'dbAttempts', ), - BasePeer::TYPE_COLNAME => array (self::IP, self::ATTEMPTS, ), - BasePeer::TYPE_RAW_COLNAME => array ('IP', 'ATTEMPTS', ), - BasePeer::TYPE_FIELDNAME => array ('ip', 'attempts', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbIP' => 0, 'DbAttempts' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbIP' => 0, 'dbAttempts' => 1, ), - BasePeer::TYPE_COLNAME => array (self::IP => 0, self::ATTEMPTS => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('IP' => 0, 'ATTEMPTS' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('ip' => 0, 'attempts' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcLoginAttemptsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::IP); - $criteria->addSelectColumn(CcLoginAttemptsPeer::ATTEMPTS); - } else { - $criteria->addSelectColumn($alias . '.IP'); - $criteria->addSelectColumn($alias . '.ATTEMPTS'); - } - } - - /** - * 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(CcLoginAttemptsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::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 CcLoginAttempts - * @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 = CcLoginAttemptsPeer::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 CcLoginAttemptsPeer::populateObjects(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcLoginAttemptsPeer::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 CcLoginAttempts $value A CcLoginAttempts object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcLoginAttempts $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbIP(); - } // 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 CcLoginAttempts object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcLoginAttempts) { - $key = (string) $value->getDbIP(); - } 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 CcLoginAttempts 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 CcLoginAttempts 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_login_attempts - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcLoginAttemptsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcLoginAttemptsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcLoginAttemptsPeer::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; - CcLoginAttemptsPeer::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 (CcLoginAttempts object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcLoginAttemptsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcLoginAttemptsPeer::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 + CcLoginAttemptsPeer::NUM_COLUMNS; - } else { - $cls = CcLoginAttemptsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcLoginAttemptsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcLoginAttemptsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcLoginAttemptsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcLoginAttemptsTableMap()); - } - } - - /** - * 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 ? CcLoginAttemptsPeer::CLASS_DEFAULT : CcLoginAttemptsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcLoginAttempts or Criteria object. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcLoginAttempts object - } - - - // 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 CcLoginAttempts or Criteria object. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcLoginAttemptsPeer::IP); - $value = $criteria->remove(CcLoginAttemptsPeer::IP); - if ($value) { - $selectCriteria->add(CcLoginAttemptsPeer::IP, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcLoginAttemptsPeer::TABLE_NAME); - } - - } else { // $values is CcLoginAttempts 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_login_attempts 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(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::TABLE_NAME, $con, CcLoginAttemptsPeer::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). - CcLoginAttemptsPeer::clearInstancePool(); - CcLoginAttemptsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcLoginAttempts or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcLoginAttempts 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(CcLoginAttemptsPeer::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. - CcLoginAttemptsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcLoginAttempts) { // it's a model object - // invalidate the cache for this single object - CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::IP, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcLoginAttemptsPeer::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); - CcLoginAttemptsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcLoginAttempts 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 CcLoginAttempts $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(CcLoginAttempts $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcLoginAttemptsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, CcLoginAttemptsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcLoginAttempts - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcLoginAttemptsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $pk); - - $v = CcLoginAttemptsPeer::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(CcLoginAttemptsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcLoginAttemptsPeer::DATABASE_NAME); - $criteria->add(CcLoginAttemptsPeer::IP, $pks, Criteria::IN); - $objs = CcLoginAttemptsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcLoginAttemptsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcLoginAttemptsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsQuery.php deleted file mode 100644 index 930f32eda..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcLoginAttemptsQuery.php +++ /dev/null @@ -1,205 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcLoginAttempts|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcLoginAttemptsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $keys, Criteria::IN); - } - - /** - * Filter the query on the ip column - * - * @param string $dbIP The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByDbIP($dbIP = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIP)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIP)) { - $dbIP = str_replace('*', '%', $dbIP); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcLoginAttemptsPeer::IP, $dbIP, $comparison); - } - - /** - * Filter the query on the attempts column - * - * @param int|array $dbAttempts 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 CcLoginAttemptsQuery The current query, for fluid interface - */ - public function filterByDbAttempts($dbAttempts = null, $comparison = null) - { - if (is_array($dbAttempts)) { - $useMinMax = false; - if (isset($dbAttempts['min'])) { - $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbAttempts['max'])) { - $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcLoginAttemptsPeer::ATTEMPTS, $dbAttempts, $comparison); - } - - /** - * Exclude object from result - * - * @param CcLoginAttempts $ccLoginAttempts Object to remove from the list of results - * - * @return CcLoginAttemptsQuery The current query, for fluid interface - */ - public function prune($ccLoginAttempts = null) - { - if ($ccLoginAttempts) { - $this->addUsingAlias(CcLoginAttemptsPeer::IP, $ccLoginAttempts->getDbIP(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcLoginAttemptsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirs.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirs.php deleted file mode 100644 index 8458eed2f..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirs.php +++ /dev/null @@ -1,941 +0,0 @@ -id; - } - - /** - * Get the [directory] column value. - * - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [directory] column. - * - * @param string $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setDirectory($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->directory !== $v) { - $this->directory = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::DIRECTORY; - } - - return $this; - } // setDirectory() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcMusicDirs The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcMusicDirsPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->directory = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcMusicDirsPeer::NUM_COLUMNS - CcMusicDirsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcMusicDirs object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcMusicDirsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcFiless = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcMusicDirsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcMusicDirsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcMusicDirsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcMusicDirsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcMusicDirsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcMusicDirsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getDirectory(); - break; - case 2: - return $this->getType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcMusicDirsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getDirectory(), - $keys[2] => $this->getType(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcMusicDirsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setDirectory($value); - break; - case 2: - $this->setType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcMusicDirsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDirectory($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setType($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcMusicDirsPeer::ID)) $criteria->add(CcMusicDirsPeer::ID, $this->id); - if ($this->isColumnModified(CcMusicDirsPeer::DIRECTORY)) $criteria->add(CcMusicDirsPeer::DIRECTORY, $this->directory); - if ($this->isColumnModified(CcMusicDirsPeer::TYPE)) $criteria->add(CcMusicDirsPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcMusicDirs (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDirectory($this->directory); - $copyObj->setType($this->type); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcFiless() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcFiles($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcMusicDirs Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcMusicDirsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcMusicDirsPeer(); - } - return self::$peer; - } - - /** - * Clears out the collCcFiless 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 addCcFiless() - */ - public function clearCcFiless() - { - $this->collCcFiless = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcFiless collection. - * - * By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless()); - * 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 initCcFiless() - { - $this->collCcFiless = new PropelObjectCollection(); - $this->collCcFiless->setModel('CcFiles'); - } - - /** - * Gets an array of CcFiles 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 CcMusicDirs 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 CcFiles[] List of CcFiles objects - * @throws PropelException - */ - public function getCcFiless($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - // return empty collection - $this->initCcFiless(); - } else { - $collCcFiless = CcFilesQuery::create(null, $criteria) - ->filterByCcMusicDirs($this) - ->find($con); - if (null !== $criteria) { - return $collCcFiless; - } - $this->collCcFiless = $collCcFiless; - } - } - return $this->collCcFiless; - } - - /** - * Returns the number of related CcFiles objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcFiles objects. - * @throws PropelException - */ - public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - return 0; - } else { - $query = CcFilesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcMusicDirs($this) - ->count($con); - } - } else { - return count($this->collCcFiless); - } - } - - /** - * Method called to associate a CcFiles object to this object - * through the CcFiles foreign key attribute. - * - * @param CcFiles $l CcFiles - * @return void - * @throws PropelException - */ - public function addCcFiles(CcFiles $l) - { - if ($this->collCcFiless === null) { - $this->initCcFiless(); - } - if (!$this->collCcFiless->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcFiless[]= $l; - $l->setCcMusicDirs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcMusicDirs is new, it will return - * an empty collection; or if this CcMusicDirs has previously - * been saved, it will retrieve related CcFiless from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcMusicDirs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcFiles[] List of CcFiles objects - */ - public function getCcFilessJoinCcSubjs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcFilesQuery::create(null, $criteria); - $query->joinWith('CcSubjs', $join_behavior); - - return $this->getCcFiless($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->directory = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcFiless) { - foreach ((array) $this->collCcFiless as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcFiless = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcMusicDirs diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsPeer.php deleted file mode 100644 index 5d06e270d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsPeer.php +++ /dev/null @@ -1,747 +0,0 @@ - array ('Id', 'Directory', 'Type', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'directory', 'type', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::DIRECTORY, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DIRECTORY', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'directory', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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 ('Id' => 0, 'Directory' => 1, 'Type' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DIRECTORY => 1, self::TYPE => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DIRECTORY' => 1, 'TYPE' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'directory' => 1, 'type' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcMusicDirsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcMusicDirsPeer::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(CcMusicDirsPeer::ID); - $criteria->addSelectColumn(CcMusicDirsPeer::DIRECTORY); - $criteria->addSelectColumn(CcMusicDirsPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.DIRECTORY'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcMusicDirsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcMusicDirsPeer::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(CcMusicDirsPeer::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 CcMusicDirs - * @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 = CcMusicDirsPeer::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 CcMusicDirsPeer::populateObjects(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcMusicDirsPeer::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 CcMusicDirs $value A CcMusicDirs object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcMusicDirs $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcMusicDirs object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcMusicDirs) { - $key = (string) $value->getId(); - } 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 CcMusicDirs 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 CcMusicDirs 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_music_dirs - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcFilesPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcFilesPeer::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 = CcMusicDirsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcMusicDirsPeer::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; - CcMusicDirsPeer::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 (CcMusicDirs object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcMusicDirsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcMusicDirsPeer::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 + CcMusicDirsPeer::NUM_COLUMNS; - } else { - $cls = CcMusicDirsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcMusicDirsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcMusicDirsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcMusicDirsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcMusicDirsTableMap()); - } - } - - /** - * 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 ? CcMusicDirsPeer::CLASS_DEFAULT : CcMusicDirsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcMusicDirs or Criteria object. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcMusicDirs object - } - - if ($criteria->containsKey(CcMusicDirsPeer::ID) && $criteria->keyContainsValue(CcMusicDirsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcMusicDirsPeer::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 CcMusicDirs or Criteria object. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcMusicDirsPeer::ID); - $value = $criteria->remove(CcMusicDirsPeer::ID); - if ($value) { - $selectCriteria->add(CcMusicDirsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcMusicDirsPeer::TABLE_NAME); - } - - } else { // $values is CcMusicDirs 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_music_dirs 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(CcMusicDirsPeer::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(CcMusicDirsPeer::TABLE_NAME, $con, CcMusicDirsPeer::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). - CcMusicDirsPeer::clearInstancePool(); - CcMusicDirsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcMusicDirs or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcMusicDirs 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(CcMusicDirsPeer::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. - CcMusicDirsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcMusicDirs) { // it's a model object - // invalidate the cache for this single object - CcMusicDirsPeer::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(CcMusicDirsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcMusicDirsPeer::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); - CcMusicDirsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcMusicDirs 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 CcMusicDirs $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(CcMusicDirs $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcMusicDirsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, CcMusicDirsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcMusicDirs - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcMusicDirsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $pk); - - $v = CcMusicDirsPeer::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(CcMusicDirsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcMusicDirsPeer::DATABASE_NAME); - $criteria->add(CcMusicDirsPeer::ID, $pks, Criteria::IN); - $objs = CcMusicDirsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcMusicDirsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcMusicDirsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsQuery.php deleted file mode 100644 index 71b5f0f57..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcMusicDirsQuery.php +++ /dev/null @@ -1,285 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcMusicDirs|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcMusicDirsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcMusicDirsPeer::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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcMusicDirsPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcMusicDirsQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcMusicDirsPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the directory column - * - * @param string $directory The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByDirectory($directory = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($directory)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $directory)) { - $directory = str_replace('*', '%', $directory); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcMusicDirsPeer::DIRECTORY, $directory, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcMusicDirsPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcMusicDirsPeer::ID, $ccFiles->getDbDirectory(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Exclude object from result - * - * @param CcMusicDirs $ccMusicDirs Object to remove from the list of results - * - * @return CcMusicDirsQuery The current query, for fluid interface - */ - public function prune($ccMusicDirs = null) - { - if ($ccMusicDirs) { - $this->addUsingAlias(CcMusicDirsPeer::ID, $ccMusicDirs->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcMusicDirsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPerms.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPerms.php deleted file mode 100644 index a86413fc1..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPerms.php +++ /dev/null @@ -1,945 +0,0 @@ -permid; - } - - /** - * Get the [subj] column value. - * - * @return int - */ - public function getSubj() - { - return $this->subj; - } - - /** - * Get the [action] column value. - * - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * Get the [obj] column value. - * - * @return int - */ - public function getObj() - { - return $this->obj; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Set the value of [permid] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setPermid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->permid !== $v) { - $this->permid = $v; - $this->modifiedColumns[] = CcPermsPeer::PERMID; - } - - return $this; - } // setPermid() - - /** - * Set the value of [subj] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setSubj($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subj !== $v) { - $this->subj = $v; - $this->modifiedColumns[] = CcPermsPeer::SUBJ; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setSubj() - - /** - * Set the value of [action] column. - * - * @param string $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setAction($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->action !== $v) { - $this->action = $v; - $this->modifiedColumns[] = CcPermsPeer::ACTION; - } - - return $this; - } // setAction() - - /** - * Set the value of [obj] column. - * - * @param int $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setObj($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->obj !== $v) { - $this->obj = $v; - $this->modifiedColumns[] = CcPermsPeer::OBJ; - } - - return $this; - } // setObj() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcPerms The current object (for fluent API support) - */ - public function setType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcPermsPeer::TYPE; - } - - return $this; - } // setType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->permid = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->subj = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->action = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->obj = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->type = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPerms object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPermsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPermsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPermsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setNew(false); - } else { - $affectedRows += CcPermsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPermsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getPermid(); - break; - case 1: - return $this->getSubj(); - break; - case 2: - return $this->getAction(); - break; - case 3: - return $this->getObj(); - break; - case 4: - return $this->getType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPermsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getPermid(), - $keys[1] => $this->getSubj(), - $keys[2] => $this->getAction(), - $keys[3] => $this->getObj(), - $keys[4] => $this->getType(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setPermid($value); - break; - case 1: - $this->setSubj($value); - break; - case 2: - $this->setAction($value); - break; - case 3: - $this->setObj($value); - break; - case 4: - $this->setType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPermsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setPermid($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSubj($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setAction($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setObj($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setType($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPermsPeer::PERMID)) $criteria->add(CcPermsPeer::PERMID, $this->permid); - if ($this->isColumnModified(CcPermsPeer::SUBJ)) $criteria->add(CcPermsPeer::SUBJ, $this->subj); - if ($this->isColumnModified(CcPermsPeer::ACTION)) $criteria->add(CcPermsPeer::ACTION, $this->action); - if ($this->isColumnModified(CcPermsPeer::OBJ)) $criteria->add(CcPermsPeer::OBJ, $this->obj); - if ($this->isColumnModified(CcPermsPeer::TYPE)) $criteria->add(CcPermsPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $this->permid); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getPermid(); - } - - /** - * Generic method to set the primary key (permid column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setPermid($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getPermid(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPerms (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setPermid($this->permid); - $copyObj->setSubj($this->subj); - $copyObj->setAction($this->action); - $copyObj->setObj($this->obj); - $copyObj->setType($this->type); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPerms Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPermsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPermsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPerms The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setSubj(NULL); - } else { - $this->setSubj($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPerms($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subj !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subj, $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->aCcSubjs->addCcPermss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->permid = null; - $this->subj = null; - $this->action = null; - $this->obj = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPerms diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsPeer.php deleted file mode 100644 index 4bd4c07ea..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsPeer.php +++ /dev/null @@ -1,984 +0,0 @@ - array ('Permid', 'Subj', 'Action', 'Obj', 'Type', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('permid', 'subj', 'action', 'obj', 'type', ), - BasePeer::TYPE_COLNAME => array (self::PERMID, self::SUBJ, self::ACTION, self::OBJ, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('PERMID', 'SUBJ', 'ACTION', 'OBJ', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('permid', 'subj', 'action', 'obj', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Permid' => 0, 'Subj' => 1, 'Action' => 2, 'Obj' => 3, 'Type' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ), - BasePeer::TYPE_COLNAME => array (self::PERMID => 0, self::SUBJ => 1, self::ACTION => 2, self::OBJ => 3, self::TYPE => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('PERMID' => 0, 'SUBJ' => 1, 'ACTION' => 2, 'OBJ' => 3, 'TYPE' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPermsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPermsPeer::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(CcPermsPeer::PERMID); - $criteria->addSelectColumn(CcPermsPeer::SUBJ); - $criteria->addSelectColumn(CcPermsPeer::ACTION); - $criteria->addSelectColumn(CcPermsPeer::OBJ); - $criteria->addSelectColumn(CcPermsPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.PERMID'); - $criteria->addSelectColumn($alias . '.SUBJ'); - $criteria->addSelectColumn($alias . '.ACTION'); - $criteria->addSelectColumn($alias . '.OBJ'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::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 CcPerms - * @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 = CcPermsPeer::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 CcPermsPeer::populateObjects(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPermsPeer::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 CcPerms $value A CcPerms object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPerms $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getPermid(); - } // 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 CcPerms object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPerms) { - $key = (string) $value->getPermid(); - } 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 CcPerms 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 CcPerms 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_perms - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPermsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPermsPeer::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; - CcPermsPeer::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 (CcPerms object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPermsPeer::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 + CcPermsPeer::NUM_COLUMNS; - } else { - $cls = CcPermsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPermsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::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 CcPerms objects pre-filled with their CcSubjs 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 CcPerms objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPermsPeer::addSelectColumns($criteria); - $startcol = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPermsPeer::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 = CcPermsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPermsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPerms) to $obj2 (CcSubjs) - $obj2->addCcPerms($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(CcPermsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::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 CcPerms 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 CcPerms 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); - } - - CcPermsPeer::addSelectColumns($criteria); - $startcol2 = (CcPermsPeer::NUM_COLUMNS - CcPermsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPermsPeer::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 = CcPermsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPermsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPerms) to the collection in $obj2 (CcSubjs) - $obj2->addCcPerms($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(BaseCcPermsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPermsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPermsTableMap()); - } - } - - /** - * 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 ? CcPermsPeer::CLASS_DEFAULT : CcPermsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPerms or Criteria object. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPerms object - } - - - // 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 CcPerms or Criteria object. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPermsPeer::PERMID); - $value = $criteria->remove(CcPermsPeer::PERMID); - if ($value) { - $selectCriteria->add(CcPermsPeer::PERMID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME); - } - - } else { // $values is CcPerms 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_perms 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(CcPermsPeer::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(CcPermsPeer::TABLE_NAME, $con, CcPermsPeer::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). - CcPermsPeer::clearInstancePool(); - CcPermsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPerms or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPerms 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(CcPermsPeer::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. - CcPermsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPerms) { // it's a model object - // invalidate the cache for this single object - CcPermsPeer::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(CcPermsPeer::PERMID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPermsPeer::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); - CcPermsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPerms 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 CcPerms $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(CcPerms $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPermsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, CcPermsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPerms - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPermsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $pk); - - $v = CcPermsPeer::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(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPermsPeer::DATABASE_NAME); - $criteria->add(CcPermsPeer::PERMID, $pks, Criteria::IN); - $objs = CcPermsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPermsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPermsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsQuery.php deleted file mode 100644 index 5866aa488..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPermsQuery.php +++ /dev/null @@ -1,355 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPerms|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPermsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPermsPeer::PERMID, $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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPermsPeer::PERMID, $keys, Criteria::IN); - } - - /** - * Filter the query on the permid column - * - * @param int|array $permid 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 CcPermsQuery The current query, for fluid interface - */ - public function filterByPermid($permid = null, $comparison = null) - { - if (is_array($permid) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcPermsPeer::PERMID, $permid, $comparison); - } - - /** - * Filter the query on the subj column - * - * @param int|array $subj 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 CcPermsQuery The current query, for fluid interface - */ - public function filterBySubj($subj = null, $comparison = null) - { - if (is_array($subj)) { - $useMinMax = false; - if (isset($subj['min'])) { - $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($subj['max'])) { - $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPermsPeer::SUBJ, $subj, $comparison); - } - - /** - * Filter the query on the action column - * - * @param string $action The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByAction($action = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($action)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $action)) { - $action = str_replace('*', '%', $action); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPermsPeer::ACTION, $action, $comparison); - } - - /** - * Filter the query on the obj column - * - * @param int|array $obj 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 CcPermsQuery The current query, for fluid interface - */ - public function filterByObj($obj = null, $comparison = null) - { - if (is_array($obj)) { - $useMinMax = false; - if (isset($obj['min'])) { - $this->addUsingAlias(CcPermsPeer::OBJ, $obj['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($obj['max'])) { - $this->addUsingAlias(CcPermsPeer::OBJ, $obj['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPermsPeer::OBJ, $obj, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $type The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByType($type = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($type)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $type)) { - $type = str_replace('*', '%', $type); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPermsPeer::TYPE, $type, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPerms $ccPerms Object to remove from the list of results - * - * @return CcPermsQuery The current query, for fluid interface - */ - public function prune($ccPerms = null) - { - if ($ccPerms) { - $this->addUsingAlias(CcPermsPeer::PERMID, $ccPerms->getPermid(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPermsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylist.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylist.php deleted file mode 100644 index 222c1c6f4..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylist.php +++ /dev/null @@ -1,1365 +0,0 @@ -name = ''; - $this->state = 'empty'; - $this->currentlyaccessing = 0; - } - - /** - * Initializes internal state of BaseCcPlaylist object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getDbState() - { - return $this->state; - } - - /** - * Get the [currentlyaccessing] column value. - * - * @return int - */ - public function getDbCurrentlyaccessing() - { - return $this->currentlyaccessing; - } - - /** - * Get the [editedby] column value. - * - * @return int - */ - public function getDbEditedby() - { - return $this->editedby; - } - - /** - * Get the [optionally formatted] temporal [mtime] 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 getDbMtime($format = 'Y-m-d H:i:s') - { - if ($this->mtime === null) { - return null; - } - - - - try { - $dt = new DateTime($this->mtime); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->mtime, 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 [creator] column value. - * - * @return string - */ - public function getDbCreator() - { - return $this->creator; - } - - /** - * Get the [description] column value. - * - * @return string - */ - public function getDbDescription() - { - return $this->description; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPlaylistPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcPlaylistPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v || $this->isNew()) { - $this->state = $v; - $this->modifiedColumns[] = CcPlaylistPeer::STATE; - } - - return $this; - } // setDbState() - - /** - * Set the value of [currentlyaccessing] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbCurrentlyaccessing($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->currentlyaccessing !== $v || $this->isNew()) { - $this->currentlyaccessing = $v; - $this->modifiedColumns[] = CcPlaylistPeer::CURRENTLYACCESSING; - } - - return $this; - } // setDbCurrentlyaccessing() - - /** - * Set the value of [editedby] column. - * - * @param int $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbEditedby($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->editedby !== $v) { - $this->editedby = $v; - $this->modifiedColumns[] = CcPlaylistPeer::EDITEDBY; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbEditedby() - - /** - * Sets the value of [mtime] 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 CcPlaylist The current object (for fluent API support) - */ - public function setDbMtime($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->mtime !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->mtime !== null && $tmpDt = new DateTime($this->mtime)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->mtime = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcPlaylistPeer::MTIME; - } - } // if either are not null - - return $this; - } // setDbMtime() - - /** - * Set the value of [creator] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbCreator($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->creator !== $v) { - $this->creator = $v; - $this->modifiedColumns[] = CcPlaylistPeer::CREATOR; - } - - return $this; - } // setDbCreator() - - /** - * Set the value of [description] column. - * - * @param string $v new value - * @return CcPlaylist The current object (for fluent API support) - */ - public function setDbDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->description !== $v) { - $this->description = $v; - $this->modifiedColumns[] = CcPlaylistPeer::DESCRIPTION; - } - - return $this; - } // setDbDescription() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->state !== 'empty') { - return false; - } - - if ($this->currentlyaccessing !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->state = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->currentlyaccessing = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->editedby = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->mtime = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->creator = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->description = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 8; // 8 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPlaylist object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->editedby !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPlaylistPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - $this->collCcPlaylistcontentss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPlaylistQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPlaylistPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPlaylistPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPlaylistPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPlaylistPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPlaylistPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcPlaylistcontentss !== null) { - foreach ($this->collCcPlaylistcontentss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbName(); - break; - case 2: - return $this->getDbState(); - break; - case 3: - return $this->getDbCurrentlyaccessing(); - break; - case 4: - return $this->getDbEditedby(); - break; - case 5: - return $this->getDbMtime(); - break; - case 6: - return $this->getDbCreator(); - break; - case 7: - return $this->getDbDescription(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPlaylistPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbName(), - $keys[2] => $this->getDbState(), - $keys[3] => $this->getDbCurrentlyaccessing(), - $keys[4] => $this->getDbEditedby(), - $keys[5] => $this->getDbMtime(), - $keys[6] => $this->getDbCreator(), - $keys[7] => $this->getDbDescription(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbName($value); - break; - case 2: - $this->setDbState($value); - break; - case 3: - $this->setDbCurrentlyaccessing($value); - break; - case 4: - $this->setDbEditedby($value); - break; - case 5: - $this->setDbMtime($value); - break; - case 6: - $this->setDbCreator($value); - break; - case 7: - $this->setDbDescription($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPlaylistPeer::getFieldNames($keyType); - - 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[2], $arr)) $this->setDbState($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbCurrentlyaccessing($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbEditedby($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbMtime($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbCreator($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbDescription($arr[$keys[7]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPlaylistPeer::ID)) $criteria->add(CcPlaylistPeer::ID, $this->id); - if ($this->isColumnModified(CcPlaylistPeer::NAME)) $criteria->add(CcPlaylistPeer::NAME, $this->name); - if ($this->isColumnModified(CcPlaylistPeer::STATE)) $criteria->add(CcPlaylistPeer::STATE, $this->state); - if ($this->isColumnModified(CcPlaylistPeer::CURRENTLYACCESSING)) $criteria->add(CcPlaylistPeer::CURRENTLYACCESSING, $this->currentlyaccessing); - if ($this->isColumnModified(CcPlaylistPeer::EDITEDBY)) $criteria->add(CcPlaylistPeer::EDITEDBY, $this->editedby); - if ($this->isColumnModified(CcPlaylistPeer::MTIME)) $criteria->add(CcPlaylistPeer::MTIME, $this->mtime); - if ($this->isColumnModified(CcPlaylistPeer::CREATOR)) $criteria->add(CcPlaylistPeer::CREATOR, $this->creator); - if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPlaylist (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbState($this->state); - $copyObj->setDbCurrentlyaccessing($this->currentlyaccessing); - $copyObj->setDbEditedby($this->editedby); - $copyObj->setDbMtime($this->mtime); - $copyObj->setDbCreator($this->creator); - $copyObj->setDbDescription($this->description); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcPlaylistcontentss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylistcontents($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPlaylist Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPlaylistPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPlaylistPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPlaylist The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbEditedby(NULL); - } else { - $this->setDbEditedby($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylist($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->editedby !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->editedby, $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->aCcSubjs->addCcPlaylists($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears out the collCcPlaylistcontentss 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 addCcPlaylistcontentss() - */ - public function clearCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylistcontentss collection. - * - * By default this just sets the collCcPlaylistcontentss collection to an empty array (like clearcollCcPlaylistcontentss()); - * 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 initCcPlaylistcontentss() - { - $this->collCcPlaylistcontentss = new PropelObjectCollection(); - $this->collCcPlaylistcontentss->setModel('CcPlaylistcontents'); - } - - /** - * Gets an array of CcPlaylistcontents 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 CcPlaylist 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 CcPlaylistcontents[] List of CcPlaylistcontents objects - * @throws PropelException - */ - public function getCcPlaylistcontentss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - // return empty collection - $this->initCcPlaylistcontentss(); - } else { - $collCcPlaylistcontentss = CcPlaylistcontentsQuery::create(null, $criteria) - ->filterByCcPlaylist($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylistcontentss; - } - $this->collCcPlaylistcontentss = $collCcPlaylistcontentss; - } - } - return $this->collCcPlaylistcontentss; - } - - /** - * Returns the number of related CcPlaylistcontents objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylistcontents objects. - * @throws PropelException - */ - public function countCcPlaylistcontentss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylistcontentss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylistcontentss) { - return 0; - } else { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcPlaylist($this) - ->count($con); - } - } else { - return count($this->collCcPlaylistcontentss); - } - } - - /** - * Method called to associate a CcPlaylistcontents object to this object - * through the CcPlaylistcontents foreign key attribute. - * - * @param CcPlaylistcontents $l CcPlaylistcontents - * @return void - * @throws PropelException - */ - public function addCcPlaylistcontents(CcPlaylistcontents $l) - { - if ($this->collCcPlaylistcontentss === null) { - $this->initCcPlaylistcontentss(); - } - if (!$this->collCcPlaylistcontentss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylistcontentss[]= $l; - $l->setCcPlaylist($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcPlaylist is new, it will return - * an empty collection; or if this CcPlaylist has previously - * been saved, it will retrieve related CcPlaylistcontentss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcPlaylist. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcPlaylistcontents[] List of CcPlaylistcontents objects - */ - public function getCcPlaylistcontentssJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcPlaylistcontentsQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcPlaylistcontentss($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->state = null; - $this->currentlyaccessing = null; - $this->editedby = null; - $this->mtime = null; - $this->creator = null; - $this->description = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcPlaylistcontentss) { - foreach ((array) $this->collCcPlaylistcontentss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcPlaylistcontentss = null; - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistPeer.php deleted file mode 100644 index 0e338bc39..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistPeer.php +++ /dev/null @@ -1,1006 +0,0 @@ - array ('DbId', 'DbName', 'DbState', 'DbCurrentlyaccessing', 'DbEditedby', 'DbMtime', 'DbCreator', 'DbDescription', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbState', 'dbCurrentlyaccessing', 'dbEditedby', 'dbMtime', 'dbCreator', 'dbDescription', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::STATE, self::CURRENTLYACCESSING, self::EDITEDBY, self::MTIME, self::CREATOR, self::DESCRIPTION, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'STATE', 'CURRENTLYACCESSING', 'EDITEDBY', 'MTIME', 'CREATOR', 'DESCRIPTION', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'state', 'currentlyaccessing', 'editedby', 'mtime', 'creator', 'description', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) - ); - - /** - * 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, 'DbName' => 1, 'DbState' => 2, 'DbCurrentlyaccessing' => 3, 'DbEditedby' => 4, 'DbMtime' => 5, 'DbCreator' => 6, 'DbDescription' => 7, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbState' => 2, 'dbCurrentlyaccessing' => 3, 'dbEditedby' => 4, 'dbMtime' => 5, 'dbCreator' => 6, 'dbDescription' => 7, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::STATE => 2, self::CURRENTLYACCESSING => 3, self::EDITEDBY => 4, self::MTIME => 5, self::CREATOR => 6, self::DESCRIPTION => 7, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'STATE' => 2, 'CURRENTLYACCESSING' => 3, 'EDITEDBY' => 4, 'MTIME' => 5, 'CREATOR' => 6, 'DESCRIPTION' => 7, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'state' => 2, 'currentlyaccessing' => 3, 'editedby' => 4, 'mtime' => 5, 'creator' => 6, 'description' => 7, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPlaylistPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPlaylistPeer::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(CcPlaylistPeer::ID); - $criteria->addSelectColumn(CcPlaylistPeer::NAME); - $criteria->addSelectColumn(CcPlaylistPeer::STATE); - $criteria->addSelectColumn(CcPlaylistPeer::CURRENTLYACCESSING); - $criteria->addSelectColumn(CcPlaylistPeer::EDITEDBY); - $criteria->addSelectColumn(CcPlaylistPeer::MTIME); - $criteria->addSelectColumn(CcPlaylistPeer::CREATOR); - $criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.CURRENTLYACCESSING'); - $criteria->addSelectColumn($alias . '.EDITEDBY'); - $criteria->addSelectColumn($alias . '.MTIME'); - $criteria->addSelectColumn($alias . '.CREATOR'); - $criteria->addSelectColumn($alias . '.DESCRIPTION'); - } - } - - /** - * 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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::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 CcPlaylist - * @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 = CcPlaylistPeer::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 CcPlaylistPeer::populateObjects(CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPlaylistPeer::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 CcPlaylist $value A CcPlaylist object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPlaylist $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 CcPlaylist object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPlaylist) { - $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 CcPlaylist 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 CcPlaylist 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_playlist - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcPlaylistcontentsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPlaylistcontentsPeer::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 = CcPlaylistPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPlaylistPeer::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; - CcPlaylistPeer::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 (CcPlaylist object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPlaylistPeer::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 + CcPlaylistPeer::NUM_COLUMNS; - } else { - $cls = CcPlaylistPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPlaylistPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::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 CcPlaylist objects pre-filled with their CcSubjs 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 CcPlaylist objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistPeer::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 = CcPlaylistPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylist) to $obj2 (CcSubjs) - $obj2->addCcPlaylist($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(CcPlaylistPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::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 CcPlaylist 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 CcPlaylist 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); - } - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistPeer::EDITEDBY, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistPeer::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 = CcPlaylistPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPlaylist) to the collection in $obj2 (CcSubjs) - $obj2->addCcPlaylist($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(BaseCcPlaylistPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPlaylistPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPlaylistTableMap()); - } - } - - /** - * 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 ? CcPlaylistPeer::CLASS_DEFAULT : CcPlaylistPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPlaylist or Criteria object. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPlaylist object - } - - if ($criteria->containsKey(CcPlaylistPeer::ID) && $criteria->keyContainsValue(CcPlaylistPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistPeer::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 CcPlaylist or Criteria object. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPlaylistPeer::ID); - $value = $criteria->remove(CcPlaylistPeer::ID); - if ($value) { - $selectCriteria->add(CcPlaylistPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPlaylistPeer::TABLE_NAME); - } - - } else { // $values is CcPlaylist 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_playlist 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(CcPlaylistPeer::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(CcPlaylistPeer::TABLE_NAME, $con, CcPlaylistPeer::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). - CcPlaylistPeer::clearInstancePool(); - CcPlaylistPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPlaylist or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPlaylist 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(CcPlaylistPeer::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. - CcPlaylistPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPlaylist) { // it's a model object - // invalidate the cache for this single object - CcPlaylistPeer::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(CcPlaylistPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPlaylistPeer::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); - CcPlaylistPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPlaylist 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 CcPlaylist $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(CcPlaylist $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPlaylistPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, CcPlaylistPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPlaylist - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPlaylistPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $pk); - - $v = CcPlaylistPeer::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(CcPlaylistPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPlaylistPeer::DATABASE_NAME); - $criteria->add(CcPlaylistPeer::ID, $pks, Criteria::IN); - $objs = CcPlaylistPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPlaylistPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPlaylistPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistQuery.php deleted file mode 100644 index 0ab594b7a..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistQuery.php +++ /dev/null @@ -1,510 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPlaylist|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPlaylistPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPlaylistPeer::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 CcPlaylistQuery 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(CcPlaylistPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $dbState The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbState($dbState = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbState)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbState)) { - $dbState = str_replace('*', '%', $dbState); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::STATE, $dbState, $comparison); - } - - /** - * Filter the query on the currentlyaccessing column - * - * @param int|array $dbCurrentlyaccessing 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbCurrentlyaccessing($dbCurrentlyaccessing = null, $comparison = null) - { - if (is_array($dbCurrentlyaccessing)) { - $useMinMax = false; - if (isset($dbCurrentlyaccessing['min'])) { - $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCurrentlyaccessing['max'])) { - $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::CURRENTLYACCESSING, $dbCurrentlyaccessing, $comparison); - } - - /** - * Filter the query on the editedby column - * - * @param int|array $dbEditedby 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbEditedby($dbEditedby = null, $comparison = null) - { - if (is_array($dbEditedby)) { - $useMinMax = false; - if (isset($dbEditedby['min'])) { - $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEditedby['max'])) { - $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::EDITEDBY, $dbEditedby, $comparison); - } - - /** - * Filter the query on the mtime column - * - * @param string|array $dbMtime 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 CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbMtime($dbMtime = null, $comparison = null) - { - if (is_array($dbMtime)) { - $useMinMax = false; - if (isset($dbMtime['min'])) { - $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbMtime['max'])) { - $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistPeer::MTIME, $dbMtime, $comparison); - } - - /** - * Filter the query on the creator column - * - * @param string $dbCreator The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbCreator($dbCreator = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbCreator)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbCreator)) { - $dbCreator = str_replace('*', '%', $dbCreator); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::CREATOR, $dbCreator, $comparison); - } - - /** - * Filter the query on the description column - * - * @param string $dbDescription The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByDbDescription($dbDescription = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDescription)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDescription)) { - $dbDescription = str_replace('*', '%', $dbDescription); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPlaylistPeer::DESCRIPTION, $dbDescription, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistPeer::EDITEDBY, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Filter the query by a related CcPlaylistcontents object - * - * @param CcPlaylistcontents $ccPlaylistcontents the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function filterByCcPlaylistcontents($ccPlaylistcontents, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylistcontents->getDbPlaylistId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylistcontents relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function joinCcPlaylistcontents($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylistcontents'); - - // 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, 'CcPlaylistcontents'); - } - - return $this; - } - - /** - * Use the CcPlaylistcontents relation CcPlaylistcontents 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 CcPlaylistcontentsQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistcontentsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylistcontents($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylistcontents', 'CcPlaylistcontentsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPlaylist $ccPlaylist Object to remove from the list of results - * - * @return CcPlaylistQuery The current query, for fluid interface - */ - public function prune($ccPlaylist = null) - { - if ($ccPlaylist) { - $this->addUsingAlias(CcPlaylistPeer::ID, $ccPlaylist->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPlaylistQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontents.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontents.php deleted file mode 100644 index 0118d5038..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontents.php +++ /dev/null @@ -1,1540 +0,0 @@ -cliplength = '00:00:00'; - $this->cuein = '00:00:00'; - $this->cueout = '00:00:00'; - $this->fadein = '00:00:00'; - $this->fadeout = '00:00:00'; - } - - /** - * Initializes internal state of BaseCcPlaylistcontents object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [playlist_id] column value. - * - * @return int - */ - public function getDbPlaylistId() - { - return $this->playlist_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbFileId() - { - return $this->file_id; - } - - /** - * Get the [position] column value. - * - * @return int - */ - public function getDbPosition() - { - return $this->position; - } - - /** - * Get the [optionally formatted] temporal [cliplength] 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 getDbCliplength($format = '%X') - { - if ($this->cliplength === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cliplength); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cliplength, 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 [optionally formatted] temporal [cuein] 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 getDbCuein($format = '%X') - { - if ($this->cuein === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cuein); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cuein, 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 [optionally formatted] temporal [cueout] 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 getDbCueout($format = '%X') - { - if ($this->cueout === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cueout); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cueout, 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 [optionally formatted] temporal [fadein] 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 getDbFadein($format = '%X') - { - if ($this->fadein === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fadein); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadein, 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 [optionally formatted] temporal [fadeout] 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 getDbFadeout($format = '%X') - { - if ($this->fadeout === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fadeout); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fadeout, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [playlist_id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbPlaylistId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->playlist_id !== $v) { - $this->playlist_id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::PLAYLIST_ID; - } - - if ($this->aCcPlaylist !== null && $this->aCcPlaylist->getDbId() !== $v) { - $this->aCcPlaylist = null; - } - - return $this; - } // setDbPlaylistId() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFileId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbFileId() - - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[] = CcPlaylistcontentsPeer::POSITION; - } - - return $this; - } // setDbPosition() - - /** - * Sets the value of [cliplength] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCliplength($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->cliplength !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cliplength !== null && $tmpDt = new DateTime($this->cliplength)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cliplength = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - } - } // if either are not null - - return $this; - } // setDbCliplength() - - /** - * Sets the value of [cuein] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCuein($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->cuein !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cuein !== null && $tmpDt = new DateTime($this->cuein)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cuein = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - } - } // if either are not null - - return $this; - } // setDbCuein() - - /** - * Sets the value of [cueout] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbCueout($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->cueout !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cueout !== null && $tmpDt = new DateTime($this->cueout)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cueout = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - } - } // if either are not null - - return $this; - } // setDbCueout() - - /** - * Sets the value of [fadein] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFadein($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->fadein !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fadein !== null && $tmpDt = new DateTime($this->fadein)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fadein = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - } - } // if either are not null - - return $this; - } // setDbFadein() - - /** - * Sets the value of [fadeout] 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 CcPlaylistcontents The current object (for fluent API support) - */ - public function setDbFadeout($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->fadeout !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fadeout !== null && $tmpDt = new DateTime($this->fadeout)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fadeout = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - } - } // if either are not null - - return $this; - } // setDbFadeout() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->cliplength !== '00:00:00') { - return false; - } - - if ($this->cuein !== '00:00:00') { - return false; - } - - if ($this->cueout !== '00:00:00') { - return false; - } - - if ($this->fadein !== '00:00:00') { - return false; - } - - if ($this->fadeout !== '00:00:00') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->playlist_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->file_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->position = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->cliplength = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->cuein = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->cueout = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->fadein = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->fadeout = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 9; // 9 = CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPlaylistcontents object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcPlaylist !== null && $this->playlist_id !== $this->aCcPlaylist->getDbId()) { - $this->aCcPlaylist = null; - } - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPlaylistcontentsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcFiles = null; - $this->aCcPlaylist = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPlaylistcontentsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPlaylistcontentsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->aCcPlaylist !== null) { - if ($this->aCcPlaylist->isModified() || $this->aCcPlaylist->isNew()) { - $affectedRows += $this->aCcPlaylist->save($con); - } - $this->setCcPlaylist($this->aCcPlaylist); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPlaylistcontentsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPlaylistcontentsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistcontentsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPlaylistcontentsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - if ($this->aCcPlaylist !== null) { - if (!$this->aCcPlaylist->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcPlaylist->getValidationFailures()); - } - } - - - if (($retval = CcPlaylistcontentsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistcontentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbPlaylistId(); - break; - case 2: - return $this->getDbFileId(); - break; - case 3: - return $this->getDbPosition(); - break; - case 4: - return $this->getDbCliplength(); - break; - case 5: - return $this->getDbCuein(); - break; - case 6: - return $this->getDbCueout(); - break; - case 7: - return $this->getDbFadein(); - break; - case 8: - return $this->getDbFadeout(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPlaylistcontentsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbPlaylistId(), - $keys[2] => $this->getDbFileId(), - $keys[3] => $this->getDbPosition(), - $keys[4] => $this->getDbCliplength(), - $keys[5] => $this->getDbCuein(), - $keys[6] => $this->getDbCueout(), - $keys[7] => $this->getDbFadein(), - $keys[8] => $this->getDbFadeout(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcPlaylist) { - $result['CcPlaylist'] = $this->aCcPlaylist->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPlaylistcontentsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbPlaylistId($value); - break; - case 2: - $this->setDbFileId($value); - break; - case 3: - $this->setDbPosition($value); - break; - case 4: - $this->setDbCliplength($value); - break; - case 5: - $this->setDbCuein($value); - break; - case 6: - $this->setDbCueout($value); - break; - case 7: - $this->setDbFadein($value); - break; - case 8: - $this->setDbFadeout($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPlaylistcontentsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbFileId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbPosition($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbCliplength($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbCuein($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbCueout($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbFadein($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbFadeout($arr[$keys[8]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPlaylistcontentsPeer::ID)) $criteria->add(CcPlaylistcontentsPeer::ID, $this->id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::PLAYLIST_ID)) $criteria->add(CcPlaylistcontentsPeer::PLAYLIST_ID, $this->playlist_id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FILE_ID)) $criteria->add(CcPlaylistcontentsPeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcPlaylistcontentsPeer::POSITION)) $criteria->add(CcPlaylistcontentsPeer::POSITION, $this->position); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CLIPLENGTH)) $criteria->add(CcPlaylistcontentsPeer::CLIPLENGTH, $this->cliplength); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEIN)) $criteria->add(CcPlaylistcontentsPeer::CUEIN, $this->cuein); - if ($this->isColumnModified(CcPlaylistcontentsPeer::CUEOUT)) $criteria->add(CcPlaylistcontentsPeer::CUEOUT, $this->cueout); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FADEIN)) $criteria->add(CcPlaylistcontentsPeer::FADEIN, $this->fadein); - if ($this->isColumnModified(CcPlaylistcontentsPeer::FADEOUT)) $criteria->add(CcPlaylistcontentsPeer::FADEOUT, $this->fadeout); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPlaylistcontents (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbPlaylistId($this->playlist_id); - $copyObj->setDbFileId($this->file_id); - $copyObj->setDbPosition($this->position); - $copyObj->setDbCliplength($this->cliplength); - $copyObj->setDbCuein($this->cuein); - $copyObj->setDbCueout($this->cueout); - $copyObj->setDbFadein($this->fadein); - $copyObj->setDbFadeout($this->fadeout); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPlaylistcontents Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPlaylistcontentsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPlaylistcontentsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcPlaylistcontents The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbFileId(NULL); - } else { - $this->setDbFileId($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylistcontents($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcPlaylistcontentss($this); - */ - } - return $this->aCcFiles; - } - - /** - * Declares an association between this object and a CcPlaylist object. - * - * @param CcPlaylist $v - * @return CcPlaylistcontents The current object (for fluent API support) - * @throws PropelException - */ - public function setCcPlaylist(CcPlaylist $v = null) - { - if ($v === null) { - $this->setDbPlaylistId(NULL); - } else { - $this->setDbPlaylistId($v->getDbId()); - } - - $this->aCcPlaylist = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcPlaylist object, it will not be re-added. - if ($v !== null) { - $v->addCcPlaylistcontents($this); - } - - return $this; - } - - - /** - * Get the associated CcPlaylist object - * - * @param PropelPDO Optional Connection object. - * @return CcPlaylist The associated CcPlaylist object. - * @throws PropelException - */ - public function getCcPlaylist(PropelPDO $con = null) - { - if ($this->aCcPlaylist === null && ($this->playlist_id !== null)) { - $this->aCcPlaylist = CcPlaylistQuery::create()->findPk($this->playlist_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->aCcPlaylist->addCcPlaylistcontentss($this); - */ - } - return $this->aCcPlaylist; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->playlist_id = null; - $this->file_id = null; - $this->position = null; - $this->cliplength = null; - $this->cuein = null; - $this->cueout = null; - $this->fadein = null; - $this->fadeout = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcFiles = null; - $this->aCcPlaylist = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsPeer.php deleted file mode 100644 index 0bb899b67..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsPeer.php +++ /dev/null @@ -1,1395 +0,0 @@ - array ('DbId', 'DbPlaylistId', 'DbFileId', 'DbPosition', 'DbCliplength', 'DbCuein', 'DbCueout', 'DbFadein', 'DbFadeout', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbPlaylistId', 'dbFileId', 'dbPosition', 'dbCliplength', 'dbCuein', 'dbCueout', 'dbFadein', 'dbFadeout', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::PLAYLIST_ID, self::FILE_ID, self::POSITION, self::CLIPLENGTH, self::CUEIN, self::CUEOUT, self::FADEIN, self::FADEOUT, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'PLAYLIST_ID', 'FILE_ID', 'POSITION', 'CLIPLENGTH', 'CUEIN', 'CUEOUT', 'FADEIN', 'FADEOUT', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'playlist_id', 'file_id', 'position', 'cliplength', 'cuein', 'cueout', 'fadein', 'fadeout', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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, 'DbPlaylistId' => 1, 'DbFileId' => 2, 'DbPosition' => 3, 'DbCliplength' => 4, 'DbCuein' => 5, 'DbCueout' => 6, 'DbFadein' => 7, 'DbFadeout' => 8, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbPlaylistId' => 1, 'dbFileId' => 2, 'dbPosition' => 3, 'dbCliplength' => 4, 'dbCuein' => 5, 'dbCueout' => 6, 'dbFadein' => 7, 'dbFadeout' => 8, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::PLAYLIST_ID => 1, self::FILE_ID => 2, self::POSITION => 3, self::CLIPLENGTH => 4, self::CUEIN => 5, self::CUEOUT => 6, self::FADEIN => 7, self::FADEOUT => 8, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'PLAYLIST_ID' => 1, 'FILE_ID' => 2, 'POSITION' => 3, 'CLIPLENGTH' => 4, 'CUEIN' => 5, 'CUEOUT' => 6, 'FADEIN' => 7, 'FADEOUT' => 8, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'playlist_id' => 1, 'file_id' => 2, 'position' => 3, 'cliplength' => 4, 'cuein' => 5, 'cueout' => 6, 'fadein' => 7, 'fadeout' => 8, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPlaylistcontentsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::PLAYLIST_ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FILE_ID); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::POSITION); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CLIPLENGTH); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEIN); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::CUEOUT); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FADEIN); - $criteria->addSelectColumn(CcPlaylistcontentsPeer::FADEOUT); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.CLIPLENGTH'); - $criteria->addSelectColumn($alias . '.CUEIN'); - $criteria->addSelectColumn($alias . '.CUEOUT'); - $criteria->addSelectColumn($alias . '.FADEIN'); - $criteria->addSelectColumn($alias . '.FADEOUT'); - } - } - - /** - * 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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::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 CcPlaylistcontents - * @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 = CcPlaylistcontentsPeer::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 CcPlaylistcontentsPeer::populateObjects(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPlaylistcontentsPeer::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 CcPlaylistcontents $value A CcPlaylistcontents object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPlaylistcontents $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 CcPlaylistcontents object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPlaylistcontents) { - $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 CcPlaylistcontents 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 CcPlaylistcontents 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_playlistcontents - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPlaylistcontentsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPlaylistcontentsPeer::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; - CcPlaylistcontentsPeer::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 (CcPlaylistcontents object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPlaylistcontentsPeer::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 + CcPlaylistcontentsPeer::NUM_COLUMNS; - } else { - $cls = CcPlaylistcontentsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPlaylistcontentsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinCcPlaylist(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcPlaylistcontents objects pre-filled with their CcFiles 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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcFiles(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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcPlaylistcontents objects pre-filled with their CcPlaylist 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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcPlaylist(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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - CcPlaylistPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcPlaylistPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to $obj2 (CcPlaylist) - $obj2->addCcPlaylistcontents($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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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 CcPlaylistcontents 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 CcPlaylistcontents 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); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - } // if joined row not null - - // Add objects for joined CcPlaylist rows - - $key3 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcPlaylistPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcPlaylistPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj3 (CcPlaylist) - $obj3->addCcPlaylistcontents($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcPlaylist 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 doCountJoinAllExceptCcPlaylist(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(CcPlaylistcontentsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPlaylistcontentsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::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 CcPlaylistcontents objects pre-filled with all related objects except CcFiles. - * - * @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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcPlaylistPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::PLAYLIST_ID, CcPlaylistPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcPlaylist rows - - $key2 = CcPlaylistPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcPlaylistPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcPlaylistPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcPlaylistPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcPlaylist) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcPlaylistcontents objects pre-filled with all related objects except CcPlaylist. - * - * @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 CcPlaylistcontents objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcPlaylist(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcPlaylistcontentsPeer::addSelectColumns($criteria); - $startcol2 = (CcPlaylistcontentsPeer::NUM_COLUMNS - CcPlaylistcontentsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPlaylistcontentsPeer::FILE_ID, CcFilesPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPlaylistcontentsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPlaylistcontentsPeer::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 = CcPlaylistcontentsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPlaylistcontentsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcPlaylistcontents) to the collection in $obj2 (CcFiles) - $obj2->addCcPlaylistcontents($obj1); - - } // if joined row is 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(BaseCcPlaylistcontentsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPlaylistcontentsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPlaylistcontentsTableMap()); - } - } - - /** - * 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 ? CcPlaylistcontentsPeer::CLASS_DEFAULT : CcPlaylistcontentsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPlaylistcontents or Criteria object. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPlaylistcontents object - } - - if ($criteria->containsKey(CcPlaylistcontentsPeer::ID) && $criteria->keyContainsValue(CcPlaylistcontentsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPlaylistcontentsPeer::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 CcPlaylistcontents or Criteria object. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPlaylistcontentsPeer::ID); - $value = $criteria->remove(CcPlaylistcontentsPeer::ID); - if ($value) { - $selectCriteria->add(CcPlaylistcontentsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPlaylistcontentsPeer::TABLE_NAME); - } - - } else { // $values is CcPlaylistcontents 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_playlistcontents 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(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::TABLE_NAME, $con, CcPlaylistcontentsPeer::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). - CcPlaylistcontentsPeer::clearInstancePool(); - CcPlaylistcontentsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPlaylistcontents or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPlaylistcontents 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(CcPlaylistcontentsPeer::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. - CcPlaylistcontentsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPlaylistcontents) { // it's a model object - // invalidate the cache for this single object - CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPlaylistcontentsPeer::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); - CcPlaylistcontentsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPlaylistcontents 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 CcPlaylistcontents $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(CcPlaylistcontents $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPlaylistcontentsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, CcPlaylistcontentsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPlaylistcontents - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPlaylistcontentsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $pk); - - $v = CcPlaylistcontentsPeer::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(CcPlaylistcontentsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPlaylistcontentsPeer::DATABASE_NAME); - $criteria->add(CcPlaylistcontentsPeer::ID, $pks, Criteria::IN); - $objs = CcPlaylistcontentsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPlaylistcontentsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPlaylistcontentsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsQuery.php deleted file mode 100644 index 6c717c6c6..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPlaylistcontentsQuery.php +++ /dev/null @@ -1,581 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPlaylistcontents|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPlaylistcontentsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPlaylistcontentsPeer::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 CcPlaylistcontentsQuery 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(CcPlaylistcontentsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the playlist_id column - * - * @param int|array $dbPlaylistId 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) - { - if (is_array($dbPlaylistId)) { - $useMinMax = false; - if (isset($dbPlaylistId['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPlaylistId['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $dbPlaylistId, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbFileId 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFileId($dbFileId = null, $comparison = null) - { - if (is_array($dbFileId)) { - $useMinMax = false; - if (isset($dbFileId['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFileId['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $dbFileId, $comparison); - } - - /** - * Filter the query on the position column - * - * @param int|array $dbPosition The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbPosition($dbPosition = null, $comparison = null) - { - if (is_array($dbPosition)) { - $useMinMax = false; - if (isset($dbPosition['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPosition['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::POSITION, $dbPosition, $comparison); - } - - /** - * Filter the query on the cliplength column - * - * @param string|array $dbCliplength 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCliplength($dbCliplength = null, $comparison = null) - { - if (is_array($dbCliplength)) { - $useMinMax = false; - if (isset($dbCliplength['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCliplength['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CLIPLENGTH, $dbCliplength, $comparison); - } - - /** - * Filter the query on the cuein column - * - * @param string|array $dbCuein 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCuein($dbCuein = null, $comparison = null) - { - if (is_array($dbCuein)) { - $useMinMax = false; - if (isset($dbCuein['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCuein['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEIN, $dbCuein, $comparison); - } - - /** - * Filter the query on the cueout column - * - * @param string|array $dbCueout 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbCueout($dbCueout = null, $comparison = null) - { - if (is_array($dbCueout)) { - $useMinMax = false; - if (isset($dbCueout['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueout['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::CUEOUT, $dbCueout, $comparison); - } - - /** - * Filter the query on the fadein column - * - * @param string|array $dbFadein 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFadein($dbFadein = null, $comparison = null) - { - if (is_array($dbFadein)) { - $useMinMax = false; - if (isset($dbFadein['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadein['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEIN, $dbFadein, $comparison); - } - - /** - * Filter the query on the fadeout column - * - * @param string|array $dbFadeout 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 CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByDbFadeout($dbFadeout = null, $comparison = null) - { - if (is_array($dbFadeout)) { - $useMinMax = false; - if (isset($dbFadeout['min'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeout['max'])) { - $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPlaylistcontentsPeer::FADEOUT, $dbFadeout, $comparison); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistcontentsPeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Filter the query by a related CcPlaylist object - * - * @param CcPlaylist $ccPlaylist the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) - { - return $this - ->addUsingAlias(CcPlaylistcontentsPeer::PLAYLIST_ID, $ccPlaylist->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylist relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); - - // 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, 'CcPlaylist'); - } - - return $this; - } - - /** - * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); - } - - /** - * Exclude object from result - * - * @param CcPlaylistcontents $ccPlaylistcontents Object to remove from the list of results - * - * @return CcPlaylistcontentsQuery The current query, for fluid interface - */ - public function prune($ccPlaylistcontents = null) - { - if ($ccPlaylistcontents) { - $this->addUsingAlias(CcPlaylistcontentsPeer::ID, $ccPlaylistcontents->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPlaylistcontentsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPref.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPref.php deleted file mode 100644 index b1d9a307e..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPref.php +++ /dev/null @@ -1,905 +0,0 @@ -id; - } - - /** - * Get the [subjid] column value. - * - * @return int - */ - public function getSubjid() - { - return $this->subjid; - } - - /** - * Get the [keystr] column value. - * - * @return string - */ - public function getKeystr() - { - return $this->keystr; - } - - /** - * Get the [valstr] column value. - * - * @return string - */ - public function getValstr() - { - return $this->valstr; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcPrefPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [subjid] column. - * - * @param int $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setSubjid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subjid !== $v) { - $this->subjid = $v; - $this->modifiedColumns[] = CcPrefPeer::SUBJID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setSubjid() - - /** - * Set the value of [keystr] column. - * - * @param string $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setKeystr($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->keystr !== $v) { - $this->keystr = $v; - $this->modifiedColumns[] = CcPrefPeer::KEYSTR; - } - - return $this; - } // setKeystr() - - /** - * Set the value of [valstr] column. - * - * @param string $v new value - * @return CcPref The current object (for fluent API support) - */ - public function setValstr($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->valstr !== $v) { - $this->valstr = $v; - $this->modifiedColumns[] = CcPrefPeer::VALSTR; - } - - return $this; - } // setValstr() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->subjid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->keystr = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->valstr = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcPref object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->subjid !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcPrefPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcPrefQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcPrefPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcPrefPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcPrefPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcPrefPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcPrefPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getSubjid(); - break; - case 2: - return $this->getKeystr(); - break; - case 3: - return $this->getValstr(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcPrefPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getSubjid(), - $keys[2] => $this->getKeystr(), - $keys[3] => $this->getValstr(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcPrefPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setSubjid($value); - break; - case 2: - $this->setKeystr($value); - break; - case 3: - $this->setValstr($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcPrefPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setSubjid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setKeystr($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setValstr($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcPrefPeer::ID)) $criteria->add(CcPrefPeer::ID, $this->id); - if ($this->isColumnModified(CcPrefPeer::SUBJID)) $criteria->add(CcPrefPeer::SUBJID, $this->subjid); - if ($this->isColumnModified(CcPrefPeer::KEYSTR)) $criteria->add(CcPrefPeer::KEYSTR, $this->keystr); - if ($this->isColumnModified(CcPrefPeer::VALSTR)) $criteria->add(CcPrefPeer::VALSTR, $this->valstr); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcPref (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setSubjid($this->subjid); - $copyObj->setKeystr($this->keystr); - $copyObj->setValstr($this->valstr); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcPref Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcPrefPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcPrefPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcPref The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setSubjid(NULL); - } else { - $this->setSubjid($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcPref($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subjid !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subjid, $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->aCcSubjs->addCcPrefs($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->subjid = null; - $this->keystr = null; - $this->valstr = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcPref diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefPeer.php deleted file mode 100644 index cb6345eac..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefPeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('Id', 'Subjid', 'Keystr', 'Valstr', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'subjid', 'keystr', 'valstr', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SUBJID, self::KEYSTR, self::VALSTR, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SUBJID', 'KEYSTR', 'VALSTR', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'subjid', 'keystr', 'valstr', ), - 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 ('Id' => 0, 'Subjid' => 1, 'Keystr' => 2, 'Valstr' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 3, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SUBJID => 1, self::KEYSTR => 2, self::VALSTR => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SUBJID' => 1, 'KEYSTR' => 2, 'VALSTR' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'subjid' => 1, 'keystr' => 2, 'valstr' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcPrefPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcPrefPeer::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(CcPrefPeer::ID); - $criteria->addSelectColumn(CcPrefPeer::SUBJID); - $criteria->addSelectColumn(CcPrefPeer::KEYSTR); - $criteria->addSelectColumn(CcPrefPeer::VALSTR); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.SUBJID'); - $criteria->addSelectColumn($alias . '.KEYSTR'); - $criteria->addSelectColumn($alias . '.VALSTR'); - } - } - - /** - * 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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::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 CcPref - * @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 = CcPrefPeer::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 CcPrefPeer::populateObjects(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcPrefPeer::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 CcPref $value A CcPref object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcPref $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcPref object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcPref) { - $key = (string) $value->getId(); - } 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 CcPref 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 CcPref 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_pref - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcPrefPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcPrefPeer::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; - CcPrefPeer::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 (CcPref object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcPrefPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcPrefPeer::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 + CcPrefPeer::NUM_COLUMNS; - } else { - $cls = CcPrefPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcPrefPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::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 CcPref objects pre-filled with their CcSubjs 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 CcPref objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcPrefPeer::addSelectColumns($criteria); - $startcol = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPrefPeer::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 = CcPrefPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPrefPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcPref) to $obj2 (CcSubjs) - $obj2->addCcPref($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(CcPrefPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::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 CcPref 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 CcPref 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); - } - - CcPrefPeer::addSelectColumns($criteria); - $startcol2 = (CcPrefPeer::NUM_COLUMNS - CcPrefPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcPrefPeer::SUBJID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcPrefPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcPrefPeer::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 = CcPrefPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcPrefPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcPref) to the collection in $obj2 (CcSubjs) - $obj2->addCcPref($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(BaseCcPrefPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcPrefPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcPrefTableMap()); - } - } - - /** - * 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 ? CcPrefPeer::CLASS_DEFAULT : CcPrefPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcPref or Criteria object. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcPref object - } - - if ($criteria->containsKey(CcPrefPeer::ID) && $criteria->keyContainsValue(CcPrefPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcPrefPeer::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 CcPref or Criteria object. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcPrefPeer::ID); - $value = $criteria->remove(CcPrefPeer::ID); - if ($value) { - $selectCriteria->add(CcPrefPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcPrefPeer::TABLE_NAME); - } - - } else { // $values is CcPref 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_pref 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(CcPrefPeer::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(CcPrefPeer::TABLE_NAME, $con, CcPrefPeer::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). - CcPrefPeer::clearInstancePool(); - CcPrefPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcPref or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcPref 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(CcPrefPeer::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. - CcPrefPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcPref) { // it's a model object - // invalidate the cache for this single object - CcPrefPeer::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(CcPrefPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcPrefPeer::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); - CcPrefPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcPref 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 CcPref $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(CcPref $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcPrefPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, CcPrefPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcPref - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcPrefPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $pk); - - $v = CcPrefPeer::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(CcPrefPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcPrefPeer::DATABASE_NAME); - $criteria->add(CcPrefPeer::ID, $pks, Criteria::IN); - $objs = CcPrefPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcPrefPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcPrefPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefQuery.php deleted file mode 100644 index 473bafc98..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcPrefQuery.php +++ /dev/null @@ -1,320 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcPref|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcPrefPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcPrefQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcPrefPeer::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 CcPrefQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcPrefPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcPrefQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcPrefPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the subjid column - * - * @param int|array $subjid 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 CcPrefQuery The current query, for fluid interface - */ - public function filterBySubjid($subjid = null, $comparison = null) - { - if (is_array($subjid)) { - $useMinMax = false; - if (isset($subjid['min'])) { - $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($subjid['max'])) { - $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcPrefPeer::SUBJID, $subjid, $comparison); - } - - /** - * Filter the query on the keystr column - * - * @param string $keystr The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByKeystr($keystr = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($keystr)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $keystr)) { - $keystr = str_replace('*', '%', $keystr); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPrefPeer::KEYSTR, $keystr, $comparison); - } - - /** - * Filter the query on the valstr column - * - * @param string $valstr The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByValstr($valstr = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($valstr)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $valstr)) { - $valstr = str_replace('*', '%', $valstr); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcPrefPeer::VALSTR, $valstr, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcPrefPeer::SUBJID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcPref $ccPref Object to remove from the list of results - * - * @return CcPrefQuery The current query, for fluid interface - */ - public function prune($ccPref = null) - { - if ($ccPref) { - $this->addUsingAlias(CcPrefPeer::ID, $ccPref->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcPrefQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedule.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedule.php deleted file mode 100644 index 26a91778d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedule.php +++ /dev/null @@ -1,1923 +0,0 @@ -clip_length = '00:00:00'; - $this->fade_in = '00:00:00'; - $this->fade_out = '00:00:00'; - $this->cue_in = '00:00:00'; - $this->cue_out = '00:00:00'; - $this->schedule_group_played = false; - $this->media_item_played = false; - } - - /** - * Initializes internal state of BaseCcSchedule object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [playlist_id] column value. - * - * @return int - */ - public function getDbPlaylistId() - { - return $this->playlist_id; - } - - /** - * Get the [optionally formatted] temporal [starts] 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 getDbStarts($format = 'Y-m-d H:i:s') - { - if ($this->starts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->starts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, 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 [optionally formatted] temporal [ends] 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 getDbEnds($format = 'Y-m-d H:i:s') - { - if ($this->ends === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ends); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, 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 [group_id] column value. - * - * @return int - */ - public function getDbGroupId() - { - return $this->group_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbFileId() - { - return $this->file_id; - } - - /** - * Get the [optionally formatted] temporal [clip_length] 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 getDbClipLength($format = '%X') - { - if ($this->clip_length === null) { - return null; - } - - - - try { - $dt = new DateTime($this->clip_length); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->clip_length, 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 [optionally formatted] temporal [fade_in] 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 getDbFadeIn($format = '%X') - { - if ($this->fade_in === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fade_in); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fade_in, 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 [optionally formatted] temporal [fade_out] 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 getDbFadeOut($format = '%X') - { - if ($this->fade_out === null) { - return null; - } - - - - try { - $dt = new DateTime($this->fade_out); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->fade_out, 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 [optionally formatted] temporal [cue_in] 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 getDbCueIn($format = '%X') - { - if ($this->cue_in === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cue_in); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cue_in, 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 [optionally formatted] temporal [cue_out] 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 getDbCueOut($format = '%X') - { - if ($this->cue_out === null) { - return null; - } - - - - try { - $dt = new DateTime($this->cue_out); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->cue_out, 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 [schedule_group_played] column value. - * - * @return boolean - */ - public function getDbScheduleGroupPlayed() - { - return $this->schedule_group_played; - } - - /** - * Get the [media_item_played] column value. - * - * @return boolean - */ - public function getDbMediaItemPlayed() - { - 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. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSchedulePeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [playlist_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbPlaylistId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->playlist_id !== $v) { - $this->playlist_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::PLAYLIST_ID; - } - - return $this; - } // setDbPlaylistId() - - /** - * Sets the value of [starts] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbStarts($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->starts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->starts !== null && $tmpDt = new DateTime($this->starts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->starts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSchedulePeer::STARTS; - } - } // if either are not null - - return $this; - } // setDbStarts() - - /** - * Sets the value of [ends] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbEnds($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->ends !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ends !== null && $tmpDt = new DateTime($this->ends)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ends = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSchedulePeer::ENDS; - } - } // if either are not null - - return $this; - } // setDbEnds() - - /** - * Set the value of [group_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbGroupId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->group_id !== $v) { - $this->group_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::GROUP_ID; - } - - return $this; - } // setDbGroupId() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbFileId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcSchedulePeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbFileId() - - /** - * Sets the value of [clip_length] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbClipLength($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->clip_length !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->clip_length !== null && $tmpDt = new DateTime($this->clip_length)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->clip_length = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CLIP_LENGTH; - } - } // if either are not null - - return $this; - } // setDbClipLength() - - /** - * Sets the value of [fade_in] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbFadeIn($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->fade_in !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fade_in !== null && $tmpDt = new DateTime($this->fade_in)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fade_in = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::FADE_IN; - } - } // if either are not null - - return $this; - } // setDbFadeIn() - - /** - * Sets the value of [fade_out] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbFadeOut($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->fade_out !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->fade_out !== null && $tmpDt = new DateTime($this->fade_out)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->fade_out = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::FADE_OUT; - } - } // if either are not null - - return $this; - } // setDbFadeOut() - - /** - * Sets the value of [cue_in] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbCueIn($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->cue_in !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cue_in !== null && $tmpDt = new DateTime($this->cue_in)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cue_in = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CUE_IN; - } - } // if either are not null - - return $this; - } // setDbCueIn() - - /** - * Sets the value of [cue_out] 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 CcSchedule The current object (for fluent API support) - */ - public function setDbCueOut($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->cue_out !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->cue_out !== null && $tmpDt = new DateTime($this->cue_out)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - || ($dt->format('H:i:s') === '00:00:00') // or the entered value matches the default - ) - { - $this->cue_out = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcSchedulePeer::CUE_OUT; - } - } // if either are not null - - return $this; - } // setDbCueOut() - - /** - * Set the value of [schedule_group_played] column. - * - * @param boolean $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbScheduleGroupPlayed($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->schedule_group_played !== $v || $this->isNew()) { - $this->schedule_group_played = $v; - $this->modifiedColumns[] = CcSchedulePeer::SCHEDULE_GROUP_PLAYED; - } - - return $this; - } // setDbScheduleGroupPlayed() - - /** - * Set the value of [media_item_played] column. - * - * @param boolean $v new value - * @return CcSchedule The current object (for fluent API support) - */ - public function setDbMediaItemPlayed($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->media_item_played !== $v || $this->isNew()) { - $this->media_item_played = $v; - $this->modifiedColumns[] = CcSchedulePeer::MEDIA_ITEM_PLAYED; - } - - return $this; - } // 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. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->clip_length !== '00:00:00') { - return false; - } - - if ($this->fade_in !== '00:00:00') { - return false; - } - - if ($this->fade_out !== '00:00:00') { - return false; - } - - if ($this->cue_in !== '00:00:00') { - return false; - } - - if ($this->cue_out !== '00:00:00') { - return false; - } - - if ($this->schedule_group_played !== false) { - return false; - } - - if ($this->media_item_played !== false) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : 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->ends = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->group_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->file_id = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->clip_length = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->fade_in = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->fade_out = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->cue_in = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : 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->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->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 14; // 14 = CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSchedule object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { - $this->aCcShowInstances = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSchedulePeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShowInstances = null; - $this->aCcFiles = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcScheduleQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstances($con); - CcSchedulePeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcSchedulePeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $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); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcSchedulePeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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 ($this->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - - if (($retval = CcSchedulePeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbPlaylistId(); - break; - case 2: - return $this->getDbStarts(); - break; - case 3: - return $this->getDbEnds(); - break; - case 4: - return $this->getDbGroupId(); - break; - case 5: - return $this->getDbFileId(); - break; - case 6: - return $this->getDbClipLength(); - break; - case 7: - return $this->getDbFadeIn(); - break; - case 8: - return $this->getDbFadeOut(); - break; - case 9: - return $this->getDbCueIn(); - break; - case 10: - return $this->getDbCueOut(); - break; - case 11: - return $this->getDbScheduleGroupPlayed(); - break; - case 12: - return $this->getDbMediaItemPlayed(); - break; - case 13: - return $this->getDbInstanceId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcSchedulePeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbPlaylistId(), - $keys[2] => $this->getDbStarts(), - $keys[3] => $this->getDbEnds(), - $keys[4] => $this->getDbGroupId(), - $keys[5] => $this->getDbFileId(), - $keys[6] => $this->getDbClipLength(), - $keys[7] => $this->getDbFadeIn(), - $keys[8] => $this->getDbFadeOut(), - $keys[9] => $this->getDbCueIn(), - $keys[10] => $this->getDbCueOut(), - $keys[11] => $this->getDbScheduleGroupPlayed(), - $keys[12] => $this->getDbMediaItemPlayed(), - $keys[13] => $this->getDbInstanceId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShowInstances) { - $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbPlaylistId($value); - break; - case 2: - $this->setDbStarts($value); - break; - case 3: - $this->setDbEnds($value); - break; - case 4: - $this->setDbGroupId($value); - break; - case 5: - $this->setDbFileId($value); - break; - case 6: - $this->setDbClipLength($value); - break; - case 7: - $this->setDbFadeIn($value); - break; - case 8: - $this->setDbFadeOut($value); - break; - case 9: - $this->setDbCueIn($value); - break; - case 10: - $this->setDbCueOut($value); - break; - case 11: - $this->setDbScheduleGroupPlayed($value); - break; - case 12: - $this->setDbMediaItemPlayed($value); - break; - case 13: - $this->setDbInstanceId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSchedulePeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbPlaylistId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbStarts($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbEnds($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbGroupId($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbFileId($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbClipLength($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbFadeIn($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbFadeOut($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbCueIn($arr[$keys[9]]); - 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[12], $arr)) $this->setDbMediaItemPlayed($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setDbInstanceId($arr[$keys[13]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSchedulePeer::ID)) $criteria->add(CcSchedulePeer::ID, $this->id); - if ($this->isColumnModified(CcSchedulePeer::PLAYLIST_ID)) $criteria->add(CcSchedulePeer::PLAYLIST_ID, $this->playlist_id); - if ($this->isColumnModified(CcSchedulePeer::STARTS)) $criteria->add(CcSchedulePeer::STARTS, $this->starts); - if ($this->isColumnModified(CcSchedulePeer::ENDS)) $criteria->add(CcSchedulePeer::ENDS, $this->ends); - if ($this->isColumnModified(CcSchedulePeer::GROUP_ID)) $criteria->add(CcSchedulePeer::GROUP_ID, $this->group_id); - if ($this->isColumnModified(CcSchedulePeer::FILE_ID)) $criteria->add(CcSchedulePeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcSchedulePeer::CLIP_LENGTH)) $criteria->add(CcSchedulePeer::CLIP_LENGTH, $this->clip_length); - if ($this->isColumnModified(CcSchedulePeer::FADE_IN)) $criteria->add(CcSchedulePeer::FADE_IN, $this->fade_in); - if ($this->isColumnModified(CcSchedulePeer::FADE_OUT)) $criteria->add(CcSchedulePeer::FADE_OUT, $this->fade_out); - if ($this->isColumnModified(CcSchedulePeer::CUE_IN)) $criteria->add(CcSchedulePeer::CUE_IN, $this->cue_in); - 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::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; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSchedule (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbPlaylistId($this->playlist_id); - $copyObj->setDbStarts($this->starts); - $copyObj->setDbEnds($this->ends); - $copyObj->setDbGroupId($this->group_id); - $copyObj->setDbFileId($this->file_id); - $copyObj->setDbClipLength($this->clip_length); - $copyObj->setDbFadeIn($this->fade_in); - $copyObj->setDbFadeOut($this->fade_out); - $copyObj->setDbCueIn($this->cue_in); - $copyObj->setDbCueOut($this->cue_out); - $copyObj->setDbScheduleGroupPlayed($this->schedule_group_played); - $copyObj->setDbMediaItemPlayed($this->media_item_played); - $copyObj->setDbInstanceId($this->instance_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSchedule Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSchedulePeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSchedulePeer(); - } - 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) - { - // aggregate_column_relation behavior - if (null !== $this->aCcShowInstances && $v !== $this->aCcShowInstances) { - $this->oldCcShowInstances = $this->aCcShowInstances; - } - 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; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcSchedule The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbFileId(NULL); - } else { - $this->setDbFileId($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcSchedule($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcSchedules($this); - */ - } - return $this->aCcFiles; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->playlist_id = null; - $this->starts = null; - $this->ends = null; - $this->group_id = null; - $this->file_id = null; - $this->clip_length = null; - $this->fade_in = null; - $this->fade_out = null; - $this->cue_in = null; - $this->cue_out = null; - $this->schedule_group_played = null; - $this->media_item_played = null; - $this->instance_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShowInstances = null; - $this->aCcFiles = null; - } - - // aggregate_column_relation behavior - - /** - * Update the aggregate column in the related CcShowInstances object - * - * @param PropelPDO $con A connection object - */ - protected function updateRelatedCcShowInstances(PropelPDO $con) - { - if ($ccShowInstances = $this->getCcShowInstances()) { - $ccShowInstances->updateDbTimeFilled($con); - } - if ($this->oldCcShowInstances) { - $this->oldCcShowInstances->updateDbTimeFilled($con); - $this->oldCcShowInstances = null; - } - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSchedule diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedulePeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedulePeer.php deleted file mode 100644 index b21b26990..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSchedulePeer.php +++ /dev/null @@ -1,1420 +0,0 @@ - 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', '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, 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', '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', 'instance_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) - ); - - /** - * 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, '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, '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, 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, '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, 'instance_id' => 13, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSchedulePeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSchedulePeer::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(CcSchedulePeer::ID); - $criteria->addSelectColumn(CcSchedulePeer::PLAYLIST_ID); - $criteria->addSelectColumn(CcSchedulePeer::STARTS); - $criteria->addSelectColumn(CcSchedulePeer::ENDS); - $criteria->addSelectColumn(CcSchedulePeer::GROUP_ID); - $criteria->addSelectColumn(CcSchedulePeer::FILE_ID); - $criteria->addSelectColumn(CcSchedulePeer::CLIP_LENGTH); - $criteria->addSelectColumn(CcSchedulePeer::FADE_IN); - $criteria->addSelectColumn(CcSchedulePeer::FADE_OUT); - $criteria->addSelectColumn(CcSchedulePeer::CUE_IN); - $criteria->addSelectColumn(CcSchedulePeer::CUE_OUT); - $criteria->addSelectColumn(CcSchedulePeer::SCHEDULE_GROUP_PLAYED); - $criteria->addSelectColumn(CcSchedulePeer::MEDIA_ITEM_PLAYED); - $criteria->addSelectColumn(CcSchedulePeer::INSTANCE_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.PLAYLIST_ID'); - $criteria->addSelectColumn($alias . '.STARTS'); - $criteria->addSelectColumn($alias . '.ENDS'); - $criteria->addSelectColumn($alias . '.GROUP_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.CLIP_LENGTH'); - $criteria->addSelectColumn($alias . '.FADE_IN'); - $criteria->addSelectColumn($alias . '.FADE_OUT'); - $criteria->addSelectColumn($alias . '.CUE_IN'); - $criteria->addSelectColumn($alias . '.CUE_OUT'); - $criteria->addSelectColumn($alias . '.SCHEDULE_GROUP_PLAYED'); - $criteria->addSelectColumn($alias . '.MEDIA_ITEM_PLAYED'); - $criteria->addSelectColumn($alias . '.INSTANCE_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(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 - $criteria->setDbName(self::DATABASE_NAME); // Set the correct dbName - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::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 CcSchedule - * @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 = CcSchedulePeer::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 CcSchedulePeer::populateObjects(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSchedulePeer::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 CcSchedule $value A CcSchedule object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSchedule $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 CcSchedule object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSchedule) { - $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 CcSchedule 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 CcSchedule 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_schedule - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcSchedulePeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSchedulePeer::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; - CcSchedulePeer::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 (CcSchedule object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSchedulePeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSchedulePeer::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 + CcSchedulePeer::NUM_COLUMNS; - } else { - $cls = CcSchedulePeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSchedulePeer::addInstanceToPool($obj, $key); - } - 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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Selects a collection of CcSchedule objects pre-filled with their CcFiles 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 doSelectJoinCcFiles(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); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcSchedule) to $obj2 (CcFiles) - $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); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj3 (CcFiles) - $obj3->addCcSchedule($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShowInstances(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 should not affect 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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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 should not affect 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 except CcShowInstances. - * - * @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 doSelectJoinAllExceptCcShowInstances(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcSchedulePeer::addSelectColumns($criteria); - $startcol2 = (CcSchedulePeer::NUM_COLUMNS - CcSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSchedulePeer::FILE_ID, CcFilesPeer::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 CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj2 (CcFiles) - $obj2->addCcSchedule($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcSchedule objects pre-filled with all related objects except CcFiles. - * - * @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 doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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 already loaded - - // Add the $obj1 (CcSchedule) to the collection in $obj2 (CcShowInstances) - $obj2->addCcSchedule($obj1); - - } // if joined row is 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(BaseCcSchedulePeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSchedulePeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcScheduleTableMap()); - } - } - - /** - * 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 ? CcSchedulePeer::CLASS_DEFAULT : CcSchedulePeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSchedule or Criteria object. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $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 - $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 CcSchedule or Criteria object. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSchedulePeer::ID); - $value = $criteria->remove(CcSchedulePeer::ID); - if ($value) { - $selectCriteria->add(CcSchedulePeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSchedulePeer::TABLE_NAME); - } - - } else { // $values is CcSchedule 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_schedule 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(CcSchedulePeer::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(CcSchedulePeer::TABLE_NAME, $con, CcSchedulePeer::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). - CcSchedulePeer::clearInstancePool(); - CcSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSchedule or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSchedule 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(CcSchedulePeer::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. - CcSchedulePeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSchedule) { // it's a model object - // invalidate the cache for this single object - CcSchedulePeer::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(CcSchedulePeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSchedulePeer::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); - CcSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSchedule 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 CcSchedule $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(CcSchedule $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSchedulePeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, CcSchedulePeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSchedule - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSchedulePeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $pk); - - $v = CcSchedulePeer::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(CcSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSchedulePeer::DATABASE_NAME); - $criteria->add(CcSchedulePeer::ID, $pks, Criteria::IN); - $objs = CcSchedulePeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSchedulePeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSchedulePeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcScheduleQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcScheduleQuery.php deleted file mode 100644 index 11a030d84..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcScheduleQuery.php +++ /dev/null @@ -1,814 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSchedule|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSchedulePeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery 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(CcSchedulePeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the playlist_id column - * - * @param int|array $dbPlaylistId 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 filterByDbPlaylistId($dbPlaylistId = null, $comparison = null) - { - if (is_array($dbPlaylistId)) { - $useMinMax = false; - if (isset($dbPlaylistId['min'])) { - $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPlaylistId['max'])) { - $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::PLAYLIST_ID, $dbPlaylistId, $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 CcScheduleQuery 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(CcSchedulePeer::STARTS, $dbStarts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStarts['max'])) { - $this->addUsingAlias(CcSchedulePeer::STARTS, $dbStarts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::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 CcScheduleQuery 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(CcSchedulePeer::ENDS, $dbEnds['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbEnds['max'])) { - $this->addUsingAlias(CcSchedulePeer::ENDS, $dbEnds['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::ENDS, $dbEnds, $comparison); - } - - /** - * Filter the query on the group_id column - * - * @param int|array $dbGroupId 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 filterByDbGroupId($dbGroupId = null, $comparison = null) - { - if (is_array($dbGroupId)) { - $useMinMax = false; - if (isset($dbGroupId['min'])) { - $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbGroupId['max'])) { - $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::GROUP_ID, $dbGroupId, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbFileId 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 filterByDbFileId($dbFileId = null, $comparison = null) - { - if (is_array($dbFileId)) { - $useMinMax = false; - if (isset($dbFileId['min'])) { - $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFileId['max'])) { - $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FILE_ID, $dbFileId, $comparison); - } - - /** - * Filter the query on the clip_length column - * - * @param string|array $dbClipLength 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 filterByDbClipLength($dbClipLength = null, $comparison = null) - { - if (is_array($dbClipLength)) { - $useMinMax = false; - if (isset($dbClipLength['min'])) { - $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbClipLength['max'])) { - $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CLIP_LENGTH, $dbClipLength, $comparison); - } - - /** - * Filter the query on the fade_in column - * - * @param string|array $dbFadeIn 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 filterByDbFadeIn($dbFadeIn = null, $comparison = null) - { - if (is_array($dbFadeIn)) { - $useMinMax = false; - if (isset($dbFadeIn['min'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeIn['max'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FADE_IN, $dbFadeIn, $comparison); - } - - /** - * Filter the query on the fade_out column - * - * @param string|array $dbFadeOut 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 filterByDbFadeOut($dbFadeOut = null, $comparison = null) - { - if (is_array($dbFadeOut)) { - $useMinMax = false; - if (isset($dbFadeOut['min'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFadeOut['max'])) { - $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::FADE_OUT, $dbFadeOut, $comparison); - } - - /** - * Filter the query on the cue_in column - * - * @param string|array $dbCueIn 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 filterByDbCueIn($dbCueIn = null, $comparison = null) - { - if (is_array($dbCueIn)) { - $useMinMax = false; - if (isset($dbCueIn['min'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueIn['max'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CUE_IN, $dbCueIn, $comparison); - } - - /** - * Filter the query on the cue_out column - * - * @param string|array $dbCueOut 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 filterByDbCueOut($dbCueOut = null, $comparison = null) - { - if (is_array($dbCueOut)) { - $useMinMax = false; - if (isset($dbCueOut['min'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbCueOut['max'])) { - $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSchedulePeer::CUE_OUT, $dbCueOut, $comparison); - } - - /** - * Filter the query on the schedule_group_played column - * - * @param boolean|string $dbScheduleGroupPlayed The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function filterByDbScheduleGroupPlayed($dbScheduleGroupPlayed = null, $comparison = null) - { - if (is_string($dbScheduleGroupPlayed)) { - $schedule_group_played = in_array(strtolower($dbScheduleGroupPlayed), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - return $this->addUsingAlias(CcSchedulePeer::SCHEDULE_GROUP_PLAYED, $dbScheduleGroupPlayed, $comparison); - } - - /** - * Filter the query on the media_item_played column - * - * @param boolean|string $dbMediaItemPlayed The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function filterByDbMediaItemPlayed($dbMediaItemPlayed = null, $comparison = null) - { - if (is_string($dbMediaItemPlayed)) { - $media_item_played = in_array(strtolower($dbMediaItemPlayed), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - 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'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles 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 filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcSchedulePeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles 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 joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Exclude object from result - * - * @param CcSchedule $ccSchedule Object to remove from the list of results - * - * @return CcScheduleQuery The current query, for fluid interface - */ - public function prune($ccSchedule = null) - { - if ($ccSchedule) { - $this->addUsingAlias(CcSchedulePeer::ID, $ccSchedule->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - - /** - * Code to execute before every DELETE statement - * - * @param PropelPDO $con The connection object used by the query - */ - protected function basePreDelete(PropelPDO $con) - { - // aggregate_column_relation behavior - $this->findRelatedCcShowInstancess($con); - - return $this->preDelete($con); - } - - /** - * Code to execute after every DELETE statement - * - * @param int $affectedRows the number of deleted rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostDelete($affectedRows, PropelPDO $con) - { - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstancess($con); - - return $this->postDelete($affectedRows, $con); - } - - /** - * Code to execute before every UPDATE statement - * - * @param array $values The associatiove array of columns and values for the update - * @param PropelPDO $con The connection object used by the query - * @param boolean $forceIndividualSaves If false (default), the resulting call is a BasePeer::doUpdate(), ortherwise it is a series of save() calls on all the found objects - */ - protected function basePreUpdate(&$values, PropelPDO $con, $forceIndividualSaves = false) - { - // aggregate_column_relation behavior - $this->findRelatedCcShowInstancess($con); - - return $this->preUpdate($values, $con, $forceIndividualSaves); - } - - /** - * Code to execute after every UPDATE statement - * - * @param int $affectedRows the number of udated rows - * @param PropelPDO $con The connection object used by the query - */ - protected function basePostUpdate($affectedRows, PropelPDO $con) - { - // aggregate_column_relation behavior - $this->updateRelatedCcShowInstancess($con); - - return $this->postUpdate($affectedRows, $con); - } - - // aggregate_column_relation behavior - - /** - * Finds the related CcShowInstances objects and keep them for later - * - * @param PropelPDO $con A connection object - */ - protected function findRelatedCcShowInstancess($con) - { - $criteria = clone $this; - if ($this->useAliasInSQL) { - $alias = $this->getModelAlias(); - $criteria->removeAlias($alias); - } else { - $alias = ''; - } - $this->ccShowInstancess = CcShowInstancesQuery::create() - ->joinCcSchedule($alias) - ->mergeWith($criteria) - ->find($con); - } - - protected function updateRelatedCcShowInstancess($con) - { - foreach ($this->ccShowInstancess as $ccShowInstances) { - $ccShowInstances->updateDbTimeFilled($con); - } - $this->ccShowInstancess = array(); - } - -} // BaseCcScheduleQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegister.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegister.php deleted file mode 100644 index dbb3aa6a2..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegister.php +++ /dev/null @@ -1,708 +0,0 @@ -name; - } - - /** - * Get the [ip] column value. - * - * @return string - */ - public function getDbIp() - { - return $this->ip; - } - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcServiceRegister The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v) { - $this->name = $v; - $this->modifiedColumns[] = CcServiceRegisterPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [ip] column. - * - * @param string $v new value - * @return CcServiceRegister The current object (for fluent API support) - */ - public function setDbIp($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->ip !== $v) { - $this->ip = $v; - $this->modifiedColumns[] = CcServiceRegisterPeer::IP; - } - - return $this; - } // setDbIp() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->name = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->ip = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 2; // 2 = CcServiceRegisterPeer::NUM_COLUMNS - CcServiceRegisterPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcServiceRegister object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcServiceRegisterPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcServiceRegisterQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcServiceRegisterPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcServiceRegisterPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcServiceRegisterPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcServiceRegisterPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbName(); - break; - case 1: - return $this->getDbIp(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcServiceRegisterPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbName(), - $keys[1] => $this->getDbIp(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcServiceRegisterPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbName($value); - break; - case 1: - $this->setDbIp($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcServiceRegisterPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbName($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbIp($arr[$keys[1]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcServiceRegisterPeer::NAME)) $criteria->add(CcServiceRegisterPeer::NAME, $this->name); - if ($this->isColumnModified(CcServiceRegisterPeer::IP)) $criteria->add(CcServiceRegisterPeer::IP, $this->ip); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $this->name); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbName(); - } - - /** - * Generic method to set the primary key (name column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbName($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbName(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcServiceRegister (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbIp($this->ip); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcServiceRegister Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcServiceRegisterPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcServiceRegisterPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->name = null; - $this->ip = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcServiceRegister diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterPeer.php deleted file mode 100644 index ab7d35634..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterPeer.php +++ /dev/null @@ -1,735 +0,0 @@ - array ('DbName', 'DbIp', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbName', 'dbIp', ), - BasePeer::TYPE_COLNAME => array (self::NAME, self::IP, ), - BasePeer::TYPE_RAW_COLNAME => array ('NAME', 'IP', ), - BasePeer::TYPE_FIELDNAME => array ('name', 'ip', ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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 ('DbName' => 0, 'DbIp' => 1, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbName' => 0, 'dbIp' => 1, ), - BasePeer::TYPE_COLNAME => array (self::NAME => 0, self::IP => 1, ), - BasePeer::TYPE_RAW_COLNAME => array ('NAME' => 0, 'IP' => 1, ), - BasePeer::TYPE_FIELDNAME => array ('name' => 0, 'ip' => 1, ), - BasePeer::TYPE_NUM => array (0, 1, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcServiceRegisterPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcServiceRegisterPeer::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(CcServiceRegisterPeer::NAME); - $criteria->addSelectColumn(CcServiceRegisterPeer::IP); - } else { - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.IP'); - } - } - - /** - * 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(CcServiceRegisterPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcServiceRegisterPeer::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(CcServiceRegisterPeer::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 CcServiceRegister - * @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 = CcServiceRegisterPeer::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 CcServiceRegisterPeer::populateObjects(CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcServiceRegisterPeer::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 CcServiceRegister $value A CcServiceRegister object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcServiceRegister $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbName(); - } // 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 CcServiceRegister object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcServiceRegister) { - $key = (string) $value->getDbName(); - } 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 CcServiceRegister 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 CcServiceRegister 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_service_register - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcServiceRegisterPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcServiceRegisterPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcServiceRegisterPeer::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; - CcServiceRegisterPeer::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 (CcServiceRegister object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcServiceRegisterPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcServiceRegisterPeer::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 + CcServiceRegisterPeer::NUM_COLUMNS; - } else { - $cls = CcServiceRegisterPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcServiceRegisterPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcServiceRegisterPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcServiceRegisterPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcServiceRegisterTableMap()); - } - } - - /** - * 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 ? CcServiceRegisterPeer::CLASS_DEFAULT : CcServiceRegisterPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcServiceRegister or Criteria object. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcServiceRegister object - } - - - // 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 CcServiceRegister or Criteria object. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcServiceRegisterPeer::NAME); - $value = $criteria->remove(CcServiceRegisterPeer::NAME); - if ($value) { - $selectCriteria->add(CcServiceRegisterPeer::NAME, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcServiceRegisterPeer::TABLE_NAME); - } - - } else { // $values is CcServiceRegister 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_service_register 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(CcServiceRegisterPeer::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(CcServiceRegisterPeer::TABLE_NAME, $con, CcServiceRegisterPeer::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). - CcServiceRegisterPeer::clearInstancePool(); - CcServiceRegisterPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcServiceRegister or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcServiceRegister 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(CcServiceRegisterPeer::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. - CcServiceRegisterPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcServiceRegister) { // it's a model object - // invalidate the cache for this single object - CcServiceRegisterPeer::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(CcServiceRegisterPeer::NAME, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcServiceRegisterPeer::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); - CcServiceRegisterPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcServiceRegister 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 CcServiceRegister $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(CcServiceRegister $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcServiceRegisterPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, CcServiceRegisterPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcServiceRegister - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcServiceRegisterPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $pk); - - $v = CcServiceRegisterPeer::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(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcServiceRegisterPeer::DATABASE_NAME); - $criteria->add(CcServiceRegisterPeer::NAME, $pks, Criteria::IN); - $objs = CcServiceRegisterPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcServiceRegisterPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcServiceRegisterPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterQuery.php deleted file mode 100644 index a8df529a7..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcServiceRegisterQuery.php +++ /dev/null @@ -1,196 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcServiceRegister|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcServiceRegisterPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $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 CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $keys, Criteria::IN); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcServiceRegisterPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the ip column - * - * @param string $dbIp The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function filterByDbIp($dbIp = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbIp)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbIp)) { - $dbIp = str_replace('*', '%', $dbIp); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcServiceRegisterPeer::IP, $dbIp, $comparison); - } - - /** - * Exclude object from result - * - * @param CcServiceRegister $ccServiceRegister Object to remove from the list of results - * - * @return CcServiceRegisterQuery The current query, for fluid interface - */ - public function prune($ccServiceRegister = null) - { - if ($ccServiceRegister) { - $this->addUsingAlias(CcServiceRegisterPeer::NAME, $ccServiceRegister->getDbName(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcServiceRegisterQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSess.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSess.php deleted file mode 100644 index 8ae2463af..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSess.php +++ /dev/null @@ -1,949 +0,0 @@ -sessid; - } - - /** - * Get the [userid] column value. - * - * @return int - */ - public function getUserid() - { - return $this->userid; - } - - /** - * Get the [login] column value. - * - * @return string - */ - public function getLogin() - { - return $this->login; - } - - /** - * Get the [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [sessid] column. - * - * @param string $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setSessid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->sessid !== $v) { - $this->sessid = $v; - $this->modifiedColumns[] = CcSessPeer::SESSID; - } - - return $this; - } // setSessid() - - /** - * Set the value of [userid] column. - * - * @param int $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setUserid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->userid !== $v) { - $this->userid = $v; - $this->modifiedColumns[] = CcSessPeer::USERID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setUserid() - - /** - * Set the value of [login] column. - * - * @param string $v new value - * @return CcSess The current object (for fluent API support) - */ - public function setLogin($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->login !== $v) { - $this->login = $v; - $this->modifiedColumns[] = CcSessPeer::LOGIN; - } - - return $this; - } // setLogin() - - /** - * Sets the value of [ts] 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 CcSess The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSessPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->sessid = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->userid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->login = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->ts = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSess object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcSubjs !== null && $this->userid !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSessPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSessQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSessPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setNew(false); - } else { - $affectedRows += CcSessPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcSessPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getSessid(); - break; - case 1: - return $this->getUserid(); - break; - case 2: - return $this->getLogin(); - break; - case 3: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcSessPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getSessid(), - $keys[1] => $this->getUserid(), - $keys[2] => $this->getLogin(), - $keys[3] => $this->getTs(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSessPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setSessid($value); - break; - case 1: - $this->setUserid($value); - break; - case 2: - $this->setLogin($value); - break; - case 3: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSessPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setSessid($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setUserid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setLogin($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setTs($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSessPeer::SESSID)) $criteria->add(CcSessPeer::SESSID, $this->sessid); - if ($this->isColumnModified(CcSessPeer::USERID)) $criteria->add(CcSessPeer::USERID, $this->userid); - if ($this->isColumnModified(CcSessPeer::LOGIN)) $criteria->add(CcSessPeer::LOGIN, $this->login); - if ($this->isColumnModified(CcSessPeer::TS)) $criteria->add(CcSessPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $this->sessid); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getSessid(); - } - - /** - * Generic method to set the primary key (sessid column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setSessid($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getSessid(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSess (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setSessid($this->sessid); - $copyObj->setUserid($this->userid); - $copyObj->setLogin($this->login); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSess Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSessPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSessPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcSess The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setUserid(NULL); - } else { - $this->setUserid($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcSess($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->userid !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->userid, $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->aCcSubjs->addCcSesss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->sessid = null; - $this->userid = null; - $this->login = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSess diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessPeer.php deleted file mode 100644 index 70eab561a..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessPeer.php +++ /dev/null @@ -1,979 +0,0 @@ - array ('Sessid', 'Userid', 'Login', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('sessid', 'userid', 'login', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::SESSID, self::USERID, self::LOGIN, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('SESSID', 'USERID', 'LOGIN', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('sessid', 'userid', 'login', 'ts', ), - 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 ('Sessid' => 0, 'Userid' => 1, 'Login' => 2, 'Ts' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 3, ), - BasePeer::TYPE_COLNAME => array (self::SESSID => 0, self::USERID => 1, self::LOGIN => 2, self::TS => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('SESSID' => 0, 'USERID' => 1, 'LOGIN' => 2, 'TS' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('sessid' => 0, 'userid' => 1, 'login' => 2, 'ts' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSessPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSessPeer::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(CcSessPeer::SESSID); - $criteria->addSelectColumn(CcSessPeer::USERID); - $criteria->addSelectColumn(CcSessPeer::LOGIN); - $criteria->addSelectColumn(CcSessPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.SESSID'); - $criteria->addSelectColumn($alias . '.USERID'); - $criteria->addSelectColumn($alias . '.LOGIN'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::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 CcSess - * @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 = CcSessPeer::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 CcSessPeer::populateObjects(CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSessPeer::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 CcSess $value A CcSess object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSess $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getSessid(); - } // 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 CcSess object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSess) { - $key = (string) $value->getSessid(); - } 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 CcSess 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 CcSess 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_sess - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcSessPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSessPeer::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; - CcSessPeer::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 (CcSess object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSessPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSessPeer::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 + CcSessPeer::NUM_COLUMNS; - } else { - $cls = CcSessPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSessPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::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 CcSess objects pre-filled with their CcSubjs 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 CcSess objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcSessPeer::addSelectColumns($criteria); - $startcol = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcSessPeer::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 = CcSessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcSessPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcSess) to $obj2 (CcSubjs) - $obj2->addCcSess($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(CcSessPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::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 CcSess 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 CcSess 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); - } - - CcSessPeer::addSelectColumns($criteria); - $startcol2 = (CcSessPeer::NUM_COLUMNS - CcSessPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcSessPeer::USERID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcSessPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcSessPeer::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 = CcSessPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcSessPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 loaded - - // Add the $obj1 (CcSess) to the collection in $obj2 (CcSubjs) - $obj2->addCcSess($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(BaseCcSessPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSessPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSessTableMap()); - } - } - - /** - * 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 ? CcSessPeer::CLASS_DEFAULT : CcSessPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSess or Criteria object. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSess object - } - - - // 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 CcSess or Criteria object. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSessPeer::SESSID); - $value = $criteria->remove(CcSessPeer::SESSID); - if ($value) { - $selectCriteria->add(CcSessPeer::SESSID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSessPeer::TABLE_NAME); - } - - } else { // $values is CcSess 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_sess 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(CcSessPeer::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(CcSessPeer::TABLE_NAME, $con, CcSessPeer::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). - CcSessPeer::clearInstancePool(); - CcSessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSess or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSess 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(CcSessPeer::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. - CcSessPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSess) { // it's a model object - // invalidate the cache for this single object - CcSessPeer::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(CcSessPeer::SESSID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSessPeer::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); - CcSessPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSess 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 CcSess $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(CcSess $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSessPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSessPeer::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(CcSessPeer::DATABASE_NAME, CcSessPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSess - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSessPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $pk); - - $v = CcSessPeer::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(CcSessPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSessPeer::DATABASE_NAME); - $criteria->add(CcSessPeer::SESSID, $pks, Criteria::IN); - $objs = CcSessPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSessPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSessPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessQuery.php deleted file mode 100644 index f0b500f83..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSessQuery.php +++ /dev/null @@ -1,334 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSess|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSessPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSessQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSessPeer::SESSID, $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 CcSessQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSessPeer::SESSID, $keys, Criteria::IN); - } - - /** - * Filter the query on the sessid column - * - * @param string $sessid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterBySessid($sessid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($sessid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $sessid)) { - $sessid = str_replace('*', '%', $sessid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSessPeer::SESSID, $sessid, $comparison); - } - - /** - * Filter the query on the userid column - * - * @param int|array $userid 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 CcSessQuery The current query, for fluid interface - */ - public function filterByUserid($userid = null, $comparison = null) - { - if (is_array($userid)) { - $useMinMax = false; - if (isset($userid['min'])) { - $this->addUsingAlias(CcSessPeer::USERID, $userid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($userid['max'])) { - $this->addUsingAlias(CcSessPeer::USERID, $userid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSessPeer::USERID, $userid, $comparison); - } - - /** - * Filter the query on the login column - * - * @param string $login The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterByLogin($login = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($login)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $login)) { - $login = str_replace('*', '%', $login); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSessPeer::LOGIN, $login, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcSessQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcSessPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcSessPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSessPeer::TS, $ts, $comparison); - } - - /** - * Filter the query by a related CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSessQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcSessPeer::USERID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSessQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcSess $ccSess Object to remove from the list of results - * - * @return CcSessQuery The current query, for fluid interface - */ - public function prune($ccSess = null) - { - if ($ccSess) { - $this->addUsingAlias(CcSessPeer::SESSID, $ccSess->getSessid(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSessQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShow.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShow.php deleted file mode 100644 index b2ab6b257..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShow.php +++ /dev/null @@ -1,1654 +0,0 @@ -name = ''; - $this->url = ''; - $this->genre = ''; - } - - /** - * Initializes internal state of BaseCcShow object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [name] column value. - * - * @return string - */ - public function getDbName() - { - return $this->name; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getDbUrl() - { - return $this->url; - } - - /** - * Get the [genre] column value. - * - * @return string - */ - public function getDbGenre() - { - return $this->genre; - } - - /** - * Get the [description] column value. - * - * @return string - */ - public function getDbDescription() - { - return $this->description; - } - - /** - * Get the [color] column value. - * - * @return string - */ - public function getDbColor() - { - return $this->color; - } - - /** - * Get the [background_color] column value. - * - * @return string - */ - public function getDbBackgroundColor() - { - return $this->background_color; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [name] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->name !== $v || $this->isNew()) { - $this->name = $v; - $this->modifiedColumns[] = CcShowPeer::NAME; - } - - return $this; - } // setDbName() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v || $this->isNew()) { - $this->url = $v; - $this->modifiedColumns[] = CcShowPeer::URL; - } - - return $this; - } // setDbUrl() - - /** - * Set the value of [genre] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbGenre($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->genre !== $v || $this->isNew()) { - $this->genre = $v; - $this->modifiedColumns[] = CcShowPeer::GENRE; - } - - return $this; - } // setDbGenre() - - /** - * Set the value of [description] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbDescription($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->description !== $v) { - $this->description = $v; - $this->modifiedColumns[] = CcShowPeer::DESCRIPTION; - } - - return $this; - } // setDbDescription() - - /** - * Set the value of [color] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbColor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->color !== $v) { - $this->color = $v; - $this->modifiedColumns[] = CcShowPeer::COLOR; - } - - return $this; - } // setDbColor() - - /** - * Set the value of [background_color] column. - * - * @param string $v new value - * @return CcShow The current object (for fluent API support) - */ - public function setDbBackgroundColor($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->background_color !== $v) { - $this->background_color = $v; - $this->modifiedColumns[] = CcShowPeer::BACKGROUND_COLOR; - } - - return $this; - } // setDbBackgroundColor() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->name !== '') { - return false; - } - - if ($this->url !== '') { - return false; - } - - if ($this->genre !== '') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->url = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->genre = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->description = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->color = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->background_color = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 7; // 7 = CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShow object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcShowInstancess = null; - - $this->collCcShowDayss = null; - - $this->collCcShowRebroadcasts = null; - - $this->collCcShowHostss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcShowPeer::doUpdate($this, $con); - } - - $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) { - foreach ($this->collCcShowDayss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowRebroadcasts !== null) { - foreach ($this->collCcShowRebroadcasts as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcShowPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancess !== null) { - foreach ($this->collCcShowInstancess as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowDayss !== null) { - foreach ($this->collCcShowDayss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowRebroadcasts !== null) { - foreach ($this->collCcShowRebroadcasts as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbName(); - break; - case 2: - return $this->getDbUrl(); - break; - case 3: - return $this->getDbGenre(); - break; - case 4: - return $this->getDbDescription(); - break; - case 5: - return $this->getDbColor(); - break; - case 6: - return $this->getDbBackgroundColor(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcShowPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbName(), - $keys[2] => $this->getDbUrl(), - $keys[3] => $this->getDbGenre(), - $keys[4] => $this->getDbDescription(), - $keys[5] => $this->getDbColor(), - $keys[6] => $this->getDbBackgroundColor(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbName($value); - break; - case 2: - $this->setDbUrl($value); - break; - case 3: - $this->setDbGenre($value); - break; - case 4: - $this->setDbDescription($value); - break; - case 5: - $this->setDbColor($value); - break; - case 6: - $this->setDbBackgroundColor($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowPeer::getFieldNames($keyType); - - 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[2], $arr)) $this->setDbUrl($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbGenre($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbDescription($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbColor($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbBackgroundColor($arr[$keys[6]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - - 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::URL)) $criteria->add(CcShowPeer::URL, $this->url); - if ($this->isColumnModified(CcShowPeer::GENRE)) $criteria->add(CcShowPeer::GENRE, $this->genre); - 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::BACKGROUND_COLOR)) $criteria->add(CcShowPeer::BACKGROUND_COLOR, $this->background_color); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShow (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbName($this->name); - $copyObj->setDbUrl($this->url); - $copyObj->setDbGenre($this->genre); - $copyObj->setDbDescription($this->description); - $copyObj->setDbColor($this->color); - $copyObj->setDbBackgroundColor($this->background_color); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $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) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowDays($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowRebroadcasts() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowRebroadcast($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowHostss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowHosts($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShow Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowPeer(); - } - 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); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcShowInstancesRelatedByDbOriginalShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShowInstancesRelatedByDbOriginalShow', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowInstancess from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowInstancess($query, $con); - } - - /** - * Clears out the collCcShowDayss 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 addCcShowDayss() - */ - public function clearCcShowDayss() - { - $this->collCcShowDayss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowDayss collection. - * - * By default this just sets the collCcShowDayss collection to an empty array (like clearcollCcShowDayss()); - * 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 initCcShowDayss() - { - $this->collCcShowDayss = new PropelObjectCollection(); - $this->collCcShowDayss->setModel('CcShowDays'); - } - - /** - * Gets an array of CcShowDays objects which contain a foreign key that references this object. - * - * If the $criteria is not null, it is used to always fetch the results from the database. - * Otherwise the results are fetched from the database the first time, then cached. - * Next time the same method is called without $criteria, the cached collection is returned. - * If this CcShow is new, it will return - * an empty collection or the current collection; the criteria is ignored on a new object. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @return PropelCollection|array CcShowDays[] List of CcShowDays objects - * @throws PropelException - */ - public function getCcShowDayss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowDayss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowDayss) { - // return empty collection - $this->initCcShowDayss(); - } else { - $collCcShowDayss = CcShowDaysQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowDayss; - } - $this->collCcShowDayss = $collCcShowDayss; - } - } - return $this->collCcShowDayss; - } - - /** - * Returns the number of related CcShowDays objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowDays objects. - * @throws PropelException - */ - public function countCcShowDayss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowDayss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowDayss) { - return 0; - } else { - $query = CcShowDaysQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowDayss); - } - } - - /** - * Method called to associate a CcShowDays object to this object - * through the CcShowDays foreign key attribute. - * - * @param CcShowDays $l CcShowDays - * @return void - * @throws PropelException - */ - public function addCcShowDays(CcShowDays $l) - { - if ($this->collCcShowDayss === null) { - $this->initCcShowDayss(); - } - if (!$this->collCcShowDayss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowDayss[]= $l; - $l->setCcShow($this); - } - } - - /** - * Clears out the collCcShowRebroadcasts 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 addCcShowRebroadcasts() - */ - public function clearCcShowRebroadcasts() - { - $this->collCcShowRebroadcasts = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowRebroadcasts collection. - * - * By default this just sets the collCcShowRebroadcasts collection to an empty array (like clearcollCcShowRebroadcasts()); - * 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 initCcShowRebroadcasts() - { - $this->collCcShowRebroadcasts = new PropelObjectCollection(); - $this->collCcShowRebroadcasts->setModel('CcShowRebroadcast'); - } - - /** - * Gets an array of CcShowRebroadcast 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 CcShowRebroadcast[] List of CcShowRebroadcast objects - * @throws PropelException - */ - public function getCcShowRebroadcasts($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowRebroadcasts || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowRebroadcasts) { - // return empty collection - $this->initCcShowRebroadcasts(); - } else { - $collCcShowRebroadcasts = CcShowRebroadcastQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowRebroadcasts; - } - $this->collCcShowRebroadcasts = $collCcShowRebroadcasts; - } - } - return $this->collCcShowRebroadcasts; - } - - /** - * Returns the number of related CcShowRebroadcast objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowRebroadcast objects. - * @throws PropelException - */ - public function countCcShowRebroadcasts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowRebroadcasts || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowRebroadcasts) { - return 0; - } else { - $query = CcShowRebroadcastQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowRebroadcasts); - } - } - - /** - * Method called to associate a CcShowRebroadcast object to this object - * through the CcShowRebroadcast foreign key attribute. - * - * @param CcShowRebroadcast $l CcShowRebroadcast - * @return void - * @throws PropelException - */ - public function addCcShowRebroadcast(CcShowRebroadcast $l) - { - if ($this->collCcShowRebroadcasts === null) { - $this->initCcShowRebroadcasts(); - } - if (!$this->collCcShowRebroadcasts->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowRebroadcasts[]= $l; - $l->setCcShow($this); - } - } - - /** - * Clears out the collCcShowHostss 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 addCcShowHostss() - */ - public function clearCcShowHostss() - { - $this->collCcShowHostss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowHostss collection. - * - * By default this just sets the collCcShowHostss collection to an empty array (like clearcollCcShowHostss()); - * 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 initCcShowHostss() - { - $this->collCcShowHostss = new PropelObjectCollection(); - $this->collCcShowHostss->setModel('CcShowHosts'); - } - - /** - * Gets an array of CcShowHosts 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 CcShowHosts[] List of CcShowHosts objects - * @throws PropelException - */ - public function getCcShowHostss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - // return empty collection - $this->initCcShowHostss(); - } else { - $collCcShowHostss = CcShowHostsQuery::create(null, $criteria) - ->filterByCcShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowHostss; - } - $this->collCcShowHostss = $collCcShowHostss; - } - } - return $this->collCcShowHostss; - } - - /** - * Returns the number of related CcShowHosts objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowHosts objects. - * @throws PropelException - */ - public function countCcShowHostss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - return 0; - } else { - $query = CcShowHostsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShow($this) - ->count($con); - } - } else { - return count($this->collCcShowHostss); - } - } - - /** - * Method called to associate a CcShowHosts object to this object - * through the CcShowHosts foreign key attribute. - * - * @param CcShowHosts $l CcShowHosts - * @return void - * @throws PropelException - */ - public function addCcShowHosts(CcShowHosts $l) - { - if ($this->collCcShowHostss === null) { - $this->initCcShowHostss(); - } - if (!$this->collCcShowHostss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowHostss[]= $l; - $l->setCcShow($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShow is new, it will return - * an empty collection; or if this CcShow has previously - * been saved, it will retrieve related CcShowHostss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShow. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects - */ - public function getCcShowHostssJoinCcSubjs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowHostsQuery::create(null, $criteria); - $query->joinWith('CcSubjs', $join_behavior); - - return $this->getCcShowHostss($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->name = null; - $this->url = null; - $this->genre = null; - $this->description = null; - $this->color = null; - $this->background_color = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancess) { - foreach ((array) $this->collCcShowInstancess as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowDayss) { - foreach ((array) $this->collCcShowDayss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowRebroadcasts) { - foreach ((array) $this->collCcShowRebroadcasts as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowHostss) { - foreach ((array) $this->collCcShowHostss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancess = null; - $this->collCcShowDayss = null; - $this->collCcShowRebroadcasts = null; - $this->collCcShowHostss = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShow diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDays.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDays.php deleted file mode 100644 index be9f66086..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDays.php +++ /dev/null @@ -1,1476 +0,0 @@ -record = 0; - } - - /** - * Initializes internal state of BaseCcShowDays object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [optionally formatted] temporal [first_show] 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 getDbFirstShow($format = '%x') - { - if ($this->first_show === null) { - return null; - } - - - - try { - $dt = new DateTime($this->first_show); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->first_show, 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 [optionally formatted] temporal [last_show] 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 getDbLastShow($format = '%x') - { - if ($this->last_show === null) { - return null; - } - - - - try { - $dt = new DateTime($this->last_show); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->last_show, 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 [optionally formatted] temporal [start_time] 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 getDbStartTime($format = '%X') - { - if ($this->start_time === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start_time); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_time, 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 [timezone] column value. - * - * @return string - */ - public function getDbTimezone() - { - return $this->timezone; - } - - /** - * Get the [duration] column value. - * - * @return string - */ - public function getDbDuration() - { - return $this->duration; - } - - /** - * Get the [day] column value. - * - * @return int - */ - public function getDbDay() - { - 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Get the [record] column value. - * - * @return int - */ - public function getDbRecord() - { - return $this->record; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowDaysPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Sets the value of [first_show] 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 setDbFirstShow($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->first_show !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->first_show !== null && $tmpDt = new DateTime($this->first_show)) ? $tmpDt->format('Y-m-d') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->first_show = ($dt ? $dt->format('Y-m-d') : null); - $this->modifiedColumns[] = CcShowDaysPeer::FIRST_SHOW; - } - } // if either are not null - - return $this; - } // setDbFirstShow() - - /** - * Sets the value of [last_show] 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 setDbLastShow($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->last_show !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->last_show !== null && $tmpDt = new DateTime($this->last_show)) ? $tmpDt->format('Y-m-d') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->last_show = ($dt ? $dt->format('Y-m-d') : null); - $this->modifiedColumns[] = CcShowDaysPeer::LAST_SHOW; - } - } // if either are not null - - return $this; - } // setDbLastShow() - - /** - * Sets the value of [start_time] 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 setDbStartTime($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->start_time !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start_time !== null && $tmpDt = new DateTime($this->start_time)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start_time = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowDaysPeer::START_TIME; - } - } // if either are not null - - return $this; - } // setDbStartTime() - - /** - * Set the value of [timezone] column. - * - * @param string $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbTimezone($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->timezone !== $v) { - $this->timezone = $v; - $this->modifiedColumns[] = CcShowDaysPeer::TIMEZONE; - } - - return $this; - } // setDbTimezone() - - /** - * Set the value of [duration] column. - * - * @param string $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbDuration($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->duration !== $v) { - $this->duration = $v; - $this->modifiedColumns[] = CcShowDaysPeer::DURATION; - } - - return $this; - } // setDbDuration() - - /** - * Set the value of [day] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbDay($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->day !== $v) { - $this->day = $v; - $this->modifiedColumns[] = CcShowDaysPeer::DAY; - } - - return $this; - } // 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. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowDaysPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Set the value of [record] column. - * - * @param int $v new value - * @return CcShowDays The current object (for fluent API support) - */ - public function setDbRecord($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->record !== $v || $this->isNew()) { - $this->record = $v; - $this->modifiedColumns[] = CcShowDaysPeer::RECORD; - } - - return $this; - } // setDbRecord() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->record !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : 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->start_time = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->timezone = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->duration = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->day = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->repeat_type = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->next_pop_date = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->show_id = ($row[$startcol + 9] !== null) ? (int) $row[$startcol + 9] : null; - $this->record = ($row[$startcol + 10] !== null) ? (int) $row[$startcol + 10] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 11; // 11 = CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowDays object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowDaysPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowDaysQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowDaysPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowDaysPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowDaysPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowDaysPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowDaysPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - - if (($retval = CcShowDaysPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowDaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbFirstShow(); - break; - case 2: - return $this->getDbLastShow(); - break; - case 3: - return $this->getDbStartTime(); - break; - case 4: - return $this->getDbTimezone(); - break; - case 5: - return $this->getDbDuration(); - break; - case 6: - return $this->getDbDay(); - break; - case 7: - return $this->getDbRepeatType(); - break; - case 8: - return $this->getDbNextPopDate(); - break; - case 9: - return $this->getDbShowId(); - break; - case 10: - return $this->getDbRecord(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowDaysPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbFirstShow(), - $keys[2] => $this->getDbLastShow(), - $keys[3] => $this->getDbStartTime(), - $keys[4] => $this->getDbTimezone(), - $keys[5] => $this->getDbDuration(), - $keys[6] => $this->getDbDay(), - $keys[7] => $this->getDbRepeatType(), - $keys[8] => $this->getDbNextPopDate(), - $keys[9] => $this->getDbShowId(), - $keys[10] => $this->getDbRecord(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowDaysPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbFirstShow($value); - break; - case 2: - $this->setDbLastShow($value); - break; - case 3: - $this->setDbStartTime($value); - break; - case 4: - $this->setDbTimezone($value); - break; - case 5: - $this->setDbDuration($value); - break; - case 6: - $this->setDbDay($value); - break; - case 7: - $this->setDbRepeatType($value); - break; - case 8: - $this->setDbNextPopDate($value); - break; - case 9: - $this->setDbShowId($value); - break; - case 10: - $this->setDbRecord($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowDaysPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - 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[3], $arr)) $this->setDbStartTime($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbTimezone($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbDuration($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbDay($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbRepeatType($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbNextPopDate($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbShowId($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbRecord($arr[$keys[10]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowDaysPeer::ID)) $criteria->add(CcShowDaysPeer::ID, $this->id); - 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::START_TIME)) $criteria->add(CcShowDaysPeer::START_TIME, $this->start_time); - if ($this->isColumnModified(CcShowDaysPeer::TIMEZONE)) $criteria->add(CcShowDaysPeer::TIMEZONE, $this->timezone); - 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::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::RECORD)) $criteria->add(CcShowDaysPeer::RECORD, $this->record); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowDays (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbFirstShow($this->first_show); - $copyObj->setDbLastShow($this->last_show); - $copyObj->setDbStartTime($this->start_time); - $copyObj->setDbTimezone($this->timezone); - $copyObj->setDbDuration($this->duration); - $copyObj->setDbDay($this->day); - $copyObj->setDbRepeatType($this->repeat_type); - $copyObj->setDbNextPopDate($this->next_pop_date); - $copyObj->setDbShowId($this->show_id); - $copyObj->setDbRecord($this->record); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowDays Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowDaysPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowDaysPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowDays The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowDays($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowDayss($this); - */ - } - return $this->aCcShow; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->first_show = null; - $this->last_show = null; - $this->start_time = null; - $this->timezone = null; - $this->duration = null; - $this->day = null; - $this->repeat_type = null; - $this->next_pop_date = null; - $this->show_id = null; - $this->record = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowDays diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysPeer.php deleted file mode 100644 index df6b9081d..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysPeer.php +++ /dev/null @@ -1,1018 +0,0 @@ - array ('DbId', 'DbFirstShow', 'DbLastShow', 'DbStartTime', 'DbTimezone', 'DbDuration', 'DbDay', 'DbRepeatType', 'DbNextPopDate', 'DbShowId', 'DbRecord', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbFirstShow', 'dbLastShow', 'dbStartTime', 'dbTimezone', 'dbDuration', 'dbDay', 'dbRepeatType', 'dbNextPopDate', 'dbShowId', 'dbRecord', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::FIRST_SHOW, self::LAST_SHOW, self::START_TIME, self::TIMEZONE, self::DURATION, self::DAY, self::REPEAT_TYPE, self::NEXT_POP_DATE, self::SHOW_ID, self::RECORD, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'FIRST_SHOW', 'LAST_SHOW', 'START_TIME', 'TIMEZONE', 'DURATION', 'DAY', 'REPEAT_TYPE', 'NEXT_POP_DATE', 'SHOW_ID', 'RECORD', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'first_show', 'last_show', 'start_time', 'timezone', 'duration', 'day', 'repeat_type', 'next_pop_date', 'show_id', 'record', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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, 'DbFirstShow' => 1, 'DbLastShow' => 2, 'DbStartTime' => 3, 'DbTimezone' => 4, 'DbDuration' => 5, 'DbDay' => 6, 'DbRepeatType' => 7, 'DbNextPopDate' => 8, 'DbShowId' => 9, 'DbRecord' => 10, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbFirstShow' => 1, 'dbLastShow' => 2, 'dbStartTime' => 3, 'dbTimezone' => 4, 'dbDuration' => 5, 'dbDay' => 6, 'dbRepeatType' => 7, 'dbNextPopDate' => 8, 'dbShowId' => 9, 'dbRecord' => 10, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::FIRST_SHOW => 1, self::LAST_SHOW => 2, self::START_TIME => 3, self::TIMEZONE => 4, self::DURATION => 5, self::DAY => 6, self::REPEAT_TYPE => 7, self::NEXT_POP_DATE => 8, self::SHOW_ID => 9, self::RECORD => 10, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'FIRST_SHOW' => 1, 'LAST_SHOW' => 2, 'START_TIME' => 3, 'TIMEZONE' => 4, 'DURATION' => 5, 'DAY' => 6, 'REPEAT_TYPE' => 7, 'NEXT_POP_DATE' => 8, 'SHOW_ID' => 9, 'RECORD' => 10, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'first_show' => 1, 'last_show' => 2, 'start_time' => 3, 'timezone' => 4, 'duration' => 5, 'day' => 6, 'repeat_type' => 7, 'next_pop_date' => 8, 'show_id' => 9, 'record' => 10, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowDaysPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowDaysPeer::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(CcShowDaysPeer::ID); - $criteria->addSelectColumn(CcShowDaysPeer::FIRST_SHOW); - $criteria->addSelectColumn(CcShowDaysPeer::LAST_SHOW); - $criteria->addSelectColumn(CcShowDaysPeer::START_TIME); - $criteria->addSelectColumn(CcShowDaysPeer::TIMEZONE); - $criteria->addSelectColumn(CcShowDaysPeer::DURATION); - $criteria->addSelectColumn(CcShowDaysPeer::DAY); - $criteria->addSelectColumn(CcShowDaysPeer::REPEAT_TYPE); - $criteria->addSelectColumn(CcShowDaysPeer::NEXT_POP_DATE); - $criteria->addSelectColumn(CcShowDaysPeer::SHOW_ID); - $criteria->addSelectColumn(CcShowDaysPeer::RECORD); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.FIRST_SHOW'); - $criteria->addSelectColumn($alias . '.LAST_SHOW'); - $criteria->addSelectColumn($alias . '.START_TIME'); - $criteria->addSelectColumn($alias . '.TIMEZONE'); - $criteria->addSelectColumn($alias . '.DURATION'); - $criteria->addSelectColumn($alias . '.DAY'); - $criteria->addSelectColumn($alias . '.REPEAT_TYPE'); - $criteria->addSelectColumn($alias . '.NEXT_POP_DATE'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.RECORD'); - } - } - - /** - * 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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::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 CcShowDays - * @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 = CcShowDaysPeer::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 CcShowDaysPeer::populateObjects(CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowDaysPeer::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 CcShowDays $value A CcShowDays object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowDays $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 CcShowDays object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowDays) { - $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 CcShowDays 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 CcShowDays 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_days - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowDaysPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowDaysPeer::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; - CcShowDaysPeer::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 (CcShowDays object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowDaysPeer::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 + CcShowDaysPeer::NUM_COLUMNS; - } else { - $cls = CcShowDaysPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowDaysPeer::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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowDaysPeer::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 CcShowDays 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 CcShowDays 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); - } - - CcShowDaysPeer::addSelectColumns($criteria); - $startcol = (CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowDaysPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowDaysPeer::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 = CcShowDaysPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowDaysPeer::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 (CcShowDays) to $obj2 (CcShow) - $obj2->addCcShowDays($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(CcShowDaysPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowDaysPeer::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 CcShowDays 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 CcShowDays 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); - } - - CcShowDaysPeer::addSelectColumns($criteria); - $startcol2 = (CcShowDaysPeer::NUM_COLUMNS - CcShowDaysPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowDaysPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowDaysPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowDaysPeer::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 = CcShowDaysPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowDaysPeer::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 (CcShowDays) to the collection in $obj2 (CcShow) - $obj2->addCcShowDays($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(BaseCcShowDaysPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowDaysPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowDaysTableMap()); - } - } - - /** - * 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 ? CcShowDaysPeer::CLASS_DEFAULT : CcShowDaysPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowDays or Criteria object. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowDays object - } - - if ($criteria->containsKey(CcShowDaysPeer::ID) && $criteria->keyContainsValue(CcShowDaysPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowDaysPeer::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 CcShowDays or Criteria object. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowDaysPeer::ID); - $value = $criteria->remove(CcShowDaysPeer::ID); - if ($value) { - $selectCriteria->add(CcShowDaysPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowDaysPeer::TABLE_NAME); - } - - } else { // $values is CcShowDays 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_days 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(CcShowDaysPeer::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(CcShowDaysPeer::TABLE_NAME, $con, CcShowDaysPeer::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). - CcShowDaysPeer::clearInstancePool(); - CcShowDaysPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowDays or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowDays 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(CcShowDaysPeer::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. - CcShowDaysPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowDays) { // it's a model object - // invalidate the cache for this single object - CcShowDaysPeer::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(CcShowDaysPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowDaysPeer::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); - CcShowDaysPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowDays 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 CcShowDays $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(CcShowDays $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowDaysPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, CcShowDaysPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowDays - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowDaysPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $pk); - - $v = CcShowDaysPeer::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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME); - $criteria->add(CcShowDaysPeer::ID, $pks, Criteria::IN); - $objs = CcShowDaysPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowDaysPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowDaysPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysQuery.php deleted file mode 100644 index 18653bd70..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowDaysQuery.php +++ /dev/null @@ -1,565 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowDays|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowDaysPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery 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(CcShowDaysPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the first_show column - * - * @param string|array $dbFirstShow 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 filterByDbFirstShow($dbFirstShow = null, $comparison = null) - { - if (is_array($dbFirstShow)) { - $useMinMax = false; - if (isset($dbFirstShow['min'])) { - $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbFirstShow['max'])) { - $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::FIRST_SHOW, $dbFirstShow, $comparison); - } - - /** - * Filter the query on the last_show column - * - * @param string|array $dbLastShow 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 filterByDbLastShow($dbLastShow = null, $comparison = null) - { - if (is_array($dbLastShow)) { - $useMinMax = false; - if (isset($dbLastShow['min'])) { - $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastShow['max'])) { - $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::LAST_SHOW, $dbLastShow, $comparison); - } - - /** - * Filter the query on the start_time column - * - * @param string|array $dbStartTime 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 filterByDbStartTime($dbStartTime = null, $comparison = null) - { - if (is_array($dbStartTime)) { - $useMinMax = false; - if (isset($dbStartTime['min'])) { - $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStartTime['max'])) { - $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::START_TIME, $dbStartTime, $comparison); - } - - /** - * Filter the query on the timezone column - * - * @param string $dbTimezone The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function filterByDbTimezone($dbTimezone = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbTimezone)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbTimezone)) { - $dbTimezone = str_replace('*', '%', $dbTimezone); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowDaysPeer::TIMEZONE, $dbTimezone, $comparison); - } - - /** - * Filter the query on the duration column - * - * @param string $dbDuration The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function filterByDbDuration($dbDuration = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDuration)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDuration)) { - $dbDuration = str_replace('*', '%', $dbDuration); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration, $comparison); - } - - /** - * Filter the query on the day column - * - * @param int|array $dbDay 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 filterByDbDay($dbDay = null, $comparison = null) - { - if (is_array($dbDay)) { - $useMinMax = false; - if (isset($dbDay['min'])) { - $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbDay['max'])) { - $this->addUsingAlias(CcShowDaysPeer::DAY, $dbDay['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - 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 - * - * @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 CcShowDaysQuery 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(CcShowDaysPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShowId['max'])) { - $this->addUsingAlias(CcShowDaysPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::SHOW_ID, $dbShowId, $comparison); - } - - /** - * Filter the query on the record column - * - * @param int|array $dbRecord 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 filterByDbRecord($dbRecord = null, $comparison = null) - { - if (is_array($dbRecord)) { - $useMinMax = false; - if (isset($dbRecord['min'])) { - $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecord['max'])) { - $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowDaysPeer::RECORD, $dbRecord, $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 CcShowDaysQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowDaysPeer::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 CcShowDaysQuery 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'); - } - - /** - * Exclude object from result - * - * @param CcShowDays $ccShowDays Object to remove from the list of results - * - * @return CcShowDaysQuery The current query, for fluid interface - */ - public function prune($ccShowDays = null) - { - if ($ccShowDays) { - $this->addUsingAlias(CcShowDaysPeer::ID, $ccShowDays->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowDaysQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHosts.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHosts.php deleted file mode 100644 index ca4d11449..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHosts.php +++ /dev/null @@ -1,936 +0,0 @@ -id; - } - - /** - * Get the [show_id] column value. - * - * @return int - */ - public function getDbShow() - { - return $this->show_id; - } - - /** - * Get the [subjs_id] column value. - * - * @return int - */ - public function getDbHost() - { - return $this->subjs_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbShow($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShow() - - /** - * Set the value of [subjs_id] column. - * - * @param int $v new value - * @return CcShowHosts The current object (for fluent API support) - */ - public function setDbHost($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->subjs_id !== $v) { - $this->subjs_id = $v; - $this->modifiedColumns[] = CcShowHostsPeer::SUBJS_ID; - } - - if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) { - $this->aCcSubjs = null; - } - - return $this; - } // setDbHost() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->show_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->subjs_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowHosts object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - if ($this->aCcSubjs !== null && $this->subjs_id !== $this->aCcSubjs->getDbId()) { - $this->aCcSubjs = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowHostsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - $this->aCcSubjs = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowHostsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowHostsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->aCcSubjs !== null) { - if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) { - $affectedRows += $this->aCcSubjs->save($con); - } - $this->setCcSubjs($this->aCcSubjs); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowHostsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowHostsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowHostsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowHostsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - if ($this->aCcSubjs !== null) { - if (!$this->aCcSubjs->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures()); - } - } - - - if (($retval = CcShowHostsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowHostsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbShow(); - break; - case 2: - return $this->getDbHost(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowHostsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbShow(), - $keys[2] => $this->getDbHost(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcSubjs) { - $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowHostsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbShow($value); - break; - case 2: - $this->setDbHost($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowHostsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbShow($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbHost($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowHostsPeer::ID)) $criteria->add(CcShowHostsPeer::ID, $this->id); - if ($this->isColumnModified(CcShowHostsPeer::SHOW_ID)) $criteria->add(CcShowHostsPeer::SHOW_ID, $this->show_id); - if ($this->isColumnModified(CcShowHostsPeer::SUBJS_ID)) $criteria->add(CcShowHostsPeer::SUBJS_ID, $this->subjs_id); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowHosts (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbShow($this->show_id); - $copyObj->setDbHost($this->subjs_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowHosts Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowHostsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowHostsPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowHosts The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShow(NULL); - } else { - $this->setDbShow($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowHosts($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowHostss($this); - */ - } - return $this->aCcShow; - } - - /** - * Declares an association between this object and a CcSubjs object. - * - * @param CcSubjs $v - * @return CcShowHosts The current object (for fluent API support) - * @throws PropelException - */ - public function setCcSubjs(CcSubjs $v = null) - { - if ($v === null) { - $this->setDbHost(NULL); - } else { - $this->setDbHost($v->getDbId()); - } - - $this->aCcSubjs = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcSubjs object, it will not be re-added. - if ($v !== null) { - $v->addCcShowHosts($this); - } - - return $this; - } - - - /** - * Get the associated CcSubjs object - * - * @param PropelPDO Optional Connection object. - * @return CcSubjs The associated CcSubjs object. - * @throws PropelException - */ - public function getCcSubjs(PropelPDO $con = null) - { - if ($this->aCcSubjs === null && ($this->subjs_id !== null)) { - $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subjs_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->aCcSubjs->addCcShowHostss($this); - */ - } - return $this->aCcSubjs; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->show_id = null; - $this->subjs_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - $this->aCcSubjs = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowHosts diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsPeer.php deleted file mode 100644 index 33a82f0d9..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsPeer.php +++ /dev/null @@ -1,1365 +0,0 @@ - array ('DbId', 'DbShow', 'DbHost', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbShow', 'dbHost', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::SHOW_ID, self::SUBJS_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'SHOW_ID', 'SUBJS_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'show_id', 'subjs_id', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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, 'DbShow' => 1, 'DbHost' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbShow' => 1, 'dbHost' => 2, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::SHOW_ID => 1, self::SUBJS_ID => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'SHOW_ID' => 1, 'SUBJS_ID' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'show_id' => 1, 'subjs_id' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowHostsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowHostsPeer::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(CcShowHostsPeer::ID); - $criteria->addSelectColumn(CcShowHostsPeer::SHOW_ID); - $criteria->addSelectColumn(CcShowHostsPeer::SUBJS_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.SUBJS_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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::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 CcShowHosts - * @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 = CcShowHostsPeer::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 CcShowHostsPeer::populateObjects(CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowHostsPeer::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 CcShowHosts $value A CcShowHosts object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowHosts $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 CcShowHosts object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowHosts) { - $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 CcShowHosts 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 CcShowHosts 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_hosts - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowHostsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowHostsPeer::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; - CcShowHostsPeer::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 (CcShowHosts object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowHostsPeer::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 + CcShowHostsPeer::NUM_COLUMNS; - } else { - $cls = CcShowHostsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowHostsPeer::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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinCcSubjs(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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 CcShowHosts 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 CcShowHosts 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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 (CcShowHosts) to $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - - } // if joined row was not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowHosts objects pre-filled with their CcSubjs 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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinCcSubjs(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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - CcSubjsPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::addInstanceToPool($obj1, $key1); - } // if $obj1 already loaded - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowHosts) to $obj2 (CcSubjs) - $obj2->addCcShowHosts($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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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 CcShowHosts 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 CcShowHosts 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); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 (CcShowHosts) to the collection in $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - } // if joined row not null - - // Add objects for joined CcSubjs rows - - $key3 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcSubjsPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcSubjsPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj3 (CcSubjs) - $obj3->addCcShowHosts($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShow(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcSubjs 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 doCountJoinAllExceptCcSubjs(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(CcShowHostsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowHostsPeer::addSelectColumns($criteria); - } - - $criteria->clearOrderByColumns(); // ORDER BY should not affect count - - // Set the correct dbName - $criteria->setDbName(self::DATABASE_NAME); - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowHostsPeer::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 CcShowHosts objects pre-filled with all related objects except CcShow. - * - * @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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcSubjsPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SUBJS_ID, CcSubjsPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::addInstanceToPool($obj1, $key1); - } // if obj1 already loaded - - // Add objects for joined CcSubjs rows - - $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcSubjsPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcSubjsPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcSubjsPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj2 (CcSubjs) - $obj2->addCcShowHosts($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowHosts objects pre-filled with all related objects except CcSubjs. - * - * @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 CcShowHosts objects. - * @throws PropelException Any exceptions caught during processing will be - * rethrown wrapped into a PropelException. - */ - public static function doSelectJoinAllExceptCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowHostsPeer::addSelectColumns($criteria); - $startcol2 = (CcShowHostsPeer::NUM_COLUMNS - CcShowHostsPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowHostsPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowHostsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowHostsPeer::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 = CcShowHostsPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowHostsPeer::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 already loaded - - // Add the $obj1 (CcShowHosts) to the collection in $obj2 (CcShow) - $obj2->addCcShowHosts($obj1); - - } // if joined row is 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(BaseCcShowHostsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowHostsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowHostsTableMap()); - } - } - - /** - * 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 ? CcShowHostsPeer::CLASS_DEFAULT : CcShowHostsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowHosts or Criteria object. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowHosts object - } - - if ($criteria->containsKey(CcShowHostsPeer::ID) && $criteria->keyContainsValue(CcShowHostsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowHostsPeer::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 CcShowHosts or Criteria object. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowHostsPeer::ID); - $value = $criteria->remove(CcShowHostsPeer::ID); - if ($value) { - $selectCriteria->add(CcShowHostsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowHostsPeer::TABLE_NAME); - } - - } else { // $values is CcShowHosts 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_hosts 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(CcShowHostsPeer::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(CcShowHostsPeer::TABLE_NAME, $con, CcShowHostsPeer::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). - CcShowHostsPeer::clearInstancePool(); - CcShowHostsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowHosts or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowHosts 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(CcShowHostsPeer::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. - CcShowHostsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowHosts) { // it's a model object - // invalidate the cache for this single object - CcShowHostsPeer::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(CcShowHostsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowHostsPeer::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); - CcShowHostsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowHosts 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 CcShowHosts $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(CcShowHosts $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowHostsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, CcShowHostsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowHosts - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowHostsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $pk); - - $v = CcShowHostsPeer::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(CcShowHostsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowHostsPeer::DATABASE_NAME); - $criteria->add(CcShowHostsPeer::ID, $pks, Criteria::IN); - $objs = CcShowHostsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowHostsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowHostsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsQuery.php deleted file mode 100644 index 2b910a52b..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowHostsQuery.php +++ /dev/null @@ -1,371 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowHosts|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowHostsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery 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(CcShowHostsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the show_id column - * - * @param int|array $dbShow 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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByDbShow($dbShow = null, $comparison = null) - { - if (is_array($dbShow)) { - $useMinMax = false; - if (isset($dbShow['min'])) { - $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShow['max'])) { - $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowHostsPeer::SHOW_ID, $dbShow, $comparison); - } - - /** - * Filter the query on the subjs_id column - * - * @param int|array $dbHost 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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByDbHost($dbHost = null, $comparison = null) - { - if (is_array($dbHost)) { - $useMinMax = false; - if (isset($dbHost['min'])) { - $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbHost['max'])) { - $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $dbHost, $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 CcShowHostsQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowHostsPeer::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 CcShowHostsQuery 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 CcSubjs object - * - * @param CcSubjs $ccSubjs the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function filterByCcSubjs($ccSubjs, $comparison = null) - { - return $this - ->addUsingAlias(CcShowHostsPeer::SUBJS_ID, $ccSubjs->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSubjs relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function joinCcSubjs($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSubjs'); - - // 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, 'CcSubjs'); - } - - return $this; - } - - /** - * Use the CcSubjs relation CcSubjs 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 CcSubjsQuery A secondary query class using the current class as primary query - */ - public function useCcSubjsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcSubjs($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery'); - } - - /** - * Exclude object from result - * - * @param CcShowHosts $ccShowHosts Object to remove from the list of results - * - * @return CcShowHostsQuery The current query, for fluid interface - */ - public function prune($ccShowHosts = null) - { - if ($ccShowHosts) { - $this->addUsingAlias(CcShowHostsPeer::ID, $ccShowHosts->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowHostsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstances.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstances.php deleted file mode 100644 index c78c34142..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstances.php +++ /dev/null @@ -1,1945 +0,0 @@ -record = 0; - $this->rebroadcast = 0; - $this->modified_instance = false; - } - - /** - * Initializes internal state of BaseCcShowInstances object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [optionally formatted] temporal [starts] 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 getDbStarts($format = 'Y-m-d H:i:s') - { - if ($this->starts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->starts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->starts, 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 [optionally formatted] temporal [ends] 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 getDbEnds($format = 'Y-m-d H:i:s') - { - if ($this->ends === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ends); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ends, 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Get the [record] column value. - * - * @return int - */ - public function getDbRecord() - { - return $this->record; - } - - /** - * Get the [rebroadcast] column value. - * - * @return int - */ - public function getDbRebroadcast() - { - return $this->rebroadcast; - } - - /** - * Get the [instance_id] column value. - * - * @return int - */ - public function getDbOriginalShow() - { - return $this->instance_id; - } - - /** - * Get the [file_id] column value. - * - * @return int - */ - public function getDbRecordedFile() - { - return $this->file_id; - } - - /** - * Get the [optionally formatted] temporal [time_filled] 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 getDbTimeFilled($format = '%X') - { - if ($this->time_filled === null) { - return null; - } - - - - try { - $dt = new DateTime($this->time_filled); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->time_filled, 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 [modified_instance] column value. - * - * @return boolean - */ - public function getDbModifiedInstance() - { - return $this->modified_instance; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Sets the value of [starts] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbStarts($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->starts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->starts !== null && $tmpDt = new DateTime($this->starts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->starts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::STARTS; - } - } // if either are not null - - return $this; - } // setDbStarts() - - /** - * Sets the value of [ends] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbEnds($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->ends !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ends !== null && $tmpDt = new DateTime($this->ends)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ends = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::ENDS; - } - } // if either are not null - - return $this; - } // setDbEnds() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Set the value of [record] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRecord($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->record !== $v || $this->isNew()) { - $this->record = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::RECORD; - } - - return $this; - } // setDbRecord() - - /** - * Set the value of [rebroadcast] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRebroadcast($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->rebroadcast !== $v || $this->isNew()) { - $this->rebroadcast = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::REBROADCAST; - } - - return $this; - } // setDbRebroadcast() - - /** - * Set the value of [instance_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbOriginalShow($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->instance_id !== $v) { - $this->instance_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::INSTANCE_ID; - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null && $this->aCcShowInstancesRelatedByDbOriginalShow->getDbId() !== $v) { - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - } - - return $this; - } // setDbOriginalShow() - - /** - * Set the value of [file_id] column. - * - * @param int $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbRecordedFile($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->file_id !== $v) { - $this->file_id = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::FILE_ID; - } - - if ($this->aCcFiles !== null && $this->aCcFiles->getDbId() !== $v) { - $this->aCcFiles = null; - } - - return $this; - } // setDbRecordedFile() - - /** - * Sets the value of [time_filled] 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 CcShowInstances The current object (for fluent API support) - */ - public function setDbTimeFilled($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->time_filled !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->time_filled !== null && $tmpDt = new DateTime($this->time_filled)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->time_filled = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowInstancesPeer::TIME_FILLED; - } - } // if either are not null - - return $this; - } // setDbTimeFilled() - - /** - * Set the value of [modified_instance] column. - * - * @param boolean $v new value - * @return CcShowInstances The current object (for fluent API support) - */ - public function setDbModifiedInstance($v) - { - if ($v !== null) { - $v = (boolean) $v; - } - - if ($this->modified_instance !== $v || $this->isNew()) { - $this->modified_instance = $v; - $this->modifiedColumns[] = CcShowInstancesPeer::MODIFIED_INSTANCE; - } - - return $this; - } // setDbModifiedInstance() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->record !== 0) { - return false; - } - - if ($this->rebroadcast !== 0) { - return false; - } - - if ($this->modified_instance !== false) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->starts = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->ends = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->show_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->record = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->rebroadcast = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null; - $this->instance_id = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null; - $this->file_id = ($row[$startcol + 7] !== null) ? (int) $row[$startcol + 7] : null; - $this->time_filled = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->modified_instance = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 10; // 10 = CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowInstances object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null && $this->instance_id !== $this->aCcShowInstancesRelatedByDbOriginalShow->getDbId()) { - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - } - if ($this->aCcFiles !== null && $this->file_id !== $this->aCcFiles->getDbId()) { - $this->aCcFiles = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowInstancesPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - $this->aCcFiles = null; - $this->collCcShowInstancessRelatedByDbId = null; - - $this->collCcSchedules = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowInstancesQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowInstancesPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null) { - if ($this->aCcShowInstancesRelatedByDbOriginalShow->isModified() || $this->aCcShowInstancesRelatedByDbOriginalShow->isNew()) { - $affectedRows += $this->aCcShowInstancesRelatedByDbOriginalShow->save($con); - } - $this->setCcShowInstancesRelatedByDbOriginalShow($this->aCcShowInstancesRelatedByDbOriginalShow); - } - - if ($this->aCcFiles !== null) { - if ($this->aCcFiles->isModified() || $this->aCcFiles->isNew()) { - $affectedRows += $this->aCcFiles->save($con); - } - $this->setCcFiles($this->aCcFiles); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowInstancesPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowInstancesPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowInstancesPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowInstancesPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcShowInstancessRelatedByDbId !== null) { - foreach ($this->collCcShowInstancessRelatedByDbId as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - if ($this->aCcShowInstancesRelatedByDbOriginalShow !== null) { - if (!$this->aCcShowInstancesRelatedByDbOriginalShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShowInstancesRelatedByDbOriginalShow->getValidationFailures()); - } - } - - if ($this->aCcFiles !== null) { - if (!$this->aCcFiles->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcFiles->getValidationFailures()); - } - } - - - if (($retval = CcShowInstancesPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcShowInstancessRelatedByDbId !== null) { - foreach ($this->collCcShowInstancessRelatedByDbId as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSchedules !== null) { - foreach ($this->collCcSchedules as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowInstancesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbStarts(); - break; - case 2: - return $this->getDbEnds(); - break; - case 3: - return $this->getDbShowId(); - break; - case 4: - return $this->getDbRecord(); - break; - case 5: - return $this->getDbRebroadcast(); - break; - case 6: - return $this->getDbOriginalShow(); - break; - case 7: - return $this->getDbRecordedFile(); - break; - case 8: - return $this->getDbTimeFilled(); - break; - case 9: - return $this->getDbModifiedInstance(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowInstancesPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbStarts(), - $keys[2] => $this->getDbEnds(), - $keys[3] => $this->getDbShowId(), - $keys[4] => $this->getDbRecord(), - $keys[5] => $this->getDbRebroadcast(), - $keys[6] => $this->getDbOriginalShow(), - $keys[7] => $this->getDbRecordedFile(), - $keys[8] => $this->getDbTimeFilled(), - $keys[9] => $this->getDbModifiedInstance(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcShowInstancesRelatedByDbOriginalShow) { - $result['CcShowInstancesRelatedByDbOriginalShow'] = $this->aCcShowInstancesRelatedByDbOriginalShow->toArray($keyType, $includeLazyLoadColumns, true); - } - if (null !== $this->aCcFiles) { - $result['CcFiles'] = $this->aCcFiles->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowInstancesPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbStarts($value); - break; - case 2: - $this->setDbEnds($value); - break; - case 3: - $this->setDbShowId($value); - break; - case 4: - $this->setDbRecord($value); - break; - case 5: - $this->setDbRebroadcast($value); - break; - case 6: - $this->setDbOriginalShow($value); - break; - case 7: - $this->setDbRecordedFile($value); - break; - case 8: - $this->setDbTimeFilled($value); - break; - case 9: - $this->setDbModifiedInstance($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowInstancesPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbStarts($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbEnds($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbShowId($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbRecord($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbRebroadcast($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbOriginalShow($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbRecordedFile($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbTimeFilled($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbModifiedInstance($arr[$keys[9]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowInstancesPeer::ID)) $criteria->add(CcShowInstancesPeer::ID, $this->id); - if ($this->isColumnModified(CcShowInstancesPeer::STARTS)) $criteria->add(CcShowInstancesPeer::STARTS, $this->starts); - if ($this->isColumnModified(CcShowInstancesPeer::ENDS)) $criteria->add(CcShowInstancesPeer::ENDS, $this->ends); - if ($this->isColumnModified(CcShowInstancesPeer::SHOW_ID)) $criteria->add(CcShowInstancesPeer::SHOW_ID, $this->show_id); - if ($this->isColumnModified(CcShowInstancesPeer::RECORD)) $criteria->add(CcShowInstancesPeer::RECORD, $this->record); - if ($this->isColumnModified(CcShowInstancesPeer::REBROADCAST)) $criteria->add(CcShowInstancesPeer::REBROADCAST, $this->rebroadcast); - if ($this->isColumnModified(CcShowInstancesPeer::INSTANCE_ID)) $criteria->add(CcShowInstancesPeer::INSTANCE_ID, $this->instance_id); - if ($this->isColumnModified(CcShowInstancesPeer::FILE_ID)) $criteria->add(CcShowInstancesPeer::FILE_ID, $this->file_id); - if ($this->isColumnModified(CcShowInstancesPeer::TIME_FILLED)) $criteria->add(CcShowInstancesPeer::TIME_FILLED, $this->time_filled); - if ($this->isColumnModified(CcShowInstancesPeer::MODIFIED_INSTANCE)) $criteria->add(CcShowInstancesPeer::MODIFIED_INSTANCE, $this->modified_instance); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowInstancesPeer::DATABASE_NAME); - $criteria->add(CcShowInstancesPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowInstances (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbStarts($this->starts); - $copyObj->setDbEnds($this->ends); - $copyObj->setDbShowId($this->show_id); - $copyObj->setDbRecord($this->record); - $copyObj->setDbRebroadcast($this->rebroadcast); - $copyObj->setDbOriginalShow($this->instance_id); - $copyObj->setDbRecordedFile($this->file_id); - $copyObj->setDbTimeFilled($this->time_filled); - $copyObj->setDbModifiedInstance($this->modified_instance); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcShowInstancessRelatedByDbId() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowInstancesRelatedByDbId($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSchedules() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSchedule($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowInstances Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowInstancesPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowInstancesPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowInstances($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowInstancess($this); - */ - } - return $this->aCcShow; - } - - /** - * Declares an association between this object and a CcShowInstances object. - * - * @param CcShowInstances $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShowInstancesRelatedByDbOriginalShow(CcShowInstances $v = null) - { - if ($v === null) { - $this->setDbOriginalShow(NULL); - } else { - $this->setDbOriginalShow($v->getDbId()); - } - - $this->aCcShowInstancesRelatedByDbOriginalShow = $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->addCcShowInstancesRelatedByDbId($this); - } - - return $this; - } - - - /** - * Get the associated CcShowInstances object - * - * @param PropelPDO Optional Connection object. - * @return CcShowInstances The associated CcShowInstances object. - * @throws PropelException - */ - public function getCcShowInstancesRelatedByDbOriginalShow(PropelPDO $con = null) - { - if ($this->aCcShowInstancesRelatedByDbOriginalShow === null && ($this->instance_id !== null)) { - $this->aCcShowInstancesRelatedByDbOriginalShow = 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->aCcShowInstancesRelatedByDbOriginalShow->addCcShowInstancessRelatedByDbId($this); - */ - } - return $this->aCcShowInstancesRelatedByDbOriginalShow; - } - - /** - * Declares an association between this object and a CcFiles object. - * - * @param CcFiles $v - * @return CcShowInstances The current object (for fluent API support) - * @throws PropelException - */ - public function setCcFiles(CcFiles $v = null) - { - if ($v === null) { - $this->setDbRecordedFile(NULL); - } else { - $this->setDbRecordedFile($v->getDbId()); - } - - $this->aCcFiles = $v; - - // Add binding for other direction of this n:n relationship. - // If this object has already been added to the CcFiles object, it will not be re-added. - if ($v !== null) { - $v->addCcShowInstances($this); - } - - return $this; - } - - - /** - * Get the associated CcFiles object - * - * @param PropelPDO Optional Connection object. - * @return CcFiles The associated CcFiles object. - * @throws PropelException - */ - public function getCcFiles(PropelPDO $con = null) - { - if ($this->aCcFiles === null && ($this->file_id !== null)) { - $this->aCcFiles = CcFilesQuery::create()->findPk($this->file_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->aCcFiles->addCcShowInstancess($this); - */ - } - return $this->aCcFiles; - } - - /** - * Clears out the collCcShowInstancessRelatedByDbId 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 addCcShowInstancessRelatedByDbId() - */ - public function clearCcShowInstancessRelatedByDbId() - { - $this->collCcShowInstancessRelatedByDbId = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowInstancessRelatedByDbId collection. - * - * By default this just sets the collCcShowInstancessRelatedByDbId collection to an empty array (like clearcollCcShowInstancessRelatedByDbId()); - * 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 initCcShowInstancessRelatedByDbId() - { - $this->collCcShowInstancessRelatedByDbId = new PropelObjectCollection(); - $this->collCcShowInstancessRelatedByDbId->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 CcShowInstances 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 getCcShowInstancessRelatedByDbId($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowInstancessRelatedByDbId || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowInstancessRelatedByDbId) { - // return empty collection - $this->initCcShowInstancessRelatedByDbId(); - } else { - $collCcShowInstancessRelatedByDbId = CcShowInstancesQuery::create(null, $criteria) - ->filterByCcShowInstancesRelatedByDbOriginalShow($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowInstancessRelatedByDbId; - } - $this->collCcShowInstancessRelatedByDbId = $collCcShowInstancessRelatedByDbId; - } - } - return $this->collCcShowInstancessRelatedByDbId; - } - - /** - * 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 countCcShowInstancessRelatedByDbId(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowInstancessRelatedByDbId || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowInstancessRelatedByDbId) { - return 0; - } else { - $query = CcShowInstancesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShowInstancesRelatedByDbOriginalShow($this) - ->count($con); - } - } else { - return count($this->collCcShowInstancessRelatedByDbId); - } - } - - /** - * 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 addCcShowInstancesRelatedByDbId(CcShowInstances $l) - { - if ($this->collCcShowInstancessRelatedByDbId === null) { - $this->initCcShowInstancessRelatedByDbId(); - } - if (!$this->collCcShowInstancessRelatedByDbId->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowInstancessRelatedByDbId[]= $l; - $l->setCcShowInstancesRelatedByDbOriginalShow($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowInstancessRelatedByDbId from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessRelatedByDbIdJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowInstancessRelatedByDbId($query, $con); - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcShowInstancessRelatedByDbId from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowInstances[] List of CcShowInstances objects - */ - public function getCcShowInstancessRelatedByDbIdJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowInstancesQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcShowInstancessRelatedByDbId($query, $con); - } - - /** - * Clears out the collCcSchedules 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 addCcSchedules() - */ - public function clearCcSchedules() - { - $this->collCcSchedules = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSchedules collection. - * - * By default this just sets the collCcSchedules collection to an empty array (like clearcollCcSchedules()); - * 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 initCcSchedules() - { - $this->collCcSchedules = new PropelObjectCollection(); - $this->collCcSchedules->setModel('CcSchedule'); - } - - /** - * Gets an array of CcSchedule 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 CcShowInstances 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 CcSchedule[] List of CcSchedule objects - * @throws PropelException - */ - public function getCcSchedules($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - // return empty collection - $this->initCcSchedules(); - } else { - $collCcSchedules = CcScheduleQuery::create(null, $criteria) - ->filterByCcShowInstances($this) - ->find($con); - if (null !== $criteria) { - return $collCcSchedules; - } - $this->collCcSchedules = $collCcSchedules; - } - } - return $this->collCcSchedules; - } - - /** - * Returns the number of related CcSchedule objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSchedule objects. - * @throws PropelException - */ - public function countCcSchedules(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSchedules || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSchedules) { - return 0; - } else { - $query = CcScheduleQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcShowInstances($this) - ->count($con); - } - } else { - return count($this->collCcSchedules); - } - } - - /** - * Method called to associate a CcSchedule object to this object - * through the CcSchedule foreign key attribute. - * - * @param CcSchedule $l CcSchedule - * @return void - * @throws PropelException - */ - public function addCcSchedule(CcSchedule $l) - { - if ($this->collCcSchedules === null) { - $this->initCcSchedules(); - } - if (!$this->collCcSchedules->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSchedules[]= $l; - $l->setCcShowInstances($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcShowInstances is new, it will return - * an empty collection; or if this CcShowInstances has previously - * been saved, it will retrieve related CcSchedules from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcShowInstances. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcSchedule[] List of CcSchedule objects - */ - public function getCcSchedulesJoinCcFiles($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcScheduleQuery::create(null, $criteria); - $query->joinWith('CcFiles', $join_behavior); - - return $this->getCcSchedules($query, $con); - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->starts = null; - $this->ends = null; - $this->show_id = null; - $this->record = null; - $this->rebroadcast = null; - $this->instance_id = null; - $this->file_id = null; - $this->time_filled = null; - $this->modified_instance = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcShowInstancessRelatedByDbId) { - foreach ((array) $this->collCcShowInstancessRelatedByDbId as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSchedules) { - foreach ((array) $this->collCcSchedules as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcShowInstancessRelatedByDbId = null; - $this->collCcSchedules = null; - $this->aCcShow = null; - $this->aCcShowInstancesRelatedByDbOriginalShow = null; - $this->aCcFiles = null; - } - - // aggregate_column behavior - - /** - * Computes the value of the aggregate column time_filled - * - * @param PropelPDO $con A connection object - * - * @return mixed The scalar result from the aggregate query - */ - public function computeDbTimeFilled(PropelPDO $con) - { - $stmt = $con->prepare('SELECT SUM(clip_length) FROM "cc_schedule" WHERE cc_schedule.INSTANCE_ID = :p1'); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - /** - * Updates the aggregate column time_filled - * - * @param PropelPDO $con A connection object - */ - public function updateDbTimeFilled(PropelPDO $con) - { - $this->setDbTimeFilled($this->computeDbTimeFilled($con)); - $this->save($con); - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowInstances diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesPeer.php deleted file mode 100644 index d30a1a8ab..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesPeer.php +++ /dev/null @@ -1,1555 +0,0 @@ - array ('DbId', 'DbStarts', 'DbEnds', 'DbShowId', 'DbRecord', 'DbRebroadcast', 'DbOriginalShow', 'DbRecordedFile', 'DbTimeFilled', 'DbModifiedInstance', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbStarts', 'dbEnds', 'dbShowId', 'dbRecord', 'dbRebroadcast', 'dbOriginalShow', 'dbRecordedFile', 'dbTimeFilled', 'dbModifiedInstance', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::STARTS, self::ENDS, self::SHOW_ID, self::RECORD, self::REBROADCAST, self::INSTANCE_ID, self::FILE_ID, self::TIME_FILLED, self::MODIFIED_INSTANCE, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'STARTS', 'ENDS', 'SHOW_ID', 'RECORD', 'REBROADCAST', 'INSTANCE_ID', 'FILE_ID', 'TIME_FILLED', 'MODIFIED_INSTANCE', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'starts', 'ends', 'show_id', 'record', 'rebroadcast', 'instance_id', 'file_id', 'time_filled', 'modified_instance', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) - ); - - /** - * 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, 'DbRecord' => 4, 'DbRebroadcast' => 5, 'DbOriginalShow' => 6, 'DbRecordedFile' => 7, 'DbTimeFilled' => 8, 'DbModifiedInstance' => 9, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbStarts' => 1, 'dbEnds' => 2, 'dbShowId' => 3, 'dbRecord' => 4, 'dbRebroadcast' => 5, 'dbOriginalShow' => 6, 'dbRecordedFile' => 7, 'dbTimeFilled' => 8, 'dbModifiedInstance' => 9, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::STARTS => 1, self::ENDS => 2, self::SHOW_ID => 3, self::RECORD => 4, self::REBROADCAST => 5, self::INSTANCE_ID => 6, self::FILE_ID => 7, self::TIME_FILLED => 8, self::MODIFIED_INSTANCE => 9, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'STARTS' => 1, 'ENDS' => 2, 'SHOW_ID' => 3, 'RECORD' => 4, 'REBROADCAST' => 5, 'INSTANCE_ID' => 6, 'FILE_ID' => 7, 'TIME_FILLED' => 8, 'MODIFIED_INSTANCE' => 9, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'starts' => 1, 'ends' => 2, 'show_id' => 3, 'record' => 4, 'rebroadcast' => 5, 'instance_id' => 6, 'file_id' => 7, 'time_filled' => 8, 'modified_instance' => 9, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @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); - $criteria->addSelectColumn(CcShowInstancesPeer::RECORD); - $criteria->addSelectColumn(CcShowInstancesPeer::REBROADCAST); - $criteria->addSelectColumn(CcShowInstancesPeer::INSTANCE_ID); - $criteria->addSelectColumn(CcShowInstancesPeer::FILE_ID); - $criteria->addSelectColumn(CcShowInstancesPeer::TIME_FILLED); - $criteria->addSelectColumn(CcShowInstancesPeer::MODIFIED_INSTANCE); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.STARTS'); - $criteria->addSelectColumn($alias . '.ENDS'); - $criteria->addSelectColumn($alias . '.SHOW_ID'); - $criteria->addSelectColumn($alias . '.RECORD'); - $criteria->addSelectColumn($alias . '.REBROADCAST'); - $criteria->addSelectColumn($alias . '.INSTANCE_ID'); - $criteria->addSelectColumn($alias . '.FILE_ID'); - $criteria->addSelectColumn($alias . '.TIME_FILLED'); - $criteria->addSelectColumn($alias . '.MODIFIED_INSTANCE'); - } - } - - /** - * 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 CcShowInstancesPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowInstancesPeer::clearInstancePool(); - // 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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinCcFiles(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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with their CcFiles 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 doSelectJoinCcFiles(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); - CcFilesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if obj2 already loaded - - // Add the $obj1 (CcShowInstances) to $obj2 (CcFiles) - $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); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if obj3 loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj3 (CcFiles) - $obj3->addCcShowInstances($obj1); - } // if joined row not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * 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 doCountJoinAllExceptCcShow(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 should not affect 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::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcShowInstancesRelatedByDbOriginalShow 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 doCountJoinAllExceptCcShowInstancesRelatedByDbOriginalShow(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 should not affect 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); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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; - } - - - /** - * Returns the number of rows matching criteria, joining the related CcFiles 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 doCountJoinAllExceptCcFiles(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 should not affect 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 except CcShow. - * - * @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 doSelectJoinAllExceptCcShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - if ($criteria->getDbName() == Propel::getDefaultDB()) { - $criteria->setDbName(self::DATABASE_NAME); - } - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol2 = (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - CcFilesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 CcFiles rows - - $key2 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol2); - if ($key2 !== null) { - $obj2 = CcFilesPeer::getInstanceFromPool($key2); - if (!$obj2) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj2 = new $cls(); - $obj2->hydrate($row, $startcol2); - CcFilesPeer::addInstanceToPool($obj2, $key2); - } // if $obj2 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcFiles) - $obj2->addCcShowInstances($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with all related objects except CcShowInstancesRelatedByDbOriginalShow. - * - * @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 doSelectJoinAllExceptCcShowInstancesRelatedByDbOriginalShow(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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); - - CcFilesPeer::addSelectColumns($criteria); - $startcol4 = $startcol3 + (CcFilesPeer::NUM_COLUMNS - CcFilesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowInstancesPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $criteria->addJoin(CcShowInstancesPeer::FILE_ID, CcFilesPeer::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 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcShow) - $obj2->addCcShowInstances($obj1); - - } // if joined row is not null - - // Add objects for joined CcFiles rows - - $key3 = CcFilesPeer::getPrimaryKeyHashFromRow($row, $startcol3); - if ($key3 !== null) { - $obj3 = CcFilesPeer::getInstanceFromPool($key3); - if (!$obj3) { - - $cls = CcFilesPeer::getOMClass(false); - - $obj3 = new $cls(); - $obj3->hydrate($row, $startcol3); - CcFilesPeer::addInstanceToPool($obj3, $key3); - } // if $obj3 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj3 (CcFiles) - $obj3->addCcShowInstances($obj1); - - } // if joined row is not null - - $results[] = $obj1; - } - $stmt->closeCursor(); - return $results; - } - - - /** - * Selects a collection of CcShowInstances objects pre-filled with all related objects except CcFiles. - * - * @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 doSelectJoinAllExceptCcFiles(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $criteria = clone $criteria; - - // Set the correct dbName if it has not been overridden - // $criteria->getDbName() will return the same object if not set to another value - // so == check is okay and faster - 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 already loaded - - // Add the $obj1 (CcShowInstances) to the collection in $obj2 (CcShow) - $obj2->addCcShowInstances($obj1); - - } // if joined row is 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(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesQuery.php deleted file mode 100644 index d127d88ad..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowInstancesQuery.php +++ /dev/null @@ -1,806 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 on the record column - * - * @param int|array $dbRecord 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 filterByDbRecord($dbRecord = null, $comparison = null) - { - if (is_array($dbRecord)) { - $useMinMax = false; - if (isset($dbRecord['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecord['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::RECORD, $dbRecord, $comparison); - } - - /** - * Filter the query on the rebroadcast column - * - * @param int|array $dbRebroadcast 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 filterByDbRebroadcast($dbRebroadcast = null, $comparison = null) - { - if (is_array($dbRebroadcast)) { - $useMinMax = false; - if (isset($dbRebroadcast['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRebroadcast['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::REBROADCAST, $dbRebroadcast, $comparison); - } - - /** - * Filter the query on the instance_id column - * - * @param int|array $dbOriginalShow 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 filterByDbOriginalShow($dbOriginalShow = null, $comparison = null) - { - if (is_array($dbOriginalShow)) { - $useMinMax = false; - if (isset($dbOriginalShow['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbOriginalShow['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $dbOriginalShow, $comparison); - } - - /** - * Filter the query on the file_id column - * - * @param int|array $dbRecordedFile 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 filterByDbRecordedFile($dbRecordedFile = null, $comparison = null) - { - if (is_array($dbRecordedFile)) { - $useMinMax = false; - if (isset($dbRecordedFile['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbRecordedFile['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::FILE_ID, $dbRecordedFile, $comparison); - } - - /** - * Filter the query on the time_filled column - * - * @param string|array $dbTimeFilled 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 filterByDbTimeFilled($dbTimeFilled = null, $comparison = null) - { - if (is_array($dbTimeFilled)) { - $useMinMax = false; - if (isset($dbTimeFilled['min'])) { - $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbTimeFilled['max'])) { - $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowInstancesPeer::TIME_FILLED, $dbTimeFilled, $comparison); - } - - /** - * Filter the query on the modified_instance column - * - * @param boolean|string $dbModifiedInstance The value to use as filter. - * Accepts strings ('false', 'off', '-', 'no', 'n', and '0' are false, the rest is true) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByDbModifiedInstance($dbModifiedInstance = null, $comparison = null) - { - if (is_string($dbModifiedInstance)) { - $modified_instance = in_array(strtolower($dbModifiedInstance), array('false', 'off', '-', 'no', 'n', '0')) ? false : true; - } - return $this->addUsingAlias(CcShowInstancesPeer::MODIFIED_INSTANCE, $dbModifiedInstance, $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 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 CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByCcShowInstancesRelatedByDbOriginalShow($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::INSTANCE_ID, $ccShowInstances->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowInstancesRelatedByDbOriginalShow 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 joinCcShowInstancesRelatedByDbOriginalShow($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowInstancesRelatedByDbOriginalShow'); - - // 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, 'CcShowInstancesRelatedByDbOriginalShow'); - } - - return $this; - } - - /** - * Use the CcShowInstancesRelatedByDbOriginalShow 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 useCcShowInstancesRelatedByDbOriginalShowQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcShowInstancesRelatedByDbOriginalShow($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstancesRelatedByDbOriginalShow', 'CcShowInstancesQuery'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles 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 filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::FILE_ID, $ccFiles->getDbId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles 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 joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * 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 CcShowInstancesQuery The current query, for fluid interface - */ - public function filterByCcShowInstancesRelatedByDbId($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowInstancesPeer::ID, $ccShowInstances->getDbOriginalShow(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowInstancesRelatedByDbId 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 joinCcShowInstancesRelatedByDbId($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowInstancesRelatedByDbId'); - - // 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, 'CcShowInstancesRelatedByDbId'); - } - - return $this; - } - - /** - * Use the CcShowInstancesRelatedByDbId 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 useCcShowInstancesRelatedByDbIdQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcShowInstancesRelatedByDbId($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowInstancesRelatedByDbId', 'CcShowInstancesQuery'); - } - - /** - * 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 diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowPeer.php deleted file mode 100644 index 110c08101..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowPeer.php +++ /dev/null @@ -1,776 +0,0 @@ - array ('DbId', 'DbName', 'DbUrl', 'DbGenre', 'DbDescription', 'DbColor', 'DbBackgroundColor', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbUrl', 'dbGenre', 'dbDescription', 'dbColor', 'dbBackgroundColor', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::URL, self::GENRE, self::DESCRIPTION, self::COLOR, self::BACKGROUND_COLOR, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'URL', 'GENRE', 'DESCRIPTION', 'COLOR', 'BACKGROUND_COLOR', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'url', 'genre', 'description', 'color', 'background_color', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) - ); - - /** - * 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, 'DbName' => 1, 'DbUrl' => 2, 'DbGenre' => 3, 'DbDescription' => 4, 'DbColor' => 5, 'DbBackgroundColor' => 6, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbUrl' => 2, 'dbGenre' => 3, 'dbDescription' => 4, 'dbColor' => 5, 'dbBackgroundColor' => 6, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::URL => 2, self::GENRE => 3, self::DESCRIPTION => 4, self::COLOR => 5, self::BACKGROUND_COLOR => 6, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'URL' => 2, 'GENRE' => 3, 'DESCRIPTION' => 4, 'COLOR' => 5, 'BACKGROUND_COLOR' => 6, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'url' => 2, 'genre' => 3, 'description' => 4, 'color' => 5, 'background_color' => 6, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowPeer::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(CcShowPeer::ID); - $criteria->addSelectColumn(CcShowPeer::NAME); - $criteria->addSelectColumn(CcShowPeer::URL); - $criteria->addSelectColumn(CcShowPeer::GENRE); - $criteria->addSelectColumn(CcShowPeer::DESCRIPTION); - $criteria->addSelectColumn(CcShowPeer::COLOR); - $criteria->addSelectColumn(CcShowPeer::BACKGROUND_COLOR); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.NAME'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.GENRE'); - $criteria->addSelectColumn($alias . '.DESCRIPTION'); - $criteria->addSelectColumn($alias . '.COLOR'); - $criteria->addSelectColumn($alias . '.BACKGROUND_COLOR'); - } - } - - /** - * 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(CcShowPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowPeer::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(CcShowPeer::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 CcShow - * @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 = CcShowPeer::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 CcShowPeer::populateObjects(CcShowPeer::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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowPeer::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 CcShow $value A CcShow object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShow $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 CcShow object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShow) { - $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 CcShow 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 CcShow 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 - * by a foreign key with ON DELETE CASCADE - */ - 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, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowDaysPeer::clearInstancePool(); - // Invalidate objects in CcShowRebroadcastPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowRebroadcastPeer::clearInstancePool(); - // Invalidate objects in CcShowHostsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowHostsPeer::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 = CcShowPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowPeer::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; - CcShowPeer::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 (CcShow object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowPeer::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 + CcShowPeer::NUM_COLUMNS; - } else { - $cls = CcShowPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcShowPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowTableMap()); - } - } - - /** - * 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 ? CcShowPeer::CLASS_DEFAULT : CcShowPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShow or Criteria object. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShow object - } - - if ($criteria->containsKey(CcShowPeer::ID) && $criteria->keyContainsValue(CcShowPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowPeer::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 CcShow or Criteria object. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowPeer::ID); - $value = $criteria->remove(CcShowPeer::ID); - if ($value) { - $selectCriteria->add(CcShowPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowPeer::TABLE_NAME); - } - - } else { // $values is CcShow 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 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(CcShowPeer::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(CcShowPeer::TABLE_NAME, $con, CcShowPeer::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). - CcShowPeer::clearInstancePool(); - CcShowPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShow or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShow 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(CcShowPeer::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. - CcShowPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShow) { // it's a model object - // invalidate the cache for this single object - CcShowPeer::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(CcShowPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowPeer::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); - CcShowPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShow 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 CcShow $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(CcShow $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowPeer::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(CcShowPeer::DATABASE_NAME, CcShowPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShow - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $pk); - - $v = CcShowPeer::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(CcShowPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowPeer::DATABASE_NAME); - $criteria->add(CcShowPeer::ID, $pks, Criteria::IN); - $objs = CcShowPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowQuery.php deleted file mode 100644 index 10f9dac11..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowQuery.php +++ /dev/null @@ -1,593 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShow|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowPeer::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 CcShowQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowPeer::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 CcShowQuery 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(CcShowPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the name column - * - * @param string $dbName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbName($dbName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbName)) { - $dbName = str_replace('*', '%', $dbName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::NAME, $dbName, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $dbUrl The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbUrl($dbUrl = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbUrl)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbUrl)) { - $dbUrl = str_replace('*', '%', $dbUrl); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::URL, $dbUrl, $comparison); - } - - /** - * Filter the query on the genre column - * - * @param string $dbGenre The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbGenre($dbGenre = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbGenre)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbGenre)) { - $dbGenre = str_replace('*', '%', $dbGenre); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::GENRE, $dbGenre, $comparison); - } - - /** - * Filter the query on the description column - * - * @param string $dbDescription The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbDescription($dbDescription = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDescription)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDescription)) { - $dbDescription = str_replace('*', '%', $dbDescription); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::DESCRIPTION, $dbDescription, $comparison); - } - - /** - * Filter the query on the color column - * - * @param string $dbColor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbColor($dbColor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbColor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbColor)) { - $dbColor = str_replace('*', '%', $dbColor); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowPeer::COLOR, $dbColor, $comparison); - } - - /** - * Filter the query on the background_color column - * - * @param string $dbBackgroundColor The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowQuery The current query, for fluid interface - */ - public function filterByDbBackgroundColor($dbBackgroundColor = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbBackgroundColor)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbBackgroundColor)) { - $dbBackgroundColor = str_replace('*', '%', $dbBackgroundColor); - $comparison = Criteria::LIKE; - } - } - 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 - * - * @param CcShowDays $ccShowDays 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 filterByCcShowDays($ccShowDays, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowDays->getDbShowId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowDays 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 joinCcShowDays($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowDays'); - - // 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, 'CcShowDays'); - } - - return $this; - } - - /** - * Use the CcShowDays relation CcShowDays 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 CcShowDaysQuery A secondary query class using the current class as primary query - */ - public function useCcShowDaysQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowDays($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowDays', 'CcShowDaysQuery'); - } - - /** - * Filter the query by a related CcShowRebroadcast object - * - * @param CcShowRebroadcast $ccShowRebroadcast 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 filterByCcShowRebroadcast($ccShowRebroadcast, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowRebroadcast->getDbShowId(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowRebroadcast 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 joinCcShowRebroadcast($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowRebroadcast'); - - // 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, 'CcShowRebroadcast'); - } - - return $this; - } - - /** - * Use the CcShowRebroadcast relation CcShowRebroadcast 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 CcShowRebroadcastQuery A secondary query class using the current class as primary query - */ - public function useCcShowRebroadcastQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowRebroadcast($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowRebroadcast', 'CcShowRebroadcastQuery'); - } - - /** - * Filter the query by a related CcShowHosts object - * - * @param CcShowHosts $ccShowHosts 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 filterByCcShowHosts($ccShowHosts, $comparison = null) - { - return $this - ->addUsingAlias(CcShowPeer::ID, $ccShowHosts->getDbShow(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowHosts 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 joinCcShowHosts($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowHosts'); - - // 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, 'CcShowHosts'); - } - - return $this; - } - - /** - * Use the CcShowHosts relation CcShowHosts 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 CcShowHostsQuery A secondary query class using the current class as primary query - */ - public function useCcShowHostsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowHosts($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery'); - } - - /** - * Exclude object from result - * - * @param CcShow $ccShow Object to remove from the list of results - * - * @return CcShowQuery The current query, for fluid interface - */ - public function prune($ccShow = null) - { - if ($ccShow) { - $this->addUsingAlias(CcShowPeer::ID, $ccShow->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcast.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcast.php deleted file mode 100644 index aabd37d79..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcast.php +++ /dev/null @@ -1,957 +0,0 @@ -id; - } - - /** - * Get the [day_offset] column value. - * - * @return string - */ - public function getDbDayOffset() - { - return $this->day_offset; - } - - /** - * Get the [optionally formatted] temporal [start_time] 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 getDbStartTime($format = '%X') - { - if ($this->start_time === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start_time); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start_time, 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. - * - * @return int - */ - public function getDbShowId() - { - return $this->show_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [day_offset] column. - * - * @param string $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbDayOffset($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->day_offset !== $v) { - $this->day_offset = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::DAY_OFFSET; - } - - return $this; - } // setDbDayOffset() - - /** - * Sets the value of [start_time] 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 CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbStartTime($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->start_time !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start_time !== null && $tmpDt = new DateTime($this->start_time)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start_time = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowRebroadcastPeer::START_TIME; - } - } // if either are not null - - return $this; - } // setDbStartTime() - - /** - * Set the value of [show_id] column. - * - * @param int $v new value - * @return CcShowRebroadcast The current object (for fluent API support) - */ - public function setDbShowId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->show_id !== $v) { - $this->show_id = $v; - $this->modifiedColumns[] = CcShowRebroadcastPeer::SHOW_ID; - } - - if ($this->aCcShow !== null && $this->aCcShow->getDbId() !== $v) { - $this->aCcShow = null; - } - - return $this; - } // setDbShowId() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->day_offset = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->start_time = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->show_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowRebroadcast object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShow !== null && $this->show_id !== $this->aCcShow->getDbId()) { - $this->aCcShow = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowRebroadcastPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShow = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowRebroadcastQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowRebroadcastPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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->aCcShow !== null) { - if ($this->aCcShow->isModified() || $this->aCcShow->isNew()) { - $affectedRows += $this->aCcShow->save($con); - } - $this->setCcShow($this->aCcShow); - } - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcShowRebroadcastPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowRebroadcastPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowRebroadcastPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowRebroadcastPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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->aCcShow !== null) { - if (!$this->aCcShow->validate($columns)) { - $failureMap = array_merge($failureMap, $this->aCcShow->getValidationFailures()); - } - } - - - if (($retval = CcShowRebroadcastPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowRebroadcastPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbDayOffset(); - break; - case 2: - return $this->getDbStartTime(); - break; - case 3: - return $this->getDbShowId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowRebroadcastPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbDayOffset(), - $keys[2] => $this->getDbStartTime(), - $keys[3] => $this->getDbShowId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShow) { - $result['CcShow'] = $this->aCcShow->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowRebroadcastPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbDayOffset($value); - break; - case 2: - $this->setDbStartTime($value); - break; - case 3: - $this->setDbShowId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowRebroadcastPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbDayOffset($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbStartTime($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbShowId($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowRebroadcastPeer::ID)) $criteria->add(CcShowRebroadcastPeer::ID, $this->id); - if ($this->isColumnModified(CcShowRebroadcastPeer::DAY_OFFSET)) $criteria->add(CcShowRebroadcastPeer::DAY_OFFSET, $this->day_offset); - if ($this->isColumnModified(CcShowRebroadcastPeer::START_TIME)) $criteria->add(CcShowRebroadcastPeer::START_TIME, $this->start_time); - if ($this->isColumnModified(CcShowRebroadcastPeer::SHOW_ID)) $criteria->add(CcShowRebroadcastPeer::SHOW_ID, $this->show_id); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowRebroadcast (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbDayOffset($this->day_offset); - $copyObj->setDbStartTime($this->start_time); - $copyObj->setDbShowId($this->show_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowRebroadcast Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowRebroadcastPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowRebroadcastPeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShow object. - * - * @param CcShow $v - * @return CcShowRebroadcast The current object (for fluent API support) - * @throws PropelException - */ - public function setCcShow(CcShow $v = null) - { - if ($v === null) { - $this->setDbShowId(NULL); - } else { - $this->setDbShowId($v->getDbId()); - } - - $this->aCcShow = $v; - - // 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 ($v !== null) { - $v->addCcShowRebroadcast($this); - } - - return $this; - } - - - /** - * Get the associated CcShow object - * - * @param PropelPDO Optional Connection object. - * @return CcShow The associated CcShow object. - * @throws PropelException - */ - public function getCcShow(PropelPDO $con = null) - { - if ($this->aCcShow === null && ($this->show_id !== null)) { - $this->aCcShow = CcShowQuery::create()->findPk($this->show_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->aCcShow->addCcShowRebroadcasts($this); - */ - } - return $this->aCcShow; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->day_offset = null; - $this->start_time = null; - $this->show_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShow = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowRebroadcast diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastPeer.php deleted file mode 100644 index ef0434c70..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastPeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('DbId', 'DbDayOffset', 'DbStartTime', 'DbShowId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbDayOffset', 'dbStartTime', 'dbShowId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::DAY_OFFSET, self::START_TIME, self::SHOW_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'DAY_OFFSET', 'START_TIME', 'SHOW_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'day_offset', 'start_time', '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, 'DbDayOffset' => 1, 'DbStartTime' => 2, 'DbShowId' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbDayOffset' => 1, 'dbStartTime' => 2, 'dbShowId' => 3, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::DAY_OFFSET => 1, self::START_TIME => 2, self::SHOW_ID => 3, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'DAY_OFFSET' => 1, 'START_TIME' => 2, 'SHOW_ID' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'day_offset' => 1, 'start_time' => 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowRebroadcastPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::ID); - $criteria->addSelectColumn(CcShowRebroadcastPeer::DAY_OFFSET); - $criteria->addSelectColumn(CcShowRebroadcastPeer::START_TIME); - $criteria->addSelectColumn(CcShowRebroadcastPeer::SHOW_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.DAY_OFFSET'); - $criteria->addSelectColumn($alias . '.START_TIME'); - $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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::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 CcShowRebroadcast - * @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 = CcShowRebroadcastPeer::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 CcShowRebroadcastPeer::populateObjects(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowRebroadcastPeer::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 CcShowRebroadcast $value A CcShowRebroadcast object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowRebroadcast $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 CcShowRebroadcast object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowRebroadcast) { - $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 CcShowRebroadcast 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 CcShowRebroadcast 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_rebroadcast - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowRebroadcastPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowRebroadcastPeer::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; - CcShowRebroadcastPeer::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 (CcShowRebroadcast object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowRebroadcastPeer::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 + CcShowRebroadcastPeer::NUM_COLUMNS; - } else { - $cls = CcShowRebroadcastPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowRebroadcastPeer::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 CcShowRebroadcast 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 CcShowRebroadcast 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); - } - - CcShowRebroadcastPeer::addSelectColumns($criteria); - $startcol = (CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS); - CcShowPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowRebroadcastPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowRebroadcastPeer::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 = CcShowRebroadcastPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowRebroadcastPeer::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 (CcShowRebroadcast) to $obj2 (CcShow) - $obj2->addCcShowRebroadcast($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(CcShowRebroadcastPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowRebroadcastPeer::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 CcShowRebroadcast 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 CcShowRebroadcast 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); - } - - CcShowRebroadcastPeer::addSelectColumns($criteria); - $startcol2 = (CcShowRebroadcastPeer::NUM_COLUMNS - CcShowRebroadcastPeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowPeer::NUM_COLUMNS - CcShowPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowRebroadcastPeer::SHOW_ID, CcShowPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowRebroadcastPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowRebroadcastPeer::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 = CcShowRebroadcastPeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowRebroadcastPeer::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 (CcShowRebroadcast) to the collection in $obj2 (CcShow) - $obj2->addCcShowRebroadcast($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(BaseCcShowRebroadcastPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowRebroadcastPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowRebroadcastTableMap()); - } - } - - /** - * 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 ? CcShowRebroadcastPeer::CLASS_DEFAULT : CcShowRebroadcastPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowRebroadcast or Criteria object. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowRebroadcast object - } - - if ($criteria->containsKey(CcShowRebroadcastPeer::ID) && $criteria->keyContainsValue(CcShowRebroadcastPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowRebroadcastPeer::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 CcShowRebroadcast or Criteria object. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowRebroadcastPeer::ID); - $value = $criteria->remove(CcShowRebroadcastPeer::ID); - if ($value) { - $selectCriteria->add(CcShowRebroadcastPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowRebroadcastPeer::TABLE_NAME); - } - - } else { // $values is CcShowRebroadcast 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_rebroadcast 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(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::TABLE_NAME, $con, CcShowRebroadcastPeer::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). - CcShowRebroadcastPeer::clearInstancePool(); - CcShowRebroadcastPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowRebroadcast or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowRebroadcast 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(CcShowRebroadcastPeer::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. - CcShowRebroadcastPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowRebroadcast) { // it's a model object - // invalidate the cache for this single object - CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowRebroadcastPeer::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); - CcShowRebroadcastPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowRebroadcast 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 CcShowRebroadcast $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(CcShowRebroadcast $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowRebroadcastPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, CcShowRebroadcastPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowRebroadcast - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowRebroadcastPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $pk); - - $v = CcShowRebroadcastPeer::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(CcShowRebroadcastPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowRebroadcastPeer::DATABASE_NAME); - $criteria->add(CcShowRebroadcastPeer::ID, $pks, Criteria::IN); - $objs = CcShowRebroadcastPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowRebroadcastPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowRebroadcastPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastQuery.php deleted file mode 100644 index d7fedf8e9..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowRebroadcastQuery.php +++ /dev/null @@ -1,329 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowRebroadcast|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowRebroadcastPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery 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(CcShowRebroadcastPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the day_offset column - * - * @param string $dbDayOffset The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByDbDayOffset($dbDayOffset = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbDayOffset)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbDayOffset)) { - $dbDayOffset = str_replace('*', '%', $dbDayOffset); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::DAY_OFFSET, $dbDayOffset, $comparison); - } - - /** - * Filter the query on the start_time column - * - * @param string|array $dbStartTime 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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByDbStartTime($dbStartTime = null, $comparison = null) - { - if (is_array($dbStartTime)) { - $useMinMax = false; - if (isset($dbStartTime['min'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbStartTime['max'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::START_TIME, $dbStartTime, $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 CcShowRebroadcastQuery 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(CcShowRebroadcastPeer::SHOW_ID, $dbShowId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbShowId['max'])) { - $this->addUsingAlias(CcShowRebroadcastPeer::SHOW_ID, $dbShowId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery The current query, for fluid interface - */ - public function filterByCcShow($ccShow, $comparison = null) - { - return $this - ->addUsingAlias(CcShowRebroadcastPeer::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 CcShowRebroadcastQuery 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'); - } - - /** - * Exclude object from result - * - * @param CcShowRebroadcast $ccShowRebroadcast Object to remove from the list of results - * - * @return CcShowRebroadcastQuery The current query, for fluid interface - */ - public function prune($ccShowRebroadcast = null) - { - if ($ccShowRebroadcast) { - $this->addUsingAlias(CcShowRebroadcastPeer::ID, $ccShowRebroadcast->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowRebroadcastQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedule.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedule.php deleted file mode 100644 index bf8b384e6..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedule.php +++ /dev/null @@ -1,905 +0,0 @@ -id; - } - - /** - * Get the [instance_id] column value. - * - * @return int - */ - public function getDbInstanceId() - { - return $this->instance_id; - } - - /** - * Get the [position] column value. - * - * @return int - */ - public function getDbPosition() - { - return $this->position; - } - - /** - * Get the [group_id] column value. - * - * @return int - */ - public function getDbGroupId() - { - return $this->group_id; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [instance_id] column. - * - * @param int $v new value - * @return CcShowSchedule 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[] = CcShowSchedulePeer::INSTANCE_ID; - } - - if ($this->aCcShowInstances !== null && $this->aCcShowInstances->getDbId() !== $v) { - $this->aCcShowInstances = null; - } - - return $this; - } // setDbInstanceId() - - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::POSITION; - } - - return $this; - } // setDbPosition() - - /** - * Set the value of [group_id] column. - * - * @param int $v new value - * @return CcShowSchedule The current object (for fluent API support) - */ - public function setDbGroupId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->group_id !== $v) { - $this->group_id = $v; - $this->modifiedColumns[] = CcShowSchedulePeer::GROUP_ID; - } - - return $this; - } // setDbGroupId() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->instance_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->position = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->group_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 4; // 4 = CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcShowSchedule object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - if ($this->aCcShowInstances !== null && $this->instance_id !== $this->aCcShowInstances->getDbId()) { - $this->aCcShowInstances = null; - } - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcShowSchedulePeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->aCcShowInstances = null; - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcShowScheduleQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcShowSchedulePeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $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[] = CcShowSchedulePeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcShowSchedulePeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowSchedulePeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows += 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows += CcShowSchedulePeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $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 = CcShowSchedulePeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbInstanceId(); - break; - case 2: - return $this->getDbPosition(); - break; - case 3: - return $this->getDbGroupId(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @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 - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $includeForeignObjects = false) - { - $keys = CcShowSchedulePeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbInstanceId(), - $keys[2] => $this->getDbPosition(), - $keys[3] => $this->getDbGroupId(), - ); - if ($includeForeignObjects) { - if (null !== $this->aCcShowInstances) { - $result['CcShowInstances'] = $this->aCcShowInstances->toArray($keyType, $includeLazyLoadColumns, true); - } - } - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcShowSchedulePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbInstanceId($value); - break; - case 2: - $this->setDbPosition($value); - break; - case 3: - $this->setDbGroupId($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcShowSchedulePeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbInstanceId($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbPosition($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbGroupId($arr[$keys[3]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - - if ($this->isColumnModified(CcShowSchedulePeer::ID)) $criteria->add(CcShowSchedulePeer::ID, $this->id); - if ($this->isColumnModified(CcShowSchedulePeer::INSTANCE_ID)) $criteria->add(CcShowSchedulePeer::INSTANCE_ID, $this->instance_id); - 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); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcShowSchedule (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbInstanceId($this->instance_id); - $copyObj->setDbPosition($this->position); - $copyObj->setDbGroupId($this->group_id); - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcShowSchedule Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcShowSchedulePeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcShowSchedulePeer(); - } - return self::$peer; - } - - /** - * Declares an association between this object and a CcShowInstances object. - * - * @param CcShowInstances $v - * @return CcShowSchedule 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->addCcShowSchedule($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->addCcShowSchedules($this); - */ - } - return $this->aCcShowInstances; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->instance_id = null; - $this->position = null; - $this->group_id = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - $this->aCcShowInstances = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcShowSchedule diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedulePeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedulePeer.php deleted file mode 100644 index 677ff8447..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowSchedulePeer.php +++ /dev/null @@ -1,983 +0,0 @@ - array ('DbId', 'DbInstanceId', 'DbPosition', 'DbGroupId', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbInstanceId', 'dbPosition', 'dbGroupId', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::INSTANCE_ID, self::POSITION, self::GROUP_ID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'INSTANCE_ID', 'POSITION', 'GROUP_ID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'instance_id', 'position', 'group_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, 'DbInstanceId' => 1, 'DbPosition' => 2, 'DbGroupId' => 3, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbInstanceId' => 1, 'dbPosition' => 2, 'dbGroupId' => 3, ), - 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, 'INSTANCE_ID' => 1, 'POSITION' => 2, 'GROUP_ID' => 3, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'instance_id' => 1, 'position' => 2, 'group_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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcShowSchedulePeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcShowSchedulePeer::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(CcShowSchedulePeer::ID); - $criteria->addSelectColumn(CcShowSchedulePeer::INSTANCE_ID); - $criteria->addSelectColumn(CcShowSchedulePeer::POSITION); - $criteria->addSelectColumn(CcShowSchedulePeer::GROUP_ID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.INSTANCE_ID'); - $criteria->addSelectColumn($alias . '.POSITION'); - $criteria->addSelectColumn($alias . '.GROUP_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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::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 CcShowSchedule - * @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 = CcShowSchedulePeer::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 CcShowSchedulePeer::populateObjects(CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcShowSchedulePeer::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 CcShowSchedule $value A CcShowSchedule object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcShowSchedule $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 CcShowSchedule object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcShowSchedule) { - $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 CcShowSchedule 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 CcShowSchedule 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_schedule - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcShowSchedulePeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcShowSchedulePeer::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; - CcShowSchedulePeer::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 (CcShowSchedule object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcShowSchedulePeer::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 + CcShowSchedulePeer::NUM_COLUMNS; - } else { - $cls = CcShowSchedulePeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcShowSchedulePeer::addInstanceToPool($obj, $key); - } - 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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowSchedulePeer::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 CcShowSchedule 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 CcShowSchedule 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); - } - - CcShowSchedulePeer::addSelectColumns($criteria); - $startcol = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - CcShowInstancesPeer::addSelectColumns($criteria); - - $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowSchedulePeer::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 = CcShowSchedulePeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowSchedulePeer::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 (CcShowSchedule) to $obj2 (CcShowInstances) - $obj2->addCcShowSchedule($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(CcShowSchedulePeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria->addJoin(CcShowSchedulePeer::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 CcShowSchedule 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 CcShowSchedule 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); - } - - CcShowSchedulePeer::addSelectColumns($criteria); - $startcol2 = (CcShowSchedulePeer::NUM_COLUMNS - CcShowSchedulePeer::NUM_LAZY_LOAD_COLUMNS); - - CcShowInstancesPeer::addSelectColumns($criteria); - $startcol3 = $startcol2 + (CcShowInstancesPeer::NUM_COLUMNS - CcShowInstancesPeer::NUM_LAZY_LOAD_COLUMNS); - - $criteria->addJoin(CcShowSchedulePeer::INSTANCE_ID, CcShowInstancesPeer::ID, $join_behavior); - - $stmt = BasePeer::doSelect($criteria, $con); - $results = array(); - - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key1 = CcShowSchedulePeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj1 = CcShowSchedulePeer::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 = CcShowSchedulePeer::getOMClass(false); - - $obj1 = new $cls(); - $obj1->hydrate($row); - CcShowSchedulePeer::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 (CcShowSchedule) to the collection in $obj2 (CcShowInstances) - $obj2->addCcShowSchedule($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(BaseCcShowSchedulePeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcShowSchedulePeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcShowScheduleTableMap()); - } - } - - /** - * 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 ? CcShowSchedulePeer::CLASS_DEFAULT : CcShowSchedulePeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcShowSchedule or Criteria object. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcShowSchedule object - } - - if ($criteria->containsKey(CcShowSchedulePeer::ID) && $criteria->keyContainsValue(CcShowSchedulePeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcShowSchedulePeer::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 CcShowSchedule or Criteria object. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcShowSchedulePeer::ID); - $value = $criteria->remove(CcShowSchedulePeer::ID); - if ($value) { - $selectCriteria->add(CcShowSchedulePeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcShowSchedulePeer::TABLE_NAME); - } - - } else { // $values is CcShowSchedule 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_schedule 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(CcShowSchedulePeer::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(CcShowSchedulePeer::TABLE_NAME, $con, CcShowSchedulePeer::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). - CcShowSchedulePeer::clearInstancePool(); - CcShowSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcShowSchedule or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcShowSchedule 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(CcShowSchedulePeer::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. - CcShowSchedulePeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcShowSchedule) { // it's a model object - // invalidate the cache for this single object - CcShowSchedulePeer::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(CcShowSchedulePeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcShowSchedulePeer::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); - CcShowSchedulePeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcShowSchedule 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 CcShowSchedule $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(CcShowSchedule $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcShowSchedulePeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, CcShowSchedulePeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcShowSchedule - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcShowSchedulePeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $pk); - - $v = CcShowSchedulePeer::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(CcShowSchedulePeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcShowSchedulePeer::DATABASE_NAME); - $criteria->add(CcShowSchedulePeer::ID, $pks, Criteria::IN); - $objs = CcShowSchedulePeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcShowSchedulePeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcShowSchedulePeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowScheduleQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowScheduleQuery.php deleted file mode 100644 index 2cb1b65c8..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcShowScheduleQuery.php +++ /dev/null @@ -1,338 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcShowSchedule|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcShowSchedulePeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery 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(CcShowSchedulePeer::ID, $dbId, $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 CcShowScheduleQuery 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(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbInstanceId['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::INSTANCE_ID, $dbInstanceId, $comparison); - } - - /** - * Filter the query on the position column - * - * @param int|array $dbPosition The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByDbPosition($dbPosition = null, $comparison = null) - { - if (is_array($dbPosition)) { - $useMinMax = false; - if (isset($dbPosition['min'])) { - $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbPosition['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::POSITION, $dbPosition, $comparison); - } - - /** - * Filter the query on the group_id column - * - * @param int|array $dbGroupId 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 filterByDbGroupId($dbGroupId = null, $comparison = null) - { - if (is_array($dbGroupId)) { - $useMinMax = false; - if (isset($dbGroupId['min'])) { - $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbGroupId['max'])) { - $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcShowSchedulePeer::GROUP_ID, $dbGroupId, $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 CcShowScheduleQuery The current query, for fluid interface - */ - public function filterByCcShowInstances($ccShowInstances, $comparison = null) - { - return $this - ->addUsingAlias(CcShowSchedulePeer::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 CcShowScheduleQuery 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 - * - * @param CcShowSchedule $ccShowSchedule Object to remove from the list of results - * - * @return CcShowScheduleQuery The current query, for fluid interface - */ - public function prune($ccShowSchedule = null) - { - if ($ccShowSchedule) { - $this->addUsingAlias(CcShowSchedulePeer::ID, $ccShowSchedule->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcShowScheduleQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmemb.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmemb.php deleted file mode 100644 index 7fc4dbc9b..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmemb.php +++ /dev/null @@ -1,891 +0,0 @@ -uid = 0; - $this->gid = 0; - $this->level = 0; - } - - /** - * Initializes internal state of BaseCcSmemb object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [uid] column value. - * - * @return int - */ - public function getUid() - { - return $this->uid; - } - - /** - * Get the [gid] column value. - * - * @return int - */ - public function getGid() - { - return $this->gid; - } - - /** - * Get the [level] column value. - * - * @return int - */ - public function getLevel() - { - return $this->level; - } - - /** - * Get the [mid] column value. - * - * @return int - */ - public function getMid() - { - return $this->mid; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSmembPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [uid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setUid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->uid !== $v || $this->isNew()) { - $this->uid = $v; - $this->modifiedColumns[] = CcSmembPeer::UID; - } - - return $this; - } // setUid() - - /** - * Set the value of [gid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setGid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->gid !== $v || $this->isNew()) { - $this->gid = $v; - $this->modifiedColumns[] = CcSmembPeer::GID; - } - - return $this; - } // setGid() - - /** - * Set the value of [level] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setLevel($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->level !== $v || $this->isNew()) { - $this->level = $v; - $this->modifiedColumns[] = CcSmembPeer::LEVEL; - } - - return $this; - } // setLevel() - - /** - * Set the value of [mid] column. - * - * @param int $v new value - * @return CcSmemb The current object (for fluent API support) - */ - public function setMid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->mid !== $v) { - $this->mid = $v; - $this->modifiedColumns[] = CcSmembPeer::MID; - } - - return $this; - } // setMid() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->uid !== 0) { - return false; - } - - if ($this->gid !== 0) { - return false; - } - - if ($this->level !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->uid = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null; - $this->gid = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null; - $this->level = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null; - $this->mid = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 5; // 5 = CcSmembPeer::NUM_COLUMNS - CcSmembPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSmemb object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSmembPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSmembQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSmembPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcSmembPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcSmembPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getUid(); - break; - case 2: - return $this->getGid(); - break; - case 3: - return $this->getLevel(); - break; - case 4: - return $this->getMid(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcSmembPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getUid(), - $keys[2] => $this->getGid(), - $keys[3] => $this->getLevel(), - $keys[4] => $this->getMid(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSmembPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setUid($value); - break; - case 2: - $this->setGid($value); - break; - case 3: - $this->setLevel($value); - break; - case 4: - $this->setMid($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSmembPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setUid($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setGid($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setLevel($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setMid($arr[$keys[4]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSmembPeer::ID)) $criteria->add(CcSmembPeer::ID, $this->id); - if ($this->isColumnModified(CcSmembPeer::UID)) $criteria->add(CcSmembPeer::UID, $this->uid); - if ($this->isColumnModified(CcSmembPeer::GID)) $criteria->add(CcSmembPeer::GID, $this->gid); - if ($this->isColumnModified(CcSmembPeer::LEVEL)) $criteria->add(CcSmembPeer::LEVEL, $this->level); - if ($this->isColumnModified(CcSmembPeer::MID)) $criteria->add(CcSmembPeer::MID, $this->mid); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSmemb (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setId($this->id); - $copyObj->setUid($this->uid); - $copyObj->setGid($this->gid); - $copyObj->setLevel($this->level); - $copyObj->setMid($this->mid); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSmemb Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSmembPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSmembPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->uid = null; - $this->gid = null; - $this->level = null; - $this->mid = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSmemb diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembPeer.php deleted file mode 100644 index 849c13423..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembPeer.php +++ /dev/null @@ -1,750 +0,0 @@ - array ('Id', 'Uid', 'Gid', 'Level', 'Mid', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'uid', 'gid', 'level', 'mid', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::UID, self::GID, self::LEVEL, self::MID, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'UID', 'GID', 'LEVEL', 'MID', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'uid', 'gid', 'level', 'mid', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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 ('Id' => 0, 'Uid' => 1, 'Gid' => 2, 'Level' => 3, 'Mid' => 4, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 4, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::UID => 1, self::GID => 2, self::LEVEL => 3, self::MID => 4, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'UID' => 1, 'GID' => 2, 'LEVEL' => 3, 'MID' => 4, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'uid' => 1, 'gid' => 2, 'level' => 3, 'mid' => 4, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSmembPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSmembPeer::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(CcSmembPeer::ID); - $criteria->addSelectColumn(CcSmembPeer::UID); - $criteria->addSelectColumn(CcSmembPeer::GID); - $criteria->addSelectColumn(CcSmembPeer::LEVEL); - $criteria->addSelectColumn(CcSmembPeer::MID); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.UID'); - $criteria->addSelectColumn($alias . '.GID'); - $criteria->addSelectColumn($alias . '.LEVEL'); - $criteria->addSelectColumn($alias . '.MID'); - } - } - - /** - * 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(CcSmembPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSmembPeer::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(CcSmembPeer::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 CcSmemb - * @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 = CcSmembPeer::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 CcSmembPeer::populateObjects(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSmembPeer::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 CcSmemb $value A CcSmemb object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSmemb $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcSmemb object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSmemb) { - $key = (string) $value->getId(); - } 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 CcSmemb 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 CcSmemb 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_smemb - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcSmembPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSmembPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSmembPeer::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; - CcSmembPeer::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 (CcSmemb object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSmembPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSmembPeer::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 + CcSmembPeer::NUM_COLUMNS; - } else { - $cls = CcSmembPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSmembPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcSmembPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSmembPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSmembTableMap()); - } - } - - /** - * 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 ? CcSmembPeer::CLASS_DEFAULT : CcSmembPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSmemb or Criteria object. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSmemb object - } - - - // 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 CcSmemb or Criteria object. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSmembPeer::ID); - $value = $criteria->remove(CcSmembPeer::ID); - if ($value) { - $selectCriteria->add(CcSmembPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSmembPeer::TABLE_NAME); - } - - } else { // $values is CcSmemb 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_smemb 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(CcSmembPeer::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(CcSmembPeer::TABLE_NAME, $con, CcSmembPeer::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). - CcSmembPeer::clearInstancePool(); - CcSmembPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSmemb or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSmemb 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(CcSmembPeer::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. - CcSmembPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSmemb) { // it's a model object - // invalidate the cache for this single object - CcSmembPeer::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(CcSmembPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSmembPeer::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); - CcSmembPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSmemb 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 CcSmemb $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(CcSmemb $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSmembPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, CcSmembPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSmemb - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSmembPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $pk); - - $v = CcSmembPeer::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(CcSmembPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSmembPeer::DATABASE_NAME); - $criteria->add(CcSmembPeer::ID, $pks, Criteria::IN); - $objs = CcSmembPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSmembPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSmembPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembQuery.php deleted file mode 100644 index 06b24502c..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSmembQuery.php +++ /dev/null @@ -1,305 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSmemb|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSmembPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSmembQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSmembPeer::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 CcSmembQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSmembPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcSmembQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcSmembPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the uid column - * - * @param int|array $uid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByUid($uid = null, $comparison = null) - { - if (is_array($uid)) { - $useMinMax = false; - if (isset($uid['min'])) { - $this->addUsingAlias(CcSmembPeer::UID, $uid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($uid['max'])) { - $this->addUsingAlias(CcSmembPeer::UID, $uid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::UID, $uid, $comparison); - } - - /** - * Filter the query on the gid column - * - * @param int|array $gid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByGid($gid = null, $comparison = null) - { - if (is_array($gid)) { - $useMinMax = false; - if (isset($gid['min'])) { - $this->addUsingAlias(CcSmembPeer::GID, $gid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($gid['max'])) { - $this->addUsingAlias(CcSmembPeer::GID, $gid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::GID, $gid, $comparison); - } - - /** - * Filter the query on the level column - * - * @param int|array $level 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByLevel($level = null, $comparison = null) - { - if (is_array($level)) { - $useMinMax = false; - if (isset($level['min'])) { - $this->addUsingAlias(CcSmembPeer::LEVEL, $level['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($level['max'])) { - $this->addUsingAlias(CcSmembPeer::LEVEL, $level['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::LEVEL, $level, $comparison); - } - - /** - * Filter the query on the mid column - * - * @param int|array $mid 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 CcSmembQuery The current query, for fluid interface - */ - public function filterByMid($mid = null, $comparison = null) - { - if (is_array($mid)) { - $useMinMax = false; - if (isset($mid['min'])) { - $this->addUsingAlias(CcSmembPeer::MID, $mid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($mid['max'])) { - $this->addUsingAlias(CcSmembPeer::MID, $mid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSmembPeer::MID, $mid, $comparison); - } - - /** - * Exclude object from result - * - * @param CcSmemb $ccSmemb Object to remove from the list of results - * - * @return CcSmembQuery The current query, for fluid interface - */ - public function prune($ccSmemb = null) - { - if ($ccSmemb) { - $this->addUsingAlias(CcSmembPeer::ID, $ccSmemb->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSmembQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSetting.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSetting.php deleted file mode 100644 index 6dadc9b67..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSetting.php +++ /dev/null @@ -1,756 +0,0 @@ -keyname; - } - - /** - * Get the [value] column value. - * - * @return string - */ - public function getDbValue() - { - return $this->value; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getDbType() - { - return $this->type; - } - - /** - * Set the value of [keyname] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbKeyName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->keyname !== $v) { - $this->keyname = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::KEYNAME; - } - - return $this; - } // setDbKeyName() - - /** - * Set the value of [value] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbValue($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->value !== $v) { - $this->value = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::VALUE; - } - - return $this; - } // setDbValue() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcStreamSetting The current object (for fluent API support) - */ - public function setDbType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v) { - $this->type = $v; - $this->modifiedColumns[] = CcStreamSettingPeer::TYPE; - } - - return $this; - } // setDbType() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->keyname = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null; - $this->value = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->type = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 3; // 3 = CcStreamSettingPeer::NUM_COLUMNS - CcStreamSettingPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcStreamSetting object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcStreamSettingPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcStreamSettingQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcStreamSettingPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setNew(false); - } else { - $affectedRows = CcStreamSettingPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcStreamSettingPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbKeyName(); - break; - case 1: - return $this->getDbValue(); - break; - case 2: - return $this->getDbType(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcStreamSettingPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbKeyName(), - $keys[1] => $this->getDbValue(), - $keys[2] => $this->getDbType(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcStreamSettingPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbKeyName($value); - break; - case 1: - $this->setDbValue($value); - break; - case 2: - $this->setDbType($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcStreamSettingPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbKeyName($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbValue($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbType($arr[$keys[2]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcStreamSettingPeer::KEYNAME)) $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname); - if ($this->isColumnModified(CcStreamSettingPeer::VALUE)) $criteria->add(CcStreamSettingPeer::VALUE, $this->value); - if ($this->isColumnModified(CcStreamSettingPeer::TYPE)) $criteria->add(CcStreamSettingPeer::TYPE, $this->type); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $this->keyname); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return string - */ - public function getPrimaryKey() - { - return $this->getDbKeyName(); - } - - /** - * Generic method to set the primary key (keyname column). - * - * @param string $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbKeyName($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbKeyName(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcStreamSetting (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbKeyName($this->keyname); - $copyObj->setDbValue($this->value); - $copyObj->setDbType($this->type); - - $copyObj->setNew(true); - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcStreamSetting Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcStreamSettingPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcStreamSettingPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->keyname = null; - $this->value = null; - $this->type = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcStreamSetting diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingPeer.php deleted file mode 100644 index f5e680b20..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingPeer.php +++ /dev/null @@ -1,740 +0,0 @@ - array ('DbKeyName', 'DbValue', 'DbType', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbKeyName', 'dbValue', 'dbType', ), - BasePeer::TYPE_COLNAME => array (self::KEYNAME, self::VALUE, self::TYPE, ), - BasePeer::TYPE_RAW_COLNAME => array ('KEYNAME', 'VALUE', 'TYPE', ), - BasePeer::TYPE_FIELDNAME => array ('keyname', 'value', 'type', ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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 ('DbKeyName' => 0, 'DbValue' => 1, 'DbType' => 2, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbKeyName' => 0, 'dbValue' => 1, 'dbType' => 2, ), - BasePeer::TYPE_COLNAME => array (self::KEYNAME => 0, self::VALUE => 1, self::TYPE => 2, ), - BasePeer::TYPE_RAW_COLNAME => array ('KEYNAME' => 0, 'VALUE' => 1, 'TYPE' => 2, ), - BasePeer::TYPE_FIELDNAME => array ('keyname' => 0, 'value' => 1, 'type' => 2, ), - BasePeer::TYPE_NUM => array (0, 1, 2, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcStreamSettingPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcStreamSettingPeer::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(CcStreamSettingPeer::KEYNAME); - $criteria->addSelectColumn(CcStreamSettingPeer::VALUE); - $criteria->addSelectColumn(CcStreamSettingPeer::TYPE); - } else { - $criteria->addSelectColumn($alias . '.KEYNAME'); - $criteria->addSelectColumn($alias . '.VALUE'); - $criteria->addSelectColumn($alias . '.TYPE'); - } - } - - /** - * 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(CcStreamSettingPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcStreamSettingPeer::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(CcStreamSettingPeer::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 CcStreamSetting - * @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 = CcStreamSettingPeer::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 CcStreamSettingPeer::populateObjects(CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcStreamSettingPeer::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 CcStreamSetting $value A CcStreamSetting object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcStreamSetting $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getDbKeyName(); - } // 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 CcStreamSetting object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcStreamSetting) { - $key = (string) $value->getDbKeyName(); - } 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 CcStreamSetting 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 CcStreamSetting 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_stream_setting - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 (string) $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 = CcStreamSettingPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcStreamSettingPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcStreamSettingPeer::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; - CcStreamSettingPeer::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 (CcStreamSetting object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcStreamSettingPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcStreamSettingPeer::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 + CcStreamSettingPeer::NUM_COLUMNS; - } else { - $cls = CcStreamSettingPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcStreamSettingPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcStreamSettingPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcStreamSettingPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcStreamSettingTableMap()); - } - } - - /** - * 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 ? CcStreamSettingPeer::CLASS_DEFAULT : CcStreamSettingPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcStreamSetting or Criteria object. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcStreamSetting object - } - - - // 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 CcStreamSetting or Criteria object. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcStreamSettingPeer::KEYNAME); - $value = $criteria->remove(CcStreamSettingPeer::KEYNAME); - if ($value) { - $selectCriteria->add(CcStreamSettingPeer::KEYNAME, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcStreamSettingPeer::TABLE_NAME); - } - - } else { // $values is CcStreamSetting 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_stream_setting 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(CcStreamSettingPeer::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(CcStreamSettingPeer::TABLE_NAME, $con, CcStreamSettingPeer::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). - CcStreamSettingPeer::clearInstancePool(); - CcStreamSettingPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcStreamSetting or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcStreamSetting 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(CcStreamSettingPeer::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. - CcStreamSettingPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcStreamSetting) { // it's a model object - // invalidate the cache for this single object - CcStreamSettingPeer::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(CcStreamSettingPeer::KEYNAME, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcStreamSettingPeer::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); - CcStreamSettingPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcStreamSetting 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 CcStreamSetting $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(CcStreamSetting $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcStreamSettingPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, CcStreamSettingPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param string $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcStreamSetting - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcStreamSettingPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $pk); - - $v = CcStreamSettingPeer::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(CcStreamSettingPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcStreamSettingPeer::DATABASE_NAME); - $criteria->add(CcStreamSettingPeer::KEYNAME, $pks, Criteria::IN); - $objs = CcStreamSettingPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcStreamSettingPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcStreamSettingPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingQuery.php deleted file mode 100644 index 666106d6f..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcStreamSettingQuery.php +++ /dev/null @@ -1,222 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcStreamSetting|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcStreamSettingPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $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 CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $keys, Criteria::IN); - } - - /** - * Filter the query on the keyname column - * - * @param string $dbKeyName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbKeyName($dbKeyName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbKeyName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbKeyName)) { - $dbKeyName = str_replace('*', '%', $dbKeyName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $dbKeyName, $comparison); - } - - /** - * Filter the query on the value column - * - * @param string $dbValue The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbValue($dbValue = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbValue)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbValue)) { - $dbValue = str_replace('*', '%', $dbValue); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::VALUE, $dbValue, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $dbType The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function filterByDbType($dbType = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbType)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbType)) { - $dbType = str_replace('*', '%', $dbType); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcStreamSettingPeer::TYPE, $dbType, $comparison); - } - - /** - * Exclude object from result - * - * @param CcStreamSetting $ccStreamSetting Object to remove from the list of results - * - * @return CcStreamSettingQuery The current query, for fluid interface - */ - public function prune($ccStreamSetting = null) - { - if ($ccStreamSetting) { - $this->addUsingAlias(CcStreamSettingPeer::KEYNAME, $ccStreamSetting->getDbKeyName(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcStreamSettingQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjs.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjs.php deleted file mode 100644 index 54a0468ce..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjs.php +++ /dev/null @@ -1,2423 +0,0 @@ -login = ''; - $this->pass = ''; - $this->type = 'U'; - $this->first_name = ''; - $this->last_name = ''; - $this->login_attempts = 0; - } - - /** - * Initializes internal state of BaseCcSubjs object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getDbId() - { - return $this->id; - } - - /** - * Get the [login] column value. - * - * @return string - */ - public function getDbLogin() - { - return $this->login; - } - - /** - * Get the [pass] column value. - * - * @return string - */ - public function getDbPass() - { - return $this->pass; - } - - /** - * Get the [type] column value. - * - * @return string - */ - public function getDbType() - { - return $this->type; - } - - /** - * Get the [first_name] column value. - * - * @return string - */ - public function getDbFirstName() - { - return $this->first_name; - } - - /** - * Get the [last_name] column value. - * - * @return string - */ - public function getDbLastName() - { - return $this->last_name; - } - - /** - * Get the [optionally formatted] temporal [lastlogin] 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 getDbLastlogin($format = 'Y-m-d H:i:s') - { - if ($this->lastlogin === null) { - return null; - } - - - - try { - $dt = new DateTime($this->lastlogin); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastlogin, 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 [optionally formatted] temporal [lastfail] 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 getDbLastfail($format = 'Y-m-d H:i:s') - { - if ($this->lastfail === null) { - return null; - } - - - - try { - $dt = new DateTime($this->lastfail); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->lastfail, 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 [skype_contact] column value. - * - * @return string - */ - public function getDbSkypeContact() - { - return $this->skype_contact; - } - - /** - * Get the [jabber_contact] column value. - * - * @return string - */ - public function getDbJabberContact() - { - return $this->jabber_contact; - } - - /** - * Get the [email] column value. - * - * @return string - */ - public function getDbEmail() - { - return $this->email; - } - - /** - * Get the [login_attempts] column value. - * - * @return int - */ - public function getDbLoginAttempts() - { - return $this->login_attempts; - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcSubjsPeer::ID; - } - - return $this; - } // setDbId() - - /** - * Set the value of [login] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLogin($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->login !== $v || $this->isNew()) { - $this->login = $v; - $this->modifiedColumns[] = CcSubjsPeer::LOGIN; - } - - return $this; - } // setDbLogin() - - /** - * Set the value of [pass] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbPass($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->pass !== $v || $this->isNew()) { - $this->pass = $v; - $this->modifiedColumns[] = CcSubjsPeer::PASS; - } - - return $this; - } // setDbPass() - - /** - * Set the value of [type] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbType($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->type !== $v || $this->isNew()) { - $this->type = $v; - $this->modifiedColumns[] = CcSubjsPeer::TYPE; - } - - return $this; - } // setDbType() - - /** - * Set the value of [first_name] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbFirstName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->first_name !== $v || $this->isNew()) { - $this->first_name = $v; - $this->modifiedColumns[] = CcSubjsPeer::FIRST_NAME; - } - - return $this; - } // setDbFirstName() - - /** - * Set the value of [last_name] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLastName($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->last_name !== $v || $this->isNew()) { - $this->last_name = $v; - $this->modifiedColumns[] = CcSubjsPeer::LAST_NAME; - } - - return $this; - } // setDbLastName() - - /** - * Sets the value of [lastlogin] 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 CcSubjs The current object (for fluent API support) - */ - public function setDbLastlogin($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->lastlogin !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->lastlogin !== null && $tmpDt = new DateTime($this->lastlogin)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->lastlogin = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSubjsPeer::LASTLOGIN; - } - } // if either are not null - - return $this; - } // setDbLastlogin() - - /** - * Sets the value of [lastfail] 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 CcSubjs The current object (for fluent API support) - */ - public function setDbLastfail($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->lastfail !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->lastfail !== null && $tmpDt = new DateTime($this->lastfail)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->lastfail = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcSubjsPeer::LASTFAIL; - } - } // if either are not null - - return $this; - } // setDbLastfail() - - /** - * Set the value of [skype_contact] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbSkypeContact($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->skype_contact !== $v) { - $this->skype_contact = $v; - $this->modifiedColumns[] = CcSubjsPeer::SKYPE_CONTACT; - } - - return $this; - } // setDbSkypeContact() - - /** - * Set the value of [jabber_contact] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbJabberContact($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->jabber_contact !== $v) { - $this->jabber_contact = $v; - $this->modifiedColumns[] = CcSubjsPeer::JABBER_CONTACT; - } - - return $this; - } // setDbJabberContact() - - /** - * Set the value of [email] column. - * - * @param string $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbEmail($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->email !== $v) { - $this->email = $v; - $this->modifiedColumns[] = CcSubjsPeer::EMAIL; - } - - return $this; - } // setDbEmail() - - /** - * Set the value of [login_attempts] column. - * - * @param int $v new value - * @return CcSubjs The current object (for fluent API support) - */ - public function setDbLoginAttempts($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->login_attempts !== $v || $this->isNew()) { - $this->login_attempts = $v; - $this->modifiedColumns[] = CcSubjsPeer::LOGIN_ATTEMPTS; - } - - return $this; - } // setDbLoginAttempts() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->login !== '') { - return false; - } - - if ($this->pass !== '') { - return false; - } - - if ($this->type !== 'U') { - return false; - } - - if ($this->first_name !== '') { - return false; - } - - if ($this->last_name !== '') { - return false; - } - - if ($this->login_attempts !== 0) { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->login = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->pass = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->type = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->first_name = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->last_name = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->lastlogin = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->lastfail = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->skype_contact = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->jabber_contact = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->email = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->login_attempts = ($row[$startcol + 11] !== null) ? (int) $row[$startcol + 11] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 12; // 12 = CcSubjsPeer::NUM_COLUMNS - CcSubjsPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcSubjs object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcSubjsPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - $this->collCcAccesss = null; - - $this->collCcFiless = null; - - $this->collCcPermss = null; - - $this->collCcShowHostss = null; - - $this->collCcPlaylists = null; - - $this->collCcPrefs = null; - - $this->collCcSesss = null; - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcSubjsQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcSubjsPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcSubjsPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcSubjsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSubjsPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setDbId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcSubjsPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - if ($this->collCcAccesss !== null) { - foreach ($this->collCcAccesss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPermss !== null) { - foreach ($this->collCcPermss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPlaylists !== null) { - foreach ($this->collCcPlaylists as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcPrefs !== null) { - foreach ($this->collCcPrefs as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - if ($this->collCcSesss !== null) { - foreach ($this->collCcSesss as $referrerFK) { - if (!$referrerFK->isDeleted()) { - $affectedRows += $referrerFK->save($con); - } - } - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcSubjsPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - if ($this->collCcAccesss !== null) { - foreach ($this->collCcAccesss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcFiless !== null) { - foreach ($this->collCcFiless as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPermss !== null) { - foreach ($this->collCcPermss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcShowHostss !== null) { - foreach ($this->collCcShowHostss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPlaylists !== null) { - foreach ($this->collCcPlaylists as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcPrefs !== null) { - foreach ($this->collCcPrefs as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - if ($this->collCcSesss !== null) { - foreach ($this->collCcSesss as $referrerFK) { - if (!$referrerFK->validate($columns)) { - $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures()); - } - } - } - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getDbId(); - break; - case 1: - return $this->getDbLogin(); - break; - case 2: - return $this->getDbPass(); - break; - case 3: - return $this->getDbType(); - break; - case 4: - return $this->getDbFirstName(); - break; - case 5: - return $this->getDbLastName(); - break; - case 6: - return $this->getDbLastlogin(); - break; - case 7: - return $this->getDbLastfail(); - break; - case 8: - return $this->getDbSkypeContact(); - break; - case 9: - return $this->getDbJabberContact(); - break; - case 10: - return $this->getDbEmail(); - break; - case 11: - return $this->getDbLoginAttempts(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcSubjsPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getDbId(), - $keys[1] => $this->getDbLogin(), - $keys[2] => $this->getDbPass(), - $keys[3] => $this->getDbType(), - $keys[4] => $this->getDbFirstName(), - $keys[5] => $this->getDbLastName(), - $keys[6] => $this->getDbLastlogin(), - $keys[7] => $this->getDbLastfail(), - $keys[8] => $this->getDbSkypeContact(), - $keys[9] => $this->getDbJabberContact(), - $keys[10] => $this->getDbEmail(), - $keys[11] => $this->getDbLoginAttempts(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcSubjsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setDbId($value); - break; - case 1: - $this->setDbLogin($value); - break; - case 2: - $this->setDbPass($value); - break; - case 3: - $this->setDbType($value); - break; - case 4: - $this->setDbFirstName($value); - break; - case 5: - $this->setDbLastName($value); - break; - case 6: - $this->setDbLastlogin($value); - break; - case 7: - $this->setDbLastfail($value); - break; - case 8: - $this->setDbSkypeContact($value); - break; - case 9: - $this->setDbJabberContact($value); - break; - case 10: - $this->setDbEmail($value); - break; - case 11: - $this->setDbLoginAttempts($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcSubjsPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setDbLogin($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDbPass($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setDbType($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setDbFirstName($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setDbLastName($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setDbLastlogin($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setDbLastfail($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setDbSkypeContact($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setDbJabberContact($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setDbEmail($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setDbLoginAttempts($arr[$keys[11]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcSubjsPeer::ID)) $criteria->add(CcSubjsPeer::ID, $this->id); - if ($this->isColumnModified(CcSubjsPeer::LOGIN)) $criteria->add(CcSubjsPeer::LOGIN, $this->login); - if ($this->isColumnModified(CcSubjsPeer::PASS)) $criteria->add(CcSubjsPeer::PASS, $this->pass); - if ($this->isColumnModified(CcSubjsPeer::TYPE)) $criteria->add(CcSubjsPeer::TYPE, $this->type); - if ($this->isColumnModified(CcSubjsPeer::FIRST_NAME)) $criteria->add(CcSubjsPeer::FIRST_NAME, $this->first_name); - if ($this->isColumnModified(CcSubjsPeer::LAST_NAME)) $criteria->add(CcSubjsPeer::LAST_NAME, $this->last_name); - if ($this->isColumnModified(CcSubjsPeer::LASTLOGIN)) $criteria->add(CcSubjsPeer::LASTLOGIN, $this->lastlogin); - if ($this->isColumnModified(CcSubjsPeer::LASTFAIL)) $criteria->add(CcSubjsPeer::LASTFAIL, $this->lastfail); - if ($this->isColumnModified(CcSubjsPeer::SKYPE_CONTACT)) $criteria->add(CcSubjsPeer::SKYPE_CONTACT, $this->skype_contact); - if ($this->isColumnModified(CcSubjsPeer::JABBER_CONTACT)) $criteria->add(CcSubjsPeer::JABBER_CONTACT, $this->jabber_contact); - if ($this->isColumnModified(CcSubjsPeer::EMAIL)) $criteria->add(CcSubjsPeer::EMAIL, $this->email); - if ($this->isColumnModified(CcSubjsPeer::LOGIN_ATTEMPTS)) $criteria->add(CcSubjsPeer::LOGIN_ATTEMPTS, $this->login_attempts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getDbId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setDbId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getDbId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcSubjs (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setDbLogin($this->login); - $copyObj->setDbPass($this->pass); - $copyObj->setDbType($this->type); - $copyObj->setDbFirstName($this->first_name); - $copyObj->setDbLastName($this->last_name); - $copyObj->setDbLastlogin($this->lastlogin); - $copyObj->setDbLastfail($this->lastfail); - $copyObj->setDbSkypeContact($this->skype_contact); - $copyObj->setDbJabberContact($this->jabber_contact); - $copyObj->setDbEmail($this->email); - $copyObj->setDbLoginAttempts($this->login_attempts); - - if ($deepCopy) { - // important: temporarily setNew(false) because this affects the behavior of - // the getter/setter methods for fkey referrer objects. - $copyObj->setNew(false); - - foreach ($this->getCcAccesss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcAccess($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcFiless() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcFiles($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPermss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPerms($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcShowHostss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcShowHosts($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPlaylists() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPlaylist($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcPrefs() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcPref($relObj->copy($deepCopy)); - } - } - - foreach ($this->getCcSesss() as $relObj) { - if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves - $copyObj->addCcSess($relObj->copy($deepCopy)); - } - } - - } // if ($deepCopy) - - - $copyObj->setNew(true); - $copyObj->setDbId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcSubjs Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcSubjsPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcSubjsPeer(); - } - return self::$peer; - } - - /** - * Clears out the collCcAccesss 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 addCcAccesss() - */ - public function clearCcAccesss() - { - $this->collCcAccesss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcAccesss collection. - * - * By default this just sets the collCcAccesss collection to an empty array (like clearcollCcAccesss()); - * 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 initCcAccesss() - { - $this->collCcAccesss = new PropelObjectCollection(); - $this->collCcAccesss->setModel('CcAccess'); - } - - /** - * Gets an array of CcAccess 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 CcSubjs 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 CcAccess[] List of CcAccess objects - * @throws PropelException - */ - public function getCcAccesss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcAccesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcAccesss) { - // return empty collection - $this->initCcAccesss(); - } else { - $collCcAccesss = CcAccessQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcAccesss; - } - $this->collCcAccesss = $collCcAccesss; - } - } - return $this->collCcAccesss; - } - - /** - * Returns the number of related CcAccess objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcAccess objects. - * @throws PropelException - */ - public function countCcAccesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcAccesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcAccesss) { - return 0; - } else { - $query = CcAccessQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcAccesss); - } - } - - /** - * Method called to associate a CcAccess object to this object - * through the CcAccess foreign key attribute. - * - * @param CcAccess $l CcAccess - * @return void - * @throws PropelException - */ - public function addCcAccess(CcAccess $l) - { - if ($this->collCcAccesss === null) { - $this->initCcAccesss(); - } - if (!$this->collCcAccesss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcAccesss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcFiless 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 addCcFiless() - */ - public function clearCcFiless() - { - $this->collCcFiless = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcFiless collection. - * - * By default this just sets the collCcFiless collection to an empty array (like clearcollCcFiless()); - * 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 initCcFiless() - { - $this->collCcFiless = new PropelObjectCollection(); - $this->collCcFiless->setModel('CcFiles'); - } - - /** - * Gets an array of CcFiles 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 CcSubjs 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 CcFiles[] List of CcFiles objects - * @throws PropelException - */ - public function getCcFiless($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - // return empty collection - $this->initCcFiless(); - } else { - $collCcFiless = CcFilesQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcFiless; - } - $this->collCcFiless = $collCcFiless; - } - } - return $this->collCcFiless; - } - - /** - * Returns the number of related CcFiles objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcFiles objects. - * @throws PropelException - */ - public function countCcFiless(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcFiless || null !== $criteria) { - if ($this->isNew() && null === $this->collCcFiless) { - return 0; - } else { - $query = CcFilesQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcFiless); - } - } - - /** - * Method called to associate a CcFiles object to this object - * through the CcFiles foreign key attribute. - * - * @param CcFiles $l CcFiles - * @return void - * @throws PropelException - */ - public function addCcFiles(CcFiles $l) - { - if ($this->collCcFiless === null) { - $this->initCcFiless(); - } - if (!$this->collCcFiless->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcFiless[]= $l; - $l->setCcSubjs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcSubjs is new, it will return - * an empty collection; or if this CcSubjs has previously - * been saved, it will retrieve related CcFiless from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcSubjs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcFiles[] List of CcFiles objects - */ - public function getCcFilessJoinCcMusicDirs($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcFilesQuery::create(null, $criteria); - $query->joinWith('CcMusicDirs', $join_behavior); - - return $this->getCcFiless($query, $con); - } - - /** - * Clears out the collCcPermss 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 addCcPermss() - */ - public function clearCcPermss() - { - $this->collCcPermss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPermss collection. - * - * By default this just sets the collCcPermss collection to an empty array (like clearcollCcPermss()); - * 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 initCcPermss() - { - $this->collCcPermss = new PropelObjectCollection(); - $this->collCcPermss->setModel('CcPerms'); - } - - /** - * Gets an array of CcPerms 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 CcSubjs 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 CcPerms[] List of CcPerms objects - * @throws PropelException - */ - public function getCcPermss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPermss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPermss) { - // return empty collection - $this->initCcPermss(); - } else { - $collCcPermss = CcPermsQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPermss; - } - $this->collCcPermss = $collCcPermss; - } - } - return $this->collCcPermss; - } - - /** - * Returns the number of related CcPerms objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPerms objects. - * @throws PropelException - */ - public function countCcPermss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPermss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPermss) { - return 0; - } else { - $query = CcPermsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPermss); - } - } - - /** - * Method called to associate a CcPerms object to this object - * through the CcPerms foreign key attribute. - * - * @param CcPerms $l CcPerms - * @return void - * @throws PropelException - */ - public function addCcPerms(CcPerms $l) - { - if ($this->collCcPermss === null) { - $this->initCcPermss(); - } - if (!$this->collCcPermss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPermss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcShowHostss 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 addCcShowHostss() - */ - public function clearCcShowHostss() - { - $this->collCcShowHostss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcShowHostss collection. - * - * By default this just sets the collCcShowHostss collection to an empty array (like clearcollCcShowHostss()); - * 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 initCcShowHostss() - { - $this->collCcShowHostss = new PropelObjectCollection(); - $this->collCcShowHostss->setModel('CcShowHosts'); - } - - /** - * Gets an array of CcShowHosts 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 CcSubjs 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 CcShowHosts[] List of CcShowHosts objects - * @throws PropelException - */ - public function getCcShowHostss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - // return empty collection - $this->initCcShowHostss(); - } else { - $collCcShowHostss = CcShowHostsQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcShowHostss; - } - $this->collCcShowHostss = $collCcShowHostss; - } - } - return $this->collCcShowHostss; - } - - /** - * Returns the number of related CcShowHosts objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcShowHosts objects. - * @throws PropelException - */ - public function countCcShowHostss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcShowHostss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcShowHostss) { - return 0; - } else { - $query = CcShowHostsQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcShowHostss); - } - } - - /** - * Method called to associate a CcShowHosts object to this object - * through the CcShowHosts foreign key attribute. - * - * @param CcShowHosts $l CcShowHosts - * @return void - * @throws PropelException - */ - public function addCcShowHosts(CcShowHosts $l) - { - if ($this->collCcShowHostss === null) { - $this->initCcShowHostss(); - } - if (!$this->collCcShowHostss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcShowHostss[]= $l; - $l->setCcSubjs($this); - } - } - - - /** - * If this collection has already been initialized with - * an identical criteria, it returns the collection. - * Otherwise if this CcSubjs is new, it will return - * an empty collection; or if this CcSubjs has previously - * been saved, it will retrieve related CcShowHostss from storage. - * - * This method is protected by default in order to keep the public - * api reasonable. You can provide public methods for those you - * actually need in CcSubjs. - * - * @param Criteria $criteria optional Criteria object to narrow the query - * @param PropelPDO $con optional connection object - * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN) - * @return PropelCollection|array CcShowHosts[] List of CcShowHosts objects - */ - public function getCcShowHostssJoinCcShow($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) - { - $query = CcShowHostsQuery::create(null, $criteria); - $query->joinWith('CcShow', $join_behavior); - - return $this->getCcShowHostss($query, $con); - } - - /** - * Clears out the collCcPlaylists 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 addCcPlaylists() - */ - public function clearCcPlaylists() - { - $this->collCcPlaylists = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPlaylists collection. - * - * By default this just sets the collCcPlaylists collection to an empty array (like clearcollCcPlaylists()); - * 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 initCcPlaylists() - { - $this->collCcPlaylists = new PropelObjectCollection(); - $this->collCcPlaylists->setModel('CcPlaylist'); - } - - /** - * Gets an array of CcPlaylist 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 CcSubjs 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 CcPlaylist[] List of CcPlaylist objects - * @throws PropelException - */ - public function getCcPlaylists($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPlaylists || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylists) { - // return empty collection - $this->initCcPlaylists(); - } else { - $collCcPlaylists = CcPlaylistQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPlaylists; - } - $this->collCcPlaylists = $collCcPlaylists; - } - } - return $this->collCcPlaylists; - } - - /** - * Returns the number of related CcPlaylist objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPlaylist objects. - * @throws PropelException - */ - public function countCcPlaylists(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPlaylists || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPlaylists) { - return 0; - } else { - $query = CcPlaylistQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPlaylists); - } - } - - /** - * Method called to associate a CcPlaylist object to this object - * through the CcPlaylist foreign key attribute. - * - * @param CcPlaylist $l CcPlaylist - * @return void - * @throws PropelException - */ - public function addCcPlaylist(CcPlaylist $l) - { - if ($this->collCcPlaylists === null) { - $this->initCcPlaylists(); - } - if (!$this->collCcPlaylists->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPlaylists[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcPrefs 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 addCcPrefs() - */ - public function clearCcPrefs() - { - $this->collCcPrefs = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcPrefs collection. - * - * By default this just sets the collCcPrefs collection to an empty array (like clearcollCcPrefs()); - * 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 initCcPrefs() - { - $this->collCcPrefs = new PropelObjectCollection(); - $this->collCcPrefs->setModel('CcPref'); - } - - /** - * Gets an array of CcPref 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 CcSubjs 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 CcPref[] List of CcPref objects - * @throws PropelException - */ - public function getCcPrefs($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcPrefs || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPrefs) { - // return empty collection - $this->initCcPrefs(); - } else { - $collCcPrefs = CcPrefQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcPrefs; - } - $this->collCcPrefs = $collCcPrefs; - } - } - return $this->collCcPrefs; - } - - /** - * Returns the number of related CcPref objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcPref objects. - * @throws PropelException - */ - public function countCcPrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcPrefs || null !== $criteria) { - if ($this->isNew() && null === $this->collCcPrefs) { - return 0; - } else { - $query = CcPrefQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcPrefs); - } - } - - /** - * Method called to associate a CcPref object to this object - * through the CcPref foreign key attribute. - * - * @param CcPref $l CcPref - * @return void - * @throws PropelException - */ - public function addCcPref(CcPref $l) - { - if ($this->collCcPrefs === null) { - $this->initCcPrefs(); - } - if (!$this->collCcPrefs->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcPrefs[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears out the collCcSesss 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 addCcSesss() - */ - public function clearCcSesss() - { - $this->collCcSesss = null; // important to set this to NULL since that means it is uninitialized - } - - /** - * Initializes the collCcSesss collection. - * - * By default this just sets the collCcSesss collection to an empty array (like clearcollCcSesss()); - * 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 initCcSesss() - { - $this->collCcSesss = new PropelObjectCollection(); - $this->collCcSesss->setModel('CcSess'); - } - - /** - * Gets an array of CcSess 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 CcSubjs 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 CcSess[] List of CcSess objects - * @throws PropelException - */ - public function getCcSesss($criteria = null, PropelPDO $con = null) - { - if(null === $this->collCcSesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSesss) { - // return empty collection - $this->initCcSesss(); - } else { - $collCcSesss = CcSessQuery::create(null, $criteria) - ->filterByCcSubjs($this) - ->find($con); - if (null !== $criteria) { - return $collCcSesss; - } - $this->collCcSesss = $collCcSesss; - } - } - return $this->collCcSesss; - } - - /** - * Returns the number of related CcSess objects. - * - * @param Criteria $criteria - * @param boolean $distinct - * @param PropelPDO $con - * @return int Count of related CcSess objects. - * @throws PropelException - */ - public function countCcSesss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) - { - if(null === $this->collCcSesss || null !== $criteria) { - if ($this->isNew() && null === $this->collCcSesss) { - return 0; - } else { - $query = CcSessQuery::create(null, $criteria); - if($distinct) { - $query->distinct(); - } - return $query - ->filterByCcSubjs($this) - ->count($con); - } - } else { - return count($this->collCcSesss); - } - } - - /** - * Method called to associate a CcSess object to this object - * through the CcSess foreign key attribute. - * - * @param CcSess $l CcSess - * @return void - * @throws PropelException - */ - public function addCcSess(CcSess $l) - { - if ($this->collCcSesss === null) { - $this->initCcSesss(); - } - if (!$this->collCcSesss->contains($l)) { // only add it if the **same** object is not already associated - $this->collCcSesss[]= $l; - $l->setCcSubjs($this); - } - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->login = null; - $this->pass = null; - $this->type = null; - $this->first_name = null; - $this->last_name = null; - $this->lastlogin = null; - $this->lastfail = null; - $this->skype_contact = null; - $this->jabber_contact = null; - $this->email = null; - $this->login_attempts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - if ($this->collCcAccesss) { - foreach ((array) $this->collCcAccesss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcFiless) { - foreach ((array) $this->collCcFiless as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPermss) { - foreach ((array) $this->collCcPermss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcShowHostss) { - foreach ((array) $this->collCcShowHostss as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPlaylists) { - foreach ((array) $this->collCcPlaylists as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcPrefs) { - foreach ((array) $this->collCcPrefs as $o) { - $o->clearAllReferences($deep); - } - } - if ($this->collCcSesss) { - foreach ((array) $this->collCcSesss as $o) { - $o->clearAllReferences($deep); - } - } - } // if ($deep) - - $this->collCcAccesss = null; - $this->collCcFiless = null; - $this->collCcPermss = null; - $this->collCcShowHostss = null; - $this->collCcPlaylists = null; - $this->collCcPrefs = null; - $this->collCcSesss = null; - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcSubjs diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsPeer.php deleted file mode 100644 index 79a9a7efa..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsPeer.php +++ /dev/null @@ -1,801 +0,0 @@ - array ('DbId', 'DbLogin', 'DbPass', 'DbType', 'DbFirstName', 'DbLastName', 'DbLastlogin', 'DbLastfail', 'DbSkypeContact', 'DbJabberContact', 'DbEmail', 'DbLoginAttempts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbLogin', 'dbPass', 'dbType', 'dbFirstName', 'dbLastName', 'dbLastlogin', 'dbLastfail', 'dbSkypeContact', 'dbJabberContact', 'dbEmail', 'dbLoginAttempts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::LOGIN, self::PASS, self::TYPE, self::FIRST_NAME, self::LAST_NAME, self::LASTLOGIN, self::LASTFAIL, self::SKYPE_CONTACT, self::JABBER_CONTACT, self::EMAIL, self::LOGIN_ATTEMPTS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'LOGIN', 'PASS', 'TYPE', 'FIRST_NAME', 'LAST_NAME', 'LASTLOGIN', 'LASTFAIL', 'SKYPE_CONTACT', 'JABBER_CONTACT', 'EMAIL', 'LOGIN_ATTEMPTS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'login', 'pass', 'type', 'first_name', 'last_name', 'lastlogin', 'lastfail', 'skype_contact', 'jabber_contact', 'email', 'login_attempts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * 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, 'DbLogin' => 1, 'DbPass' => 2, 'DbType' => 3, 'DbFirstName' => 4, 'DbLastName' => 5, 'DbLastlogin' => 6, 'DbLastfail' => 7, 'DbSkypeContact' => 8, 'DbJabberContact' => 9, 'DbEmail' => 10, 'DbLoginAttempts' => 11, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbLogin' => 1, 'dbPass' => 2, 'dbType' => 3, 'dbFirstName' => 4, 'dbLastName' => 5, 'dbLastlogin' => 6, 'dbLastfail' => 7, 'dbSkypeContact' => 8, 'dbJabberContact' => 9, 'dbEmail' => 10, 'dbLoginAttempts' => 11, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::LOGIN => 1, self::PASS => 2, self::TYPE => 3, self::FIRST_NAME => 4, self::LAST_NAME => 5, self::LASTLOGIN => 6, self::LASTFAIL => 7, self::SKYPE_CONTACT => 8, self::JABBER_CONTACT => 9, self::EMAIL => 10, self::LOGIN_ATTEMPTS => 11, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'LOGIN' => 1, 'PASS' => 2, 'TYPE' => 3, 'FIRST_NAME' => 4, 'LAST_NAME' => 5, 'LASTLOGIN' => 6, 'LASTFAIL' => 7, 'SKYPE_CONTACT' => 8, 'JABBER_CONTACT' => 9, 'EMAIL' => 10, 'LOGIN_ATTEMPTS' => 11, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'login' => 1, 'pass' => 2, 'type' => 3, 'first_name' => 4, 'last_name' => 5, 'lastlogin' => 6, 'lastfail' => 7, 'skype_contact' => 8, 'jabber_contact' => 9, 'email' => 10, 'login_attempts' => 11, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcSubjsPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcSubjsPeer::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(CcSubjsPeer::ID); - $criteria->addSelectColumn(CcSubjsPeer::LOGIN); - $criteria->addSelectColumn(CcSubjsPeer::PASS); - $criteria->addSelectColumn(CcSubjsPeer::TYPE); - $criteria->addSelectColumn(CcSubjsPeer::FIRST_NAME); - $criteria->addSelectColumn(CcSubjsPeer::LAST_NAME); - $criteria->addSelectColumn(CcSubjsPeer::LASTLOGIN); - $criteria->addSelectColumn(CcSubjsPeer::LASTFAIL); - $criteria->addSelectColumn(CcSubjsPeer::SKYPE_CONTACT); - $criteria->addSelectColumn(CcSubjsPeer::JABBER_CONTACT); - $criteria->addSelectColumn(CcSubjsPeer::EMAIL); - $criteria->addSelectColumn(CcSubjsPeer::LOGIN_ATTEMPTS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.LOGIN'); - $criteria->addSelectColumn($alias . '.PASS'); - $criteria->addSelectColumn($alias . '.TYPE'); - $criteria->addSelectColumn($alias . '.FIRST_NAME'); - $criteria->addSelectColumn($alias . '.LAST_NAME'); - $criteria->addSelectColumn($alias . '.LASTLOGIN'); - $criteria->addSelectColumn($alias . '.LASTFAIL'); - $criteria->addSelectColumn($alias . '.SKYPE_CONTACT'); - $criteria->addSelectColumn($alias . '.JABBER_CONTACT'); - $criteria->addSelectColumn($alias . '.EMAIL'); - $criteria->addSelectColumn($alias . '.LOGIN_ATTEMPTS'); - } - } - - /** - * 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(CcSubjsPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcSubjsPeer::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(CcSubjsPeer::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 CcSubjs - * @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 = CcSubjsPeer::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 CcSubjsPeer::populateObjects(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcSubjsPeer::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 CcSubjs $value A CcSubjs object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcSubjs $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 CcSubjs object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcSubjs) { - $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 CcSubjs 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 CcSubjs 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_subjs - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - // Invalidate objects in CcPermsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPermsPeer::clearInstancePool(); - // Invalidate objects in CcShowHostsPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcShowHostsPeer::clearInstancePool(); - // Invalidate objects in CcPrefPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcPrefPeer::clearInstancePool(); - // Invalidate objects in CcSessPeer instance pool, - // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - CcSessPeer::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 = CcSubjsPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcSubjsPeer::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; - CcSubjsPeer::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 (CcSubjs object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcSubjsPeer::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 + CcSubjsPeer::NUM_COLUMNS; - } else { - $cls = CcSubjsPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcSubjsPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcSubjsPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcSubjsPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcSubjsTableMap()); - } - } - - /** - * 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 ? CcSubjsPeer::CLASS_DEFAULT : CcSubjsPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcSubjs or Criteria object. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcSubjs object - } - - if ($criteria->containsKey(CcSubjsPeer::ID) && $criteria->keyContainsValue(CcSubjsPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcSubjsPeer::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 CcSubjs or Criteria object. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcSubjsPeer::ID); - $value = $criteria->remove(CcSubjsPeer::ID); - if ($value) { - $selectCriteria->add(CcSubjsPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcSubjsPeer::TABLE_NAME); - } - - } else { // $values is CcSubjs 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_subjs 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(CcSubjsPeer::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(CcSubjsPeer::TABLE_NAME, $con, CcSubjsPeer::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). - CcSubjsPeer::clearInstancePool(); - CcSubjsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcSubjs or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcSubjs 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(CcSubjsPeer::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. - CcSubjsPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcSubjs) { // it's a model object - // invalidate the cache for this single object - CcSubjsPeer::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(CcSubjsPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcSubjsPeer::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); - CcSubjsPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcSubjs 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 CcSubjs $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(CcSubjs $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcSubjsPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, CcSubjsPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcSubjs - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcSubjsPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $pk); - - $v = CcSubjsPeer::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(CcSubjsPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcSubjsPeer::DATABASE_NAME); - $criteria->add(CcSubjsPeer::ID, $pks, Criteria::IN); - $objs = CcSubjsPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcSubjsPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcSubjsPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsQuery.php deleted file mode 100644 index 9a0cffdd0..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcSubjsQuery.php +++ /dev/null @@ -1,954 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcSubjs|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcSubjsPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcSubjsPeer::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 CcSubjsQuery 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(CcSubjsPeer::ID, $dbId, $comparison); - } - - /** - * Filter the query on the login column - * - * @param string $dbLogin The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLogin($dbLogin = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLogin)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLogin)) { - $dbLogin = str_replace('*', '%', $dbLogin); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::LOGIN, $dbLogin, $comparison); - } - - /** - * Filter the query on the pass column - * - * @param string $dbPass The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbPass($dbPass = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbPass)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbPass)) { - $dbPass = str_replace('*', '%', $dbPass); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::PASS, $dbPass, $comparison); - } - - /** - * Filter the query on the type column - * - * @param string $dbType The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbType($dbType = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbType)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbType)) { - $dbType = str_replace('*', '%', $dbType); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::TYPE, $dbType, $comparison); - } - - /** - * Filter the query on the first_name column - * - * @param string $dbFirstName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbFirstName($dbFirstName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbFirstName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbFirstName)) { - $dbFirstName = str_replace('*', '%', $dbFirstName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::FIRST_NAME, $dbFirstName, $comparison); - } - - /** - * Filter the query on the last_name column - * - * @param string $dbLastName The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastName($dbLastName = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbLastName)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbLastName)) { - $dbLastName = str_replace('*', '%', $dbLastName); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::LAST_NAME, $dbLastName, $comparison); - } - - /** - * Filter the query on the lastlogin column - * - * @param string|array $dbLastlogin 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastlogin($dbLastlogin = null, $comparison = null) - { - if (is_array($dbLastlogin)) { - $useMinMax = false; - if (isset($dbLastlogin['min'])) { - $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastlogin['max'])) { - $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LASTLOGIN, $dbLastlogin, $comparison); - } - - /** - * Filter the query on the lastfail column - * - * @param string|array $dbLastfail 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLastfail($dbLastfail = null, $comparison = null) - { - if (is_array($dbLastfail)) { - $useMinMax = false; - if (isset($dbLastfail['min'])) { - $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLastfail['max'])) { - $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LASTFAIL, $dbLastfail, $comparison); - } - - /** - * Filter the query on the skype_contact column - * - * @param string $dbSkypeContact The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbSkypeContact($dbSkypeContact = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbSkypeContact)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbSkypeContact)) { - $dbSkypeContact = str_replace('*', '%', $dbSkypeContact); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::SKYPE_CONTACT, $dbSkypeContact, $comparison); - } - - /** - * Filter the query on the jabber_contact column - * - * @param string $dbJabberContact The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbJabberContact($dbJabberContact = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbJabberContact)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbJabberContact)) { - $dbJabberContact = str_replace('*', '%', $dbJabberContact); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::JABBER_CONTACT, $dbJabberContact, $comparison); - } - - /** - * Filter the query on the email column - * - * @param string $dbEmail The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbEmail($dbEmail = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($dbEmail)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $dbEmail)) { - $dbEmail = str_replace('*', '%', $dbEmail); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcSubjsPeer::EMAIL, $dbEmail, $comparison); - } - - /** - * Filter the query on the login_attempts column - * - * @param int|array $dbLoginAttempts 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 CcSubjsQuery The current query, for fluid interface - */ - public function filterByDbLoginAttempts($dbLoginAttempts = null, $comparison = null) - { - if (is_array($dbLoginAttempts)) { - $useMinMax = false; - if (isset($dbLoginAttempts['min'])) { - $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbLoginAttempts['max'])) { - $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcSubjsPeer::LOGIN_ATTEMPTS, $dbLoginAttempts, $comparison); - } - - /** - * Filter the query by a related CcAccess object - * - * @param CcAccess $ccAccess the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcAccess($ccAccess, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccAccess->getOwner(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcAccess relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcAccess($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcAccess'); - - // 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, 'CcAccess'); - } - - return $this; - } - - /** - * Use the CcAccess relation CcAccess 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 CcAccessQuery A secondary query class using the current class as primary query - */ - public function useCcAccessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcAccess($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcAccess', 'CcAccessQuery'); - } - - /** - * Filter the query by a related CcFiles object - * - * @param CcFiles $ccFiles the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcFiles($ccFiles, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccFiles->getDbEditedby(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcFiles relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcFiles($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcFiles'); - - // 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, 'CcFiles'); - } - - return $this; - } - - /** - * Use the CcFiles relation CcFiles 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 CcFilesQuery A secondary query class using the current class as primary query - */ - public function useCcFilesQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcFiles($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcFiles', 'CcFilesQuery'); - } - - /** - * Filter the query by a related CcPerms object - * - * @param CcPerms $ccPerms the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPerms($ccPerms, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPerms->getSubj(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPerms relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPerms($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPerms'); - - // 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, 'CcPerms'); - } - - return $this; - } - - /** - * Use the CcPerms relation CcPerms 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 CcPermsQuery A secondary query class using the current class as primary query - */ - public function useCcPermsQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPerms($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPerms', 'CcPermsQuery'); - } - - /** - * Filter the query by a related CcShowHosts object - * - * @param CcShowHosts $ccShowHosts the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcShowHosts($ccShowHosts, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccShowHosts->getDbHost(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcShowHosts relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcShowHosts($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcShowHosts'); - - // 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, 'CcShowHosts'); - } - - return $this; - } - - /** - * Use the CcShowHosts relation CcShowHosts 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 CcShowHostsQuery A secondary query class using the current class as primary query - */ - public function useCcShowHostsQuery($relationAlias = '', $joinType = Criteria::INNER_JOIN) - { - return $this - ->joinCcShowHosts($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcShowHosts', 'CcShowHostsQuery'); - } - - /** - * Filter the query by a related CcPlaylist object - * - * @param CcPlaylist $ccPlaylist the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPlaylist($ccPlaylist, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPlaylist->getDbEditedby(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPlaylist relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPlaylist($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPlaylist'); - - // 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, 'CcPlaylist'); - } - - return $this; - } - - /** - * Use the CcPlaylist relation CcPlaylist 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 CcPlaylistQuery A secondary query class using the current class as primary query - */ - public function useCcPlaylistQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPlaylist($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPlaylist', 'CcPlaylistQuery'); - } - - /** - * Filter the query by a related CcPref object - * - * @param CcPref $ccPref the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcPref($ccPref, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccPref->getSubjid(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcPref relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcPref($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcPref'); - - // 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, 'CcPref'); - } - - return $this; - } - - /** - * Use the CcPref relation CcPref 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 CcPrefQuery A secondary query class using the current class as primary query - */ - public function useCcPrefQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcPref($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcPref', 'CcPrefQuery'); - } - - /** - * Filter the query by a related CcSess object - * - * @param CcSess $ccSess the related object to use as filter - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function filterByCcSess($ccSess, $comparison = null) - { - return $this - ->addUsingAlias(CcSubjsPeer::ID, $ccSess->getUserid(), $comparison); - } - - /** - * Adds a JOIN clause to the query using the CcSess relation - * - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join' - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function joinCcSess($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - $tableMap = $this->getTableMap(); - $relationMap = $tableMap->getRelation('CcSess'); - - // 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, 'CcSess'); - } - - return $this; - } - - /** - * Use the CcSess relation CcSess 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 CcSessQuery A secondary query class using the current class as primary query - */ - public function useCcSessQuery($relationAlias = '', $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinCcSess($relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'CcSess', 'CcSessQuery'); - } - - /** - * Exclude object from result - * - * @param CcSubjs $ccSubjs Object to remove from the list of results - * - * @return CcSubjsQuery The current query, for fluid interface - */ - public function prune($ccSubjs = null) - { - if ($ccSubjs) { - $this->addUsingAlias(CcSubjsPeer::ID, $ccSubjs->getDbId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcSubjsQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTrans.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTrans.php deleted file mode 100644 index 2ea4f7c20..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTrans.php +++ /dev/null @@ -1,1903 +0,0 @@ -lock = 'N'; - } - - /** - * Initializes internal state of BaseCcTrans object. - * @see applyDefaults() - */ - public function __construct() - { - parent::__construct(); - $this->applyDefaultValues(); - } - - /** - * Get the [id] column value. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get the [trtok] column value. - * - * @return string - */ - public function getTrtok() - { - return $this->trtok; - } - - /** - * Get the [direction] column value. - * - * @return string - */ - public function getDirection() - { - return $this->direction; - } - - /** - * Get the [state] column value. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Get the [trtype] column value. - * - * @return string - */ - public function getTrtype() - { - return $this->trtype; - } - - /** - * Get the [lock] column value. - * - * @return string - */ - public function getLock() - { - return $this->lock; - } - - /** - * Get the [target] column value. - * - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Get the [rtrtok] column value. - * - * @return string - */ - public function getRtrtok() - { - return $this->rtrtok; - } - - /** - * Get the [mdtrtok] column value. - * - * @return string - */ - public function getMdtrtok() - { - return $this->mdtrtok; - } - - /** - * Get the [gunid] column value. - * - * @return string - */ - public function getGunid() - { - return $this->gunid; - } - - /** - * Get the [pdtoken] column value. - * - * @return string - */ - public function getPdtoken() - { - return $this->pdtoken; - } - - /** - * Get the [url] column value. - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Get the [localfile] column value. - * - * @return string - */ - public function getLocalfile() - { - return $this->localfile; - } - - /** - * Get the [fname] column value. - * - * @return string - */ - public function getFname() - { - return $this->fname; - } - - /** - * Get the [title] column value. - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Get the [expectedsum] column value. - * - * @return string - */ - public function getExpectedsum() - { - return $this->expectedsum; - } - - /** - * Get the [realsum] column value. - * - * @return string - */ - public function getRealsum() - { - return $this->realsum; - } - - /** - * Get the [expectedsize] column value. - * - * @return int - */ - public function getExpectedsize() - { - return $this->expectedsize; - } - - /** - * Get the [realsize] column value. - * - * @return int - */ - public function getRealsize() - { - return $this->realsize; - } - - /** - * Get the [uid] column value. - * - * @return int - */ - public function getUid() - { - return $this->uid; - } - - /** - * Get the [errmsg] column value. - * - * @return string - */ - public function getErrmsg() - { - return $this->errmsg; - } - - /** - * Get the [jobpid] column value. - * - * @return int - */ - public function getJobpid() - { - return $this->jobpid; - } - - /** - * Get the [optionally formatted] temporal [start] 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 getStart($format = 'Y-m-d H:i:s') - { - if ($this->start === null) { - return null; - } - - - - try { - $dt = new DateTime($this->start); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->start, 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 [optionally formatted] temporal [ts] 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 getTs($format = 'Y-m-d H:i:s') - { - if ($this->ts === null) { - return null; - } - - - - try { - $dt = new DateTime($this->ts); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->ts, 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); - } - } - - /** - * Set the value of [id] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setId($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->id !== $v) { - $this->id = $v; - $this->modifiedColumns[] = CcTransPeer::ID; - } - - return $this; - } // setId() - - /** - * Set the value of [trtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->trtok !== $v) { - $this->trtok = $v; - $this->modifiedColumns[] = CcTransPeer::TRTOK; - } - - return $this; - } // setTrtok() - - /** - * Set the value of [direction] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setDirection($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->direction !== $v) { - $this->direction = $v; - $this->modifiedColumns[] = CcTransPeer::DIRECTION; - } - - return $this; - } // setDirection() - - /** - * Set the value of [state] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setState($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->state !== $v) { - $this->state = $v; - $this->modifiedColumns[] = CcTransPeer::STATE; - } - - return $this; - } // setState() - - /** - * Set the value of [trtype] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTrtype($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->trtype !== $v) { - $this->trtype = $v; - $this->modifiedColumns[] = CcTransPeer::TRTYPE; - } - - return $this; - } // setTrtype() - - /** - * Set the value of [lock] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setLock($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->lock !== $v || $this->isNew()) { - $this->lock = $v; - $this->modifiedColumns[] = CcTransPeer::LOCK; - } - - return $this; - } // setLock() - - /** - * Set the value of [target] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTarget($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->target !== $v) { - $this->target = $v; - $this->modifiedColumns[] = CcTransPeer::TARGET; - } - - return $this; - } // setTarget() - - /** - * Set the value of [rtrtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRtrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->rtrtok !== $v) { - $this->rtrtok = $v; - $this->modifiedColumns[] = CcTransPeer::RTRTOK; - } - - return $this; - } // setRtrtok() - - /** - * Set the value of [mdtrtok] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setMdtrtok($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->mdtrtok !== $v) { - $this->mdtrtok = $v; - $this->modifiedColumns[] = CcTransPeer::MDTRTOK; - } - - return $this; - } // setMdtrtok() - - /** - * Set the value of [gunid] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setGunid($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->gunid !== $v) { - $this->gunid = $v; - $this->modifiedColumns[] = CcTransPeer::GUNID; - } - - return $this; - } // setGunid() - - /** - * Set the value of [pdtoken] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setPdtoken($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->pdtoken !== $v) { - $this->pdtoken = $v; - $this->modifiedColumns[] = CcTransPeer::PDTOKEN; - } - - return $this; - } // setPdtoken() - - /** - * Set the value of [url] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setUrl($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->url !== $v) { - $this->url = $v; - $this->modifiedColumns[] = CcTransPeer::URL; - } - - return $this; - } // setUrl() - - /** - * Set the value of [localfile] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setLocalfile($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->localfile !== $v) { - $this->localfile = $v; - $this->modifiedColumns[] = CcTransPeer::LOCALFILE; - } - - return $this; - } // setLocalfile() - - /** - * Set the value of [fname] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setFname($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->fname !== $v) { - $this->fname = $v; - $this->modifiedColumns[] = CcTransPeer::FNAME; - } - - return $this; - } // setFname() - - /** - * Set the value of [title] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setTitle($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->title !== $v) { - $this->title = $v; - $this->modifiedColumns[] = CcTransPeer::TITLE; - } - - return $this; - } // setTitle() - - /** - * Set the value of [expectedsum] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setExpectedsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->expectedsum !== $v) { - $this->expectedsum = $v; - $this->modifiedColumns[] = CcTransPeer::EXPECTEDSUM; - } - - return $this; - } // setExpectedsum() - - /** - * Set the value of [realsum] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRealsum($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->realsum !== $v) { - $this->realsum = $v; - $this->modifiedColumns[] = CcTransPeer::REALSUM; - } - - return $this; - } // setRealsum() - - /** - * Set the value of [expectedsize] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setExpectedsize($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->expectedsize !== $v) { - $this->expectedsize = $v; - $this->modifiedColumns[] = CcTransPeer::EXPECTEDSIZE; - } - - return $this; - } // setExpectedsize() - - /** - * Set the value of [realsize] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setRealsize($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->realsize !== $v) { - $this->realsize = $v; - $this->modifiedColumns[] = CcTransPeer::REALSIZE; - } - - return $this; - } // setRealsize() - - /** - * Set the value of [uid] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setUid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->uid !== $v) { - $this->uid = $v; - $this->modifiedColumns[] = CcTransPeer::UID; - } - - return $this; - } // setUid() - - /** - * Set the value of [errmsg] column. - * - * @param string $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setErrmsg($v) - { - if ($v !== null) { - $v = (string) $v; - } - - if ($this->errmsg !== $v) { - $this->errmsg = $v; - $this->modifiedColumns[] = CcTransPeer::ERRMSG; - } - - return $this; - } // setErrmsg() - - /** - * Set the value of [jobpid] column. - * - * @param int $v new value - * @return CcTrans The current object (for fluent API support) - */ - public function setJobpid($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->jobpid !== $v) { - $this->jobpid = $v; - $this->modifiedColumns[] = CcTransPeer::JOBPID; - } - - return $this; - } // setJobpid() - - /** - * Sets the value of [start] 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 CcTrans The current object (for fluent API support) - */ - public function setStart($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->start !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->start !== null && $tmpDt = new DateTime($this->start)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->start = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcTransPeer::START; - } - } // if either are not null - - return $this; - } // setStart() - - /** - * Sets the value of [ts] 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 CcTrans The current object (for fluent API support) - */ - public function setTs($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->ts !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->ts !== null && $tmpDt = new DateTime($this->ts)) ? $tmpDt->format('Y-m-d\\TH:i:sO') : null; - $newNorm = ($dt !== null) ? $dt->format('Y-m-d\\TH:i:sO') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->ts = ($dt ? $dt->format('Y-m-d\\TH:i:sO') : null); - $this->modifiedColumns[] = CcTransPeer::TS; - } - } // if either are not null - - return $this; - } // setTs() - - /** - * Indicates whether the columns in this object are only set to default values. - * - * This method can be used in conjunction with isModified() to indicate whether an object is both - * modified _and_ has some values set which are non-default. - * - * @return boolean Whether the columns in this object are only been set with default values. - */ - public function hasOnlyDefaultValues() - { - if ($this->lock !== 'N') { - return false; - } - - // otherwise, everything was equal, so return TRUE - return true; - } // hasOnlyDefaultValues() - - /** - * Hydrates (populates) the object variables with values from the database resultset. - * - * An offset (0-based "start column") is specified so that objects can be hydrated - * with a subset of the columns in the resultset rows. This is needed, for example, - * for results of JOIN queries where the resultset row includes columns from two or - * more tables. - * - * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM) - * @param int $startcol 0-based offset column which indicates which restultset column to start with. - * @param boolean $rehydrate Whether this object is being re-hydrated from the database. - * @return int next starting column - * @throws PropelException - Any caught Exception will be rewrapped as a PropelException. - */ - public function hydrate($row, $startcol = 0, $rehydrate = false) - { - try { - - $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; - $this->trtok = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; - $this->direction = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null; - $this->state = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null; - $this->trtype = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null; - $this->lock = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; - $this->target = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; - $this->rtrtok = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null; - $this->mdtrtok = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null; - $this->gunid = ($row[$startcol + 9] !== null) ? (string) $row[$startcol + 9] : null; - $this->pdtoken = ($row[$startcol + 10] !== null) ? (string) $row[$startcol + 10] : null; - $this->url = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null; - $this->localfile = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null; - $this->fname = ($row[$startcol + 13] !== null) ? (string) $row[$startcol + 13] : null; - $this->title = ($row[$startcol + 14] !== null) ? (string) $row[$startcol + 14] : null; - $this->expectedsum = ($row[$startcol + 15] !== null) ? (string) $row[$startcol + 15] : null; - $this->realsum = ($row[$startcol + 16] !== null) ? (string) $row[$startcol + 16] : null; - $this->expectedsize = ($row[$startcol + 17] !== null) ? (int) $row[$startcol + 17] : null; - $this->realsize = ($row[$startcol + 18] !== null) ? (int) $row[$startcol + 18] : null; - $this->uid = ($row[$startcol + 19] !== null) ? (int) $row[$startcol + 19] : null; - $this->errmsg = ($row[$startcol + 20] !== null) ? (string) $row[$startcol + 20] : null; - $this->jobpid = ($row[$startcol + 21] !== null) ? (int) $row[$startcol + 21] : null; - $this->start = ($row[$startcol + 22] !== null) ? (string) $row[$startcol + 22] : null; - $this->ts = ($row[$startcol + 23] !== null) ? (string) $row[$startcol + 23] : null; - $this->resetModified(); - - $this->setNew(false); - - if ($rehydrate) { - $this->ensureConsistency(); - } - - return $startcol + 24; // 24 = CcTransPeer::NUM_COLUMNS - CcTransPeer::NUM_LAZY_LOAD_COLUMNS). - - } catch (Exception $e) { - throw new PropelException("Error populating CcTrans object", $e); - } - } - - /** - * Checks and repairs the internal consistency of the object. - * - * This method is executed after an already-instantiated object is re-hydrated - * from the database. It exists to check any foreign keys to make sure that - * the objects related to the current object are correct based on foreign key. - * - * You can override this method in the stub class, but you should always invoke - * the base method from the overridden method (i.e. parent::ensureConsistency()), - * in case your model changes. - * - * @throws PropelException - */ - public function ensureConsistency() - { - - } // ensureConsistency - - /** - * Reloads this object from datastore based on primary key and (optionally) resets all associated objects. - * - * This will only work if the object has been saved and has a valid primary key set. - * - * @param boolean $deep (optional) Whether to also de-associated any related objects. - * @param PropelPDO $con (optional) The PropelPDO connection to use. - * @return void - * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db - */ - public function reload($deep = false, PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("Cannot reload a deleted object."); - } - - if ($this->isNew()) { - throw new PropelException("Cannot reload an unsaved object."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - // We don't need to alter the object instance pool; we're just modifying this instance - // already in the pool. - - $stmt = CcTransPeer::doSelectStmt($this->buildPkeyCriteria(), $con); - $row = $stmt->fetch(PDO::FETCH_NUM); - $stmt->closeCursor(); - if (!$row) { - throw new PropelException('Cannot find matching row in the database to reload object values.'); - } - $this->hydrate($row, 0, true); // rehydrate - - if ($deep) { // also de-associate any related objects? - - } // if (deep) - } - - /** - * Removes this object from datastore and sets delete attribute. - * - * @param PropelPDO $con - * @return void - * @throws PropelException - * @see BaseObject::setDeleted() - * @see BaseObject::isDeleted() - */ - public function delete(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("This object has already been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - try { - $ret = $this->preDelete($con); - if ($ret) { - CcTransQuery::create() - ->filterByPrimaryKey($this->getPrimaryKey()) - ->delete($con); - $this->postDelete($con); - $con->commit(); - $this->setDeleted(true); - } else { - $con->commit(); - } - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Persists this object to the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All modified related objects will also be persisted in the doSave() - * method. This method wraps all precipitate database operations in a - * single transaction. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see doSave() - */ - public function save(PropelPDO $con = null) - { - if ($this->isDeleted()) { - throw new PropelException("You cannot save an object that has been deleted."); - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $con->beginTransaction(); - $isInsert = $this->isNew(); - try { - $ret = $this->preSave($con); - if ($isInsert) { - $ret = $ret && $this->preInsert($con); - } else { - $ret = $ret && $this->preUpdate($con); - } - if ($ret) { - $affectedRows = $this->doSave($con); - if ($isInsert) { - $this->postInsert($con); - } else { - $this->postUpdate($con); - } - $this->postSave($con); - CcTransPeer::addInstanceToPool($this); - } else { - $affectedRows = 0; - } - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Performs the work of inserting or updating the row in the database. - * - * If the object is new, it inserts it; otherwise an update is performed. - * All related objects are also updated in this method. - * - * @param PropelPDO $con - * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. - * @throws PropelException - * @see save() - */ - protected function doSave(PropelPDO $con) - { - $affectedRows = 0; // initialize var to track total num of affected rows - if (!$this->alreadyInSave) { - $this->alreadyInSave = true; - - if ($this->isNew() ) { - $this->modifiedColumns[] = CcTransPeer::ID; - } - - // If this object has been modified, then save it to the database. - if ($this->isModified()) { - if ($this->isNew()) { - $criteria = $this->buildCriteria(); - if ($criteria->keyContainsValue(CcTransPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcTransPeer::ID.')'); - } - - $pk = BasePeer::doInsert($criteria, $con); - $affectedRows = 1; - $this->setId($pk); //[IMV] update autoincrement primary key - $this->setNew(false); - } else { - $affectedRows = CcTransPeer::doUpdate($this, $con); - } - - $this->resetModified(); // [HL] After being saved an object is no longer 'modified' - } - - $this->alreadyInSave = false; - - } - return $affectedRows; - } // doSave() - - /** - * Array of ValidationFailed objects. - * @var array ValidationFailed[] - */ - protected $validationFailures = array(); - - /** - * Gets any ValidationFailed objects that resulted from last call to validate(). - * - * - * @return array ValidationFailed[] - * @see validate() - */ - public function getValidationFailures() - { - return $this->validationFailures; - } - - /** - * Validates the objects modified field values and all objects related to this table. - * - * If $columns is either a column name or an array of column names - * only those columns are validated. - * - * @param mixed $columns Column name or an array of column names. - * @return boolean Whether all columns pass validation. - * @see doValidate() - * @see getValidationFailures() - */ - public function validate($columns = null) - { - $res = $this->doValidate($columns); - if ($res === true) { - $this->validationFailures = array(); - return true; - } else { - $this->validationFailures = $res; - return false; - } - } - - /** - * This function performs the validation work for complex object models. - * - * In addition to checking the current object, all related objects will - * also be validated. If all pass then true is returned; otherwise - * an aggreagated array of ValidationFailed objects will be returned. - * - * @param array $columns Array of column names to validate. - * @return mixed true if all validations pass; array of ValidationFailed objets otherwise. - */ - protected function doValidate($columns = null) - { - if (!$this->alreadyInValidation) { - $this->alreadyInValidation = true; - $retval = null; - - $failureMap = array(); - - - if (($retval = CcTransPeer::doValidate($this, $columns)) !== true) { - $failureMap = array_merge($failureMap, $retval); - } - - - - $this->alreadyInValidation = false; - } - - return (!empty($failureMap) ? $failureMap : true); - } - - /** - * Retrieves a field from the object by name passed in as a string. - * - * @param string $name name - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return mixed Value of field. - */ - public function getByName($name, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcTransPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - $field = $this->getByPosition($pos); - return $field; - } - - /** - * Retrieves a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @return mixed Value of field at $pos - */ - public function getByPosition($pos) - { - switch($pos) { - case 0: - return $this->getId(); - break; - case 1: - return $this->getTrtok(); - break; - case 2: - return $this->getDirection(); - break; - case 3: - return $this->getState(); - break; - case 4: - return $this->getTrtype(); - break; - case 5: - return $this->getLock(); - break; - case 6: - return $this->getTarget(); - break; - case 7: - return $this->getRtrtok(); - break; - case 8: - return $this->getMdtrtok(); - break; - case 9: - return $this->getGunid(); - break; - case 10: - return $this->getPdtoken(); - break; - case 11: - return $this->getUrl(); - break; - case 12: - return $this->getLocalfile(); - break; - case 13: - return $this->getFname(); - break; - case 14: - return $this->getTitle(); - break; - case 15: - return $this->getExpectedsum(); - break; - case 16: - return $this->getRealsum(); - break; - case 17: - return $this->getExpectedsize(); - break; - case 18: - return $this->getRealsize(); - break; - case 19: - return $this->getUid(); - break; - case 20: - return $this->getErrmsg(); - break; - case 21: - return $this->getJobpid(); - break; - case 22: - return $this->getStart(); - break; - case 23: - return $this->getTs(); - break; - default: - return null; - break; - } // switch() - } - - /** - * Exports the object as an array. - * - * You can specify the key type of the array by passing one of the class - * type constants. - * - * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * Defaults to BasePeer::TYPE_PHPNAME. - * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE. - * - * @return array an associative array containing the field names (as keys) and field values - */ - public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true) - { - $keys = CcTransPeer::getFieldNames($keyType); - $result = array( - $keys[0] => $this->getId(), - $keys[1] => $this->getTrtok(), - $keys[2] => $this->getDirection(), - $keys[3] => $this->getState(), - $keys[4] => $this->getTrtype(), - $keys[5] => $this->getLock(), - $keys[6] => $this->getTarget(), - $keys[7] => $this->getRtrtok(), - $keys[8] => $this->getMdtrtok(), - $keys[9] => $this->getGunid(), - $keys[10] => $this->getPdtoken(), - $keys[11] => $this->getUrl(), - $keys[12] => $this->getLocalfile(), - $keys[13] => $this->getFname(), - $keys[14] => $this->getTitle(), - $keys[15] => $this->getExpectedsum(), - $keys[16] => $this->getRealsum(), - $keys[17] => $this->getExpectedsize(), - $keys[18] => $this->getRealsize(), - $keys[19] => $this->getUid(), - $keys[20] => $this->getErrmsg(), - $keys[21] => $this->getJobpid(), - $keys[22] => $this->getStart(), - $keys[23] => $this->getTs(), - ); - return $result; - } - - /** - * Sets a field from the object by name passed in as a string. - * - * @param string $name peer name - * @param mixed $value field value - * @param string $type The type of fieldname the $name is of: - * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM - * @return void - */ - public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME) - { - $pos = CcTransPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM); - return $this->setByPosition($pos, $value); - } - - /** - * Sets a field from the object by Position as specified in the xml schema. - * Zero-based. - * - * @param int $pos position in xml schema - * @param mixed $value field value - * @return void - */ - public function setByPosition($pos, $value) - { - switch($pos) { - case 0: - $this->setId($value); - break; - case 1: - $this->setTrtok($value); - break; - case 2: - $this->setDirection($value); - break; - case 3: - $this->setState($value); - break; - case 4: - $this->setTrtype($value); - break; - case 5: - $this->setLock($value); - break; - case 6: - $this->setTarget($value); - break; - case 7: - $this->setRtrtok($value); - break; - case 8: - $this->setMdtrtok($value); - break; - case 9: - $this->setGunid($value); - break; - case 10: - $this->setPdtoken($value); - break; - case 11: - $this->setUrl($value); - break; - case 12: - $this->setLocalfile($value); - break; - case 13: - $this->setFname($value); - break; - case 14: - $this->setTitle($value); - break; - case 15: - $this->setExpectedsum($value); - break; - case 16: - $this->setRealsum($value); - break; - case 17: - $this->setExpectedsize($value); - break; - case 18: - $this->setRealsize($value); - break; - case 19: - $this->setUid($value); - break; - case 20: - $this->setErrmsg($value); - break; - case 21: - $this->setJobpid($value); - break; - case 22: - $this->setStart($value); - break; - case 23: - $this->setTs($value); - break; - } // switch() - } - - /** - * Populates the object using an array. - * - * This is particularly useful when populating an object from one of the - * request arrays (e.g. $_POST). This method goes through the column - * names, checking to see whether a matching key exists in populated - * array. If so the setByName() method is called for that column. - * - * You can specify the key type of the array by additionally passing one - * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, - * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. - * The default key type is the column's phpname (e.g. 'AuthorId') - * - * @param array $arr An array to populate the object from. - * @param string $keyType The type of keys the array uses. - * @return void - */ - public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) - { - $keys = CcTransPeer::getFieldNames($keyType); - - if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); - if (array_key_exists($keys[1], $arr)) $this->setTrtok($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setDirection($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setState($arr[$keys[3]]); - if (array_key_exists($keys[4], $arr)) $this->setTrtype($arr[$keys[4]]); - if (array_key_exists($keys[5], $arr)) $this->setLock($arr[$keys[5]]); - if (array_key_exists($keys[6], $arr)) $this->setTarget($arr[$keys[6]]); - if (array_key_exists($keys[7], $arr)) $this->setRtrtok($arr[$keys[7]]); - if (array_key_exists($keys[8], $arr)) $this->setMdtrtok($arr[$keys[8]]); - if (array_key_exists($keys[9], $arr)) $this->setGunid($arr[$keys[9]]); - if (array_key_exists($keys[10], $arr)) $this->setPdtoken($arr[$keys[10]]); - if (array_key_exists($keys[11], $arr)) $this->setUrl($arr[$keys[11]]); - if (array_key_exists($keys[12], $arr)) $this->setLocalfile($arr[$keys[12]]); - if (array_key_exists($keys[13], $arr)) $this->setFname($arr[$keys[13]]); - if (array_key_exists($keys[14], $arr)) $this->setTitle($arr[$keys[14]]); - if (array_key_exists($keys[15], $arr)) $this->setExpectedsum($arr[$keys[15]]); - if (array_key_exists($keys[16], $arr)) $this->setRealsum($arr[$keys[16]]); - if (array_key_exists($keys[17], $arr)) $this->setExpectedsize($arr[$keys[17]]); - if (array_key_exists($keys[18], $arr)) $this->setRealsize($arr[$keys[18]]); - if (array_key_exists($keys[19], $arr)) $this->setUid($arr[$keys[19]]); - if (array_key_exists($keys[20], $arr)) $this->setErrmsg($arr[$keys[20]]); - if (array_key_exists($keys[21], $arr)) $this->setJobpid($arr[$keys[21]]); - if (array_key_exists($keys[22], $arr)) $this->setStart($arr[$keys[22]]); - if (array_key_exists($keys[23], $arr)) $this->setTs($arr[$keys[23]]); - } - - /** - * Build a Criteria object containing the values of all modified columns in this object. - * - * @return Criteria The Criteria object containing all modified values. - */ - public function buildCriteria() - { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - - if ($this->isColumnModified(CcTransPeer::ID)) $criteria->add(CcTransPeer::ID, $this->id); - if ($this->isColumnModified(CcTransPeer::TRTOK)) $criteria->add(CcTransPeer::TRTOK, $this->trtok); - if ($this->isColumnModified(CcTransPeer::DIRECTION)) $criteria->add(CcTransPeer::DIRECTION, $this->direction); - if ($this->isColumnModified(CcTransPeer::STATE)) $criteria->add(CcTransPeer::STATE, $this->state); - if ($this->isColumnModified(CcTransPeer::TRTYPE)) $criteria->add(CcTransPeer::TRTYPE, $this->trtype); - if ($this->isColumnModified(CcTransPeer::LOCK)) $criteria->add(CcTransPeer::LOCK, $this->lock); - if ($this->isColumnModified(CcTransPeer::TARGET)) $criteria->add(CcTransPeer::TARGET, $this->target); - if ($this->isColumnModified(CcTransPeer::RTRTOK)) $criteria->add(CcTransPeer::RTRTOK, $this->rtrtok); - if ($this->isColumnModified(CcTransPeer::MDTRTOK)) $criteria->add(CcTransPeer::MDTRTOK, $this->mdtrtok); - if ($this->isColumnModified(CcTransPeer::GUNID)) $criteria->add(CcTransPeer::GUNID, $this->gunid); - if ($this->isColumnModified(CcTransPeer::PDTOKEN)) $criteria->add(CcTransPeer::PDTOKEN, $this->pdtoken); - if ($this->isColumnModified(CcTransPeer::URL)) $criteria->add(CcTransPeer::URL, $this->url); - if ($this->isColumnModified(CcTransPeer::LOCALFILE)) $criteria->add(CcTransPeer::LOCALFILE, $this->localfile); - if ($this->isColumnModified(CcTransPeer::FNAME)) $criteria->add(CcTransPeer::FNAME, $this->fname); - if ($this->isColumnModified(CcTransPeer::TITLE)) $criteria->add(CcTransPeer::TITLE, $this->title); - if ($this->isColumnModified(CcTransPeer::EXPECTEDSUM)) $criteria->add(CcTransPeer::EXPECTEDSUM, $this->expectedsum); - if ($this->isColumnModified(CcTransPeer::REALSUM)) $criteria->add(CcTransPeer::REALSUM, $this->realsum); - if ($this->isColumnModified(CcTransPeer::EXPECTEDSIZE)) $criteria->add(CcTransPeer::EXPECTEDSIZE, $this->expectedsize); - if ($this->isColumnModified(CcTransPeer::REALSIZE)) $criteria->add(CcTransPeer::REALSIZE, $this->realsize); - if ($this->isColumnModified(CcTransPeer::UID)) $criteria->add(CcTransPeer::UID, $this->uid); - if ($this->isColumnModified(CcTransPeer::ERRMSG)) $criteria->add(CcTransPeer::ERRMSG, $this->errmsg); - if ($this->isColumnModified(CcTransPeer::JOBPID)) $criteria->add(CcTransPeer::JOBPID, $this->jobpid); - if ($this->isColumnModified(CcTransPeer::START)) $criteria->add(CcTransPeer::START, $this->start); - if ($this->isColumnModified(CcTransPeer::TS)) $criteria->add(CcTransPeer::TS, $this->ts); - - return $criteria; - } - - /** - * Builds a Criteria object containing the primary key for this object. - * - * Unlike buildCriteria() this method includes the primary key values regardless - * of whether or not they have been modified. - * - * @return Criteria The Criteria object containing value(s) for primary key(s). - */ - public function buildPkeyCriteria() - { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $this->id); - - return $criteria; - } - - /** - * Returns the primary key for this object (row). - * @return int - */ - public function getPrimaryKey() - { - return $this->getId(); - } - - /** - * Generic method to set the primary key (id column). - * - * @param int $key Primary key. - * @return void - */ - public function setPrimaryKey($key) - { - $this->setId($key); - } - - /** - * Returns true if the primary key for this object is null. - * @return boolean - */ - public function isPrimaryKeyNull() - { - return null === $this->getId(); - } - - /** - * Sets contents of passed object to values from current object. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param object $copyObj An object of CcTrans (or compatible) type. - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @throws PropelException - */ - public function copyInto($copyObj, $deepCopy = false) - { - $copyObj->setTrtok($this->trtok); - $copyObj->setDirection($this->direction); - $copyObj->setState($this->state); - $copyObj->setTrtype($this->trtype); - $copyObj->setLock($this->lock); - $copyObj->setTarget($this->target); - $copyObj->setRtrtok($this->rtrtok); - $copyObj->setMdtrtok($this->mdtrtok); - $copyObj->setGunid($this->gunid); - $copyObj->setPdtoken($this->pdtoken); - $copyObj->setUrl($this->url); - $copyObj->setLocalfile($this->localfile); - $copyObj->setFname($this->fname); - $copyObj->setTitle($this->title); - $copyObj->setExpectedsum($this->expectedsum); - $copyObj->setRealsum($this->realsum); - $copyObj->setExpectedsize($this->expectedsize); - $copyObj->setRealsize($this->realsize); - $copyObj->setUid($this->uid); - $copyObj->setErrmsg($this->errmsg); - $copyObj->setJobpid($this->jobpid); - $copyObj->setStart($this->start); - $copyObj->setTs($this->ts); - - $copyObj->setNew(true); - $copyObj->setId(NULL); // this is a auto-increment column, so set to default value - } - - /** - * Makes a copy of this object that will be inserted as a new row in table when saved. - * It creates a new object filling in the simple attributes, but skipping any primary - * keys that are defined for the table. - * - * If desired, this method can also make copies of all associated (fkey referrers) - * objects. - * - * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. - * @return CcTrans Clone of current object. - * @throws PropelException - */ - public function copy($deepCopy = false) - { - // we use get_class(), because this might be a subclass - $clazz = get_class($this); - $copyObj = new $clazz(); - $this->copyInto($copyObj, $deepCopy); - return $copyObj; - } - - /** - * Returns a peer instance associated with this om. - * - * Since Peer classes are not to have any instance attributes, this method returns the - * same instance for all member of this class. The method could therefore - * be static, but this would prevent one from overriding the behavior. - * - * @return CcTransPeer - */ - public function getPeer() - { - if (self::$peer === null) { - self::$peer = new CcTransPeer(); - } - return self::$peer; - } - - /** - * Clears the current object and sets all attributes to their default values - */ - public function clear() - { - $this->id = null; - $this->trtok = null; - $this->direction = null; - $this->state = null; - $this->trtype = null; - $this->lock = null; - $this->target = null; - $this->rtrtok = null; - $this->mdtrtok = null; - $this->gunid = null; - $this->pdtoken = null; - $this->url = null; - $this->localfile = null; - $this->fname = null; - $this->title = null; - $this->expectedsum = null; - $this->realsum = null; - $this->expectedsize = null; - $this->realsize = null; - $this->uid = null; - $this->errmsg = null; - $this->jobpid = null; - $this->start = null; - $this->ts = null; - $this->alreadyInSave = false; - $this->alreadyInValidation = false; - $this->clearAllReferences(); - $this->applyDefaultValues(); - $this->resetModified(); - $this->setNew(true); - $this->setDeleted(false); - } - - /** - * Resets all collections of referencing foreign keys. - * - * This method is a user-space workaround for PHP's inability to garbage collect objects - * with circular references. This is currently necessary when using Propel in certain - * daemon or large-volumne/high-memory operations. - * - * @param boolean $deep Whether to also clear the references on all associated objects. - */ - public function clearAllReferences($deep = false) - { - if ($deep) { - } // if ($deep) - - } - - /** - * Catches calls to virtual methods - */ - public function __call($name, $params) - { - if (preg_match('/get(\w+)/', $name, $matches)) { - $virtualColumn = $matches[1]; - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - // no lcfirst in php<5.3... - $virtualColumn[0] = strtolower($virtualColumn[0]); - if ($this->hasVirtualColumn($virtualColumn)) { - return $this->getVirtualColumn($virtualColumn); - } - } - throw new PropelException('Call to undefined method: ' . $name); - } - -} // BaseCcTrans diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransPeer.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransPeer.php deleted file mode 100644 index bac6b9ed8..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransPeer.php +++ /dev/null @@ -1,849 +0,0 @@ - array ('Id', 'Trtok', 'Direction', 'State', 'Trtype', 'Lock', 'Target', 'Rtrtok', 'Mdtrtok', 'Gunid', 'Pdtoken', 'Url', 'Localfile', 'Fname', 'Title', 'Expectedsum', 'Realsum', 'Expectedsize', 'Realsize', 'Uid', 'Errmsg', 'Jobpid', 'Start', 'Ts', ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ), - BasePeer::TYPE_COLNAME => array (self::ID, self::TRTOK, self::DIRECTION, self::STATE, self::TRTYPE, self::LOCK, self::TARGET, self::RTRTOK, self::MDTRTOK, self::GUNID, self::PDTOKEN, self::URL, self::LOCALFILE, self::FNAME, self::TITLE, self::EXPECTEDSUM, self::REALSUM, self::EXPECTEDSIZE, self::REALSIZE, self::UID, self::ERRMSG, self::JOBPID, self::START, self::TS, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TRTOK', 'DIRECTION', 'STATE', 'TRTYPE', 'LOCK', 'TARGET', 'RTRTOK', 'MDTRTOK', 'GUNID', 'PDTOKEN', 'URL', 'LOCALFILE', 'FNAME', 'TITLE', 'EXPECTEDSUM', 'REALSUM', 'EXPECTEDSIZE', 'REALSIZE', 'UID', 'ERRMSG', 'JOBPID', 'START', 'TS', ), - BasePeer::TYPE_FIELDNAME => array ('id', 'trtok', 'direction', 'state', 'trtype', 'lock', 'target', 'rtrtok', 'mdtrtok', 'gunid', 'pdtoken', 'url', 'localfile', 'fname', 'title', 'expectedsum', 'realsum', 'expectedsize', 'realsize', 'uid', 'errmsg', 'jobpid', 'start', 'ts', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) - ); - - /** - * 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 ('Id' => 0, 'Trtok' => 1, 'Direction' => 2, 'State' => 3, 'Trtype' => 4, 'Lock' => 5, 'Target' => 6, 'Rtrtok' => 7, 'Mdtrtok' => 8, 'Gunid' => 9, 'Pdtoken' => 10, 'Url' => 11, 'Localfile' => 12, 'Fname' => 13, 'Title' => 14, 'Expectedsum' => 15, 'Realsum' => 16, 'Expectedsize' => 17, 'Realsize' => 18, 'Uid' => 19, 'Errmsg' => 20, 'Jobpid' => 21, 'Start' => 22, 'Ts' => 23, ), - BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ), - BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TRTOK => 1, self::DIRECTION => 2, self::STATE => 3, self::TRTYPE => 4, self::LOCK => 5, self::TARGET => 6, self::RTRTOK => 7, self::MDTRTOK => 8, self::GUNID => 9, self::PDTOKEN => 10, self::URL => 11, self::LOCALFILE => 12, self::FNAME => 13, self::TITLE => 14, self::EXPECTEDSUM => 15, self::REALSUM => 16, self::EXPECTEDSIZE => 17, self::REALSIZE => 18, self::UID => 19, self::ERRMSG => 20, self::JOBPID => 21, self::START => 22, self::TS => 23, ), - BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TRTOK' => 1, 'DIRECTION' => 2, 'STATE' => 3, 'TRTYPE' => 4, 'LOCK' => 5, 'TARGET' => 6, 'RTRTOK' => 7, 'MDTRTOK' => 8, 'GUNID' => 9, 'PDTOKEN' => 10, 'URL' => 11, 'LOCALFILE' => 12, 'FNAME' => 13, 'TITLE' => 14, 'EXPECTEDSUM' => 15, 'REALSUM' => 16, 'EXPECTEDSIZE' => 17, 'REALSIZE' => 18, 'UID' => 19, 'ERRMSG' => 20, 'JOBPID' => 21, 'START' => 22, 'TS' => 23, ), - BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'trtok' => 1, 'direction' => 2, 'state' => 3, 'trtype' => 4, 'lock' => 5, 'target' => 6, 'rtrtok' => 7, 'mdtrtok' => 8, 'gunid' => 9, 'pdtoken' => 10, 'url' => 11, 'localfile' => 12, 'fname' => 13, 'title' => 14, 'expectedsum' => 15, 'realsum' => 16, 'expectedsize' => 17, 'realsize' => 18, 'uid' => 19, 'errmsg' => 20, 'jobpid' => 21, 'start' => 22, 'ts' => 23, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, ) - ); - - /** - * 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. - * - * $c->addAlias("alias1", TablePeer::TABLE_NAME); - * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN); - * - * @param string $alias The alias for the current table. - * @param string $column The column name for current table. (i.e. CcTransPeer::COLUMN_NAME). - * @return string - */ - public static function alias($alias, $column) - { - return str_replace(CcTransPeer::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(CcTransPeer::ID); - $criteria->addSelectColumn(CcTransPeer::TRTOK); - $criteria->addSelectColumn(CcTransPeer::DIRECTION); - $criteria->addSelectColumn(CcTransPeer::STATE); - $criteria->addSelectColumn(CcTransPeer::TRTYPE); - $criteria->addSelectColumn(CcTransPeer::LOCK); - $criteria->addSelectColumn(CcTransPeer::TARGET); - $criteria->addSelectColumn(CcTransPeer::RTRTOK); - $criteria->addSelectColumn(CcTransPeer::MDTRTOK); - $criteria->addSelectColumn(CcTransPeer::GUNID); - $criteria->addSelectColumn(CcTransPeer::PDTOKEN); - $criteria->addSelectColumn(CcTransPeer::URL); - $criteria->addSelectColumn(CcTransPeer::LOCALFILE); - $criteria->addSelectColumn(CcTransPeer::FNAME); - $criteria->addSelectColumn(CcTransPeer::TITLE); - $criteria->addSelectColumn(CcTransPeer::EXPECTEDSUM); - $criteria->addSelectColumn(CcTransPeer::REALSUM); - $criteria->addSelectColumn(CcTransPeer::EXPECTEDSIZE); - $criteria->addSelectColumn(CcTransPeer::REALSIZE); - $criteria->addSelectColumn(CcTransPeer::UID); - $criteria->addSelectColumn(CcTransPeer::ERRMSG); - $criteria->addSelectColumn(CcTransPeer::JOBPID); - $criteria->addSelectColumn(CcTransPeer::START); - $criteria->addSelectColumn(CcTransPeer::TS); - } else { - $criteria->addSelectColumn($alias . '.ID'); - $criteria->addSelectColumn($alias . '.TRTOK'); - $criteria->addSelectColumn($alias . '.DIRECTION'); - $criteria->addSelectColumn($alias . '.STATE'); - $criteria->addSelectColumn($alias . '.TRTYPE'); - $criteria->addSelectColumn($alias . '.LOCK'); - $criteria->addSelectColumn($alias . '.TARGET'); - $criteria->addSelectColumn($alias . '.RTRTOK'); - $criteria->addSelectColumn($alias . '.MDTRTOK'); - $criteria->addSelectColumn($alias . '.GUNID'); - $criteria->addSelectColumn($alias . '.PDTOKEN'); - $criteria->addSelectColumn($alias . '.URL'); - $criteria->addSelectColumn($alias . '.LOCALFILE'); - $criteria->addSelectColumn($alias . '.FNAME'); - $criteria->addSelectColumn($alias . '.TITLE'); - $criteria->addSelectColumn($alias . '.EXPECTEDSUM'); - $criteria->addSelectColumn($alias . '.REALSUM'); - $criteria->addSelectColumn($alias . '.EXPECTEDSIZE'); - $criteria->addSelectColumn($alias . '.REALSIZE'); - $criteria->addSelectColumn($alias . '.UID'); - $criteria->addSelectColumn($alias . '.ERRMSG'); - $criteria->addSelectColumn($alias . '.JOBPID'); - $criteria->addSelectColumn($alias . '.START'); - $criteria->addSelectColumn($alias . '.TS'); - } - } - - /** - * 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(CcTransPeer::TABLE_NAME); - - if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) { - $criteria->setDistinct(); - } - - if (!$criteria->hasSelectClause()) { - CcTransPeer::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(CcTransPeer::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 CcTrans - * @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 = CcTransPeer::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 CcTransPeer::populateObjects(CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - if (!$criteria->hasSelectClause()) { - $criteria = clone $criteria; - CcTransPeer::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 CcTrans $value A CcTrans object. - * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). - */ - public static function addInstanceToPool(CcTrans $obj, $key = null) - { - if (Propel::isInstancePoolingEnabled()) { - if ($key === null) { - $key = (string) $obj->getId(); - } // 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 CcTrans object or a primary key value. - */ - public static function removeInstanceFromPool($value) - { - if (Propel::isInstancePoolingEnabled() && $value !== null) { - if (is_object($value) && $value instanceof CcTrans) { - $key = (string) $value->getId(); - } 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 CcTrans 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 CcTrans 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_trans - * by a foreign key with ON DELETE CASCADE - */ - public static function clearRelatedInstancePool() - { - } - - /** - * 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 = CcTransPeer::getOMClass(false); - // populate the object(s) - while ($row = $stmt->fetch(PDO::FETCH_NUM)) { - $key = CcTransPeer::getPrimaryKeyHashFromRow($row, 0); - if (null !== ($obj = CcTransPeer::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; - CcTransPeer::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 (CcTrans object, last column rank) - */ - public static function populateObject($row, $startcol = 0) - { - $key = CcTransPeer::getPrimaryKeyHashFromRow($row, $startcol); - if (null !== ($obj = CcTransPeer::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 + CcTransPeer::NUM_COLUMNS; - } else { - $cls = CcTransPeer::OM_CLASS; - $obj = new $cls(); - $col = $obj->hydrate($row, $startcol); - CcTransPeer::addInstanceToPool($obj, $key); - } - return array($obj, $col); - } - /** - * 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(BaseCcTransPeer::DATABASE_NAME); - if (!$dbMap->hasTable(BaseCcTransPeer::TABLE_NAME)) - { - $dbMap->addTableObject(new CcTransTableMap()); - } - } - - /** - * 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 ? CcTransPeer::CLASS_DEFAULT : CcTransPeer::OM_CLASS; - } - - /** - * Method perform an INSERT on the database, given a CcTrans or Criteria object. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - } else { - $criteria = $values->buildCriteria(); // build Criteria from CcTrans object - } - - if ($criteria->containsKey(CcTransPeer::ID) && $criteria->keyContainsValue(CcTransPeer::ID) ) { - throw new PropelException('Cannot insert a value for auto-increment primary key ('.CcTransPeer::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 CcTrans or Criteria object. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); - } - - $selectCriteria = new Criteria(self::DATABASE_NAME); - - if ($values instanceof Criteria) { - $criteria = clone $values; // rename for clarity - - $comparison = $criteria->getComparison(CcTransPeer::ID); - $value = $criteria->remove(CcTransPeer::ID); - if ($value) { - $selectCriteria->add(CcTransPeer::ID, $value, $comparison); - } else { - $selectCriteria->setPrimaryTableName(CcTransPeer::TABLE_NAME); - } - - } else { // $values is CcTrans 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_trans 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(CcTransPeer::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(CcTransPeer::TABLE_NAME, $con, CcTransPeer::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). - CcTransPeer::clearInstancePool(); - CcTransPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Method perform a DELETE on the database, given a CcTrans or Criteria object OR a primary key value. - * - * @param mixed $values Criteria or CcTrans 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(CcTransPeer::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. - CcTransPeer::clearInstancePool(); - // rename for clarity - $criteria = clone $values; - } elseif ($values instanceof CcTrans) { // it's a model object - // invalidate the cache for this single object - CcTransPeer::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(CcTransPeer::ID, (array) $values, Criteria::IN); - // invalidate the cache for this object(s) - foreach ((array) $values as $singleval) { - CcTransPeer::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); - CcTransPeer::clearRelatedInstancePool(); - $con->commit(); - return $affectedRows; - } catch (PropelException $e) { - $con->rollBack(); - throw $e; - } - } - - /** - * Validates all modified columns of given CcTrans 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 CcTrans $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(CcTrans $obj, $cols = null) - { - $columns = array(); - - if ($cols) { - $dbMap = Propel::getDatabaseMap(CcTransPeer::DATABASE_NAME); - $tableMap = $dbMap->getTable(CcTransPeer::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(CcTransPeer::DATABASE_NAME, CcTransPeer::TABLE_NAME, $columns); - } - - /** - * Retrieve a single object by pkey. - * - * @param int $pk the primary key. - * @param PropelPDO $con the connection to use - * @return CcTrans - */ - public static function retrieveByPK($pk, PropelPDO $con = null) - { - - if (null !== ($obj = CcTransPeer::getInstanceFromPool((string) $pk))) { - return $obj; - } - - if ($con === null) { - $con = Propel::getConnection(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $pk); - - $v = CcTransPeer::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(CcTransPeer::DATABASE_NAME, Propel::CONNECTION_READ); - } - - $objs = null; - if (empty($pks)) { - $objs = array(); - } else { - $criteria = new Criteria(CcTransPeer::DATABASE_NAME); - $criteria->add(CcTransPeer::ID, $pks, Criteria::IN); - $objs = CcTransPeer::doSelect($criteria, $con); - } - return $objs; - } - -} // BaseCcTransPeer - -// This is the static code needed to register the TableMap for this table with the main Propel class. -// -BaseCcTransPeer::buildTableMap(); - diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransQuery.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransQuery.php deleted file mode 100644 index 0bbccae2f..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/BaseCcTransQuery.php +++ /dev/null @@ -1,826 +0,0 @@ -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 - * - * $obj = $c->findPk(12, $con); - * - * @param mixed $key Primary key to use for the query - * @param PropelPDO $con an optional connection object - * - * @return CcTrans|array|mixed the result, formatted by the current formatter - */ - public function findPk($key, $con = null) - { - if ((null !== ($obj = CcTransPeer::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 - * - * $objs = $c->findPks(array(12, 56, 832), $con); - * - * @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 CcTransQuery The current query, for fluid interface - */ - public function filterByPrimaryKey($key) - { - return $this->addUsingAlias(CcTransPeer::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 CcTransQuery The current query, for fluid interface - */ - public function filterByPrimaryKeys($keys) - { - return $this->addUsingAlias(CcTransPeer::ID, $keys, Criteria::IN); - } - - /** - * Filter the query on the id column - * - * @param int|array $id 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 CcTransQuery The current query, for fluid interface - */ - public function filterById($id = null, $comparison = null) - { - if (is_array($id) && null === $comparison) { - $comparison = Criteria::IN; - } - return $this->addUsingAlias(CcTransPeer::ID, $id, $comparison); - } - - /** - * Filter the query on the trtok column - * - * @param string $trtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTrtok($trtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($trtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $trtok)) { - $trtok = str_replace('*', '%', $trtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TRTOK, $trtok, $comparison); - } - - /** - * Filter the query on the direction column - * - * @param string $direction The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByDirection($direction = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($direction)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $direction)) { - $direction = str_replace('*', '%', $direction); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::DIRECTION, $direction, $comparison); - } - - /** - * Filter the query on the state column - * - * @param string $state The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByState($state = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($state)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $state)) { - $state = str_replace('*', '%', $state); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::STATE, $state, $comparison); - } - - /** - * Filter the query on the trtype column - * - * @param string $trtype The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTrtype($trtype = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($trtype)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $trtype)) { - $trtype = str_replace('*', '%', $trtype); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TRTYPE, $trtype, $comparison); - } - - /** - * Filter the query on the lock column - * - * @param string $lock The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByLock($lock = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($lock)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $lock)) { - $lock = str_replace('*', '%', $lock); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::LOCK, $lock, $comparison); - } - - /** - * Filter the query on the target column - * - * @param string $target The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTarget($target = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($target)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $target)) { - $target = str_replace('*', '%', $target); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TARGET, $target, $comparison); - } - - /** - * Filter the query on the rtrtok column - * - * @param string $rtrtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByRtrtok($rtrtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($rtrtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $rtrtok)) { - $rtrtok = str_replace('*', '%', $rtrtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::RTRTOK, $rtrtok, $comparison); - } - - /** - * Filter the query on the mdtrtok column - * - * @param string $mdtrtok The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByMdtrtok($mdtrtok = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($mdtrtok)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $mdtrtok)) { - $mdtrtok = str_replace('*', '%', $mdtrtok); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::MDTRTOK, $mdtrtok, $comparison); - } - - /** - * Filter the query on the gunid column - * - * @param string $gunid The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByGunid($gunid = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($gunid)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $gunid)) { - $gunid = str_replace('*', '%', $gunid); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::GUNID, $gunid, $comparison); - } - - /** - * Filter the query on the pdtoken column - * - * @param string|array $pdtoken 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 CcTransQuery The current query, for fluid interface - */ - public function filterByPdtoken($pdtoken = null, $comparison = null) - { - if (is_array($pdtoken)) { - $useMinMax = false; - if (isset($pdtoken['min'])) { - $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($pdtoken['max'])) { - $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::PDTOKEN, $pdtoken, $comparison); - } - - /** - * Filter the query on the url column - * - * @param string $url The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByUrl($url = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($url)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $url)) { - $url = str_replace('*', '%', $url); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::URL, $url, $comparison); - } - - /** - * Filter the query on the localfile column - * - * @param string $localfile The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByLocalfile($localfile = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($localfile)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $localfile)) { - $localfile = str_replace('*', '%', $localfile); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::LOCALFILE, $localfile, $comparison); - } - - /** - * Filter the query on the fname column - * - * @param string $fname The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByFname($fname = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($fname)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $fname)) { - $fname = str_replace('*', '%', $fname); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::FNAME, $fname, $comparison); - } - - /** - * Filter the query on the title column - * - * @param string $title The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByTitle($title = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($title)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $title)) { - $title = str_replace('*', '%', $title); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::TITLE, $title, $comparison); - } - - /** - * Filter the query on the expectedsum column - * - * @param string $expectedsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByExpectedsum($expectedsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($expectedsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $expectedsum)) { - $expectedsum = str_replace('*', '%', $expectedsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::EXPECTEDSUM, $expectedsum, $comparison); - } - - /** - * Filter the query on the realsum column - * - * @param string $realsum The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByRealsum($realsum = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($realsum)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $realsum)) { - $realsum = str_replace('*', '%', $realsum); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::REALSUM, $realsum, $comparison); - } - - /** - * Filter the query on the expectedsize column - * - * @param int|array $expectedsize 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 CcTransQuery The current query, for fluid interface - */ - public function filterByExpectedsize($expectedsize = null, $comparison = null) - { - if (is_array($expectedsize)) { - $useMinMax = false; - if (isset($expectedsize['min'])) { - $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($expectedsize['max'])) { - $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::EXPECTEDSIZE, $expectedsize, $comparison); - } - - /** - * Filter the query on the realsize column - * - * @param int|array $realsize 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 CcTransQuery The current query, for fluid interface - */ - public function filterByRealsize($realsize = null, $comparison = null) - { - if (is_array($realsize)) { - $useMinMax = false; - if (isset($realsize['min'])) { - $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($realsize['max'])) { - $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::REALSIZE, $realsize, $comparison); - } - - /** - * Filter the query on the uid column - * - * @param int|array $uid 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 CcTransQuery The current query, for fluid interface - */ - public function filterByUid($uid = null, $comparison = null) - { - if (is_array($uid)) { - $useMinMax = false; - if (isset($uid['min'])) { - $this->addUsingAlias(CcTransPeer::UID, $uid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($uid['max'])) { - $this->addUsingAlias(CcTransPeer::UID, $uid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::UID, $uid, $comparison); - } - - /** - * Filter the query on the errmsg column - * - * @param string $errmsg The value to use as filter. - * Accepts wildcards (* and % trigger a LIKE) - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return CcTransQuery The current query, for fluid interface - */ - public function filterByErrmsg($errmsg = null, $comparison = null) - { - if (null === $comparison) { - if (is_array($errmsg)) { - $comparison = Criteria::IN; - } elseif (preg_match('/[\%\*]/', $errmsg)) { - $errmsg = str_replace('*', '%', $errmsg); - $comparison = Criteria::LIKE; - } - } - return $this->addUsingAlias(CcTransPeer::ERRMSG, $errmsg, $comparison); - } - - /** - * Filter the query on the jobpid column - * - * @param int|array $jobpid 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 CcTransQuery The current query, for fluid interface - */ - public function filterByJobpid($jobpid = null, $comparison = null) - { - if (is_array($jobpid)) { - $useMinMax = false; - if (isset($jobpid['min'])) { - $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($jobpid['max'])) { - $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::JOBPID, $jobpid, $comparison); - } - - /** - * Filter the query on the start column - * - * @param string|array $start 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 CcTransQuery The current query, for fluid interface - */ - public function filterByStart($start = null, $comparison = null) - { - if (is_array($start)) { - $useMinMax = false; - if (isset($start['min'])) { - $this->addUsingAlias(CcTransPeer::START, $start['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($start['max'])) { - $this->addUsingAlias(CcTransPeer::START, $start['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::START, $start, $comparison); - } - - /** - * Filter the query on the ts column - * - * @param string|array $ts 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 CcTransQuery The current query, for fluid interface - */ - public function filterByTs($ts = null, $comparison = null) - { - if (is_array($ts)) { - $useMinMax = false; - if (isset($ts['min'])) { - $this->addUsingAlias(CcTransPeer::TS, $ts['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($ts['max'])) { - $this->addUsingAlias(CcTransPeer::TS, $ts['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - return $this->addUsingAlias(CcTransPeer::TS, $ts, $comparison); - } - - /** - * Exclude object from result - * - * @param CcTrans $ccTrans Object to remove from the list of results - * - * @return CcTransQuery The current query, for fluid interface - */ - public function prune($ccTrans = null) - { - if ($ccTrans) { - $this->addUsingAlias(CcTransPeer::ID, $ccTrans->getId(), Criteria::NOT_EQUAL); - } - - return $this; - } - -} // BaseCcTransQuery diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcFiles.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcFiles.php deleted file mode 100644 index edc51a659..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcFiles.php +++ /dev/null @@ -1,31 +0,0 @@ -length; - } - - public function setDbLength($time) - { - $this->length = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::LENGTH; - return Common::setTimeInSub($this, 'LENGTH', $time); - } - - -} // CcFiles diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylist.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylist.php deleted file mode 100644 index 0d3cff401..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylist.php +++ /dev/null @@ -1,48 +0,0 @@ -prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - public function computeLength() - { - $con = Propel::getConnection(CcPlaylistPeer::DATABASE_NAME); - - $sql = 'SELECT SUM('.CcPlaylistcontentsPeer::CLIPLENGTH.') AS length' - . ' FROM ' .CcPlaylistcontentsPeer::TABLE_NAME - . ' WHERE ' .CcPlaylistcontentsPeer::PLAYLIST_ID. ' = :p1'; - - $stmt = $con->prepare($sql); - $stmt->bindValue(':p1', $this->getDbId()); - $stmt->execute(); - return $stmt->fetchColumn(); - } - - -} // CcPlaylist diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylistcontents.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylistcontents.php deleted file mode 100644 index 1b6417a66..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/CcPlaylistcontents.php +++ /dev/null @@ -1,81 +0,0 @@ -fadein; - } - - public function setDbFadein($time) - { - $this->fadein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN; - Common::setTimeInSub($this, 'FADEIN', $time); - } - - public function getDbFadeout() - { - return $this->fadeout; - } - - public function setDbFadeout($time) - { - $this->fadeout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT; - Common::setTimeInSub($this, 'FADEOUT', $time); - } - - public function getDbCuein() - { - return $this->cuein; - } - - public function setDbCuein($time) - { - $this->cuein = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEIN; - Common::setTimeInSub($this, 'CUEIN', $time); - } - - public function getDbCueout() - { - return $this->cueout; - } - - public function setDbCueout($time) - { - $this->cueout = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CUEOUT; - Common::setTimeInSub($this, 'CUEOUT', $time); - } - - public function getDbCliplength() - { - return $this->cliplength; - } - - public function setDbCliplength($time) - { - $this->cliplength = $time; - //$this->modifiedColumns[] = CcPlaylistcontentsPeer::CLIPLENGTH; - Common::setTimeInSub($this, 'CLIPLENGTH', $time); - } - - - - -} // CcPlaylistcontents diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/Common.php b/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/Common.php deleted file mode 100644 index 3e13c7fa3..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/airtime/om/Common.php +++ /dev/null @@ -1,19 +0,0 @@ -prepare($sql); - $stmt->bindValue(':f1', $time); - $stmt->bindValue(':p1', $row->getDbId()); - $stmt->execute(); - } -} diff --git a/install_minimal/upgrades/airtime-2.0.2/propel/classmap-airtime-conf.php b/install_minimal/upgrades/airtime-2.0.2/propel/classmap-airtime-conf.php deleted file mode 100644 index ef3b99a4b..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/propel/classmap-airtime-conf.php +++ /dev/null @@ -1,144 +0,0 @@ - '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', - 'CcMusicDirsTableMap' => 'airtime/map/CcMusicDirsTableMap.php', - 'CcMusicDirsPeer' => 'airtime/CcMusicDirsPeer.php', - 'CcMusicDirs' => 'airtime/CcMusicDirs.php', - 'CcMusicDirsQuery' => 'airtime/CcMusicDirsQuery.php', - 'BaseCcMusicDirsPeer' => 'airtime/om/BaseCcMusicDirsPeer.php', - 'BaseCcMusicDirs' => 'airtime/om/BaseCcMusicDirs.php', - 'BaseCcMusicDirsQuery' => 'airtime/om/BaseCcMusicDirsQuery.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', - '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', - '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', - 'CcShowRebroadcastTableMap' => 'airtime/map/CcShowRebroadcastTableMap.php', - 'CcShowRebroadcastPeer' => 'airtime/CcShowRebroadcastPeer.php', - 'CcShowRebroadcast' => 'airtime/CcShowRebroadcast.php', - 'CcShowRebroadcastQuery' => 'airtime/CcShowRebroadcastQuery.php', - 'BaseCcShowRebroadcastPeer' => 'airtime/om/BaseCcShowRebroadcastPeer.php', - 'BaseCcShowRebroadcast' => 'airtime/om/BaseCcShowRebroadcast.php', - 'BaseCcShowRebroadcastQuery' => 'airtime/om/BaseCcShowRebroadcastQuery.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', - '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', - 'CcCountryTableMap' => 'airtime/map/CcCountryTableMap.php', - 'CcCountryPeer' => 'airtime/CcCountryPeer.php', - 'CcCountry' => 'airtime/CcCountry.php', - 'CcCountryQuery' => 'airtime/CcCountryQuery.php', - 'BaseCcCountryPeer' => 'airtime/om/BaseCcCountryPeer.php', - 'BaseCcCountry' => 'airtime/om/BaseCcCountry.php', - 'BaseCcCountryQuery' => 'airtime/om/BaseCcCountryQuery.php', - 'CcStreamSettingTableMap' => 'airtime/map/CcStreamSettingTableMap.php', - 'CcStreamSettingPeer' => 'airtime/CcStreamSettingPeer.php', - 'CcStreamSetting' => 'airtime/CcStreamSetting.php', - 'CcStreamSettingQuery' => 'airtime/CcStreamSettingQuery.php', - 'BaseCcStreamSettingPeer' => 'airtime/om/BaseCcStreamSettingPeer.php', - 'BaseCcStreamSetting' => 'airtime/om/BaseCcStreamSetting.php', - 'BaseCcStreamSettingQuery' => 'airtime/om/BaseCcStreamSettingQuery.php', - 'CcLoginAttemptsTableMap' => 'airtime/map/CcLoginAttemptsTableMap.php', - 'CcLoginAttemptsPeer' => 'airtime/CcLoginAttemptsPeer.php', - 'CcLoginAttempts' => 'airtime/CcLoginAttempts.php', - 'CcLoginAttemptsQuery' => 'airtime/CcLoginAttemptsQuery.php', - 'BaseCcLoginAttemptsPeer' => 'airtime/om/BaseCcLoginAttemptsPeer.php', - 'BaseCcLoginAttempts' => 'airtime/om/BaseCcLoginAttempts.php', - 'BaseCcLoginAttemptsQuery' => 'airtime/om/BaseCcLoginAttemptsQuery.php', - 'CcServiceRegisterTableMap' => 'airtime/map/CcServiceRegisterTableMap.php', - 'CcServiceRegisterPeer' => 'airtime/CcServiceRegisterPeer.php', - 'CcServiceRegister' => 'airtime/CcServiceRegister.php', - 'CcServiceRegisterQuery' => 'airtime/CcServiceRegisterQuery.php', - 'BaseCcServiceRegisterPeer' => 'airtime/om/BaseCcServiceRegisterPeer.php', - 'BaseCcServiceRegister' => 'airtime/om/BaseCcServiceRegister.php', - 'BaseCcServiceRegisterQuery' => 'airtime/om/BaseCcServiceRegisterQuery.php', -); \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.0.2/pypo.cfg.202 b/install_minimal/upgrades/airtime-2.0.2/pypo.cfg.202 deleted file mode 100644 index 09ccdb197..000000000 --- a/install_minimal/upgrades/airtime-2.0.2/pypo.cfg.202 +++ /dev/null @@ -1,87 +0,0 @@ -############################################ -# pypo - configuration # -############################################ - -# Set the type of client you are using. -# Currently supported types: -# 1) "obp" = Open Broadcast Platform -# 2) "airtime" -# -api_client = "airtime" - -############################################ -# Cache Directories # -# *include* trailing slash !! # -############################################ -cache_dir = '/var/tmp/airtime/pypo/cache/' -file_dir = '/var/tmp/airtime/pypo/files/' -tmp_dir = '/var/tmp/airtime/pypo/tmp/' - -############################################ -# Setup Directories # -# Do *not* include trailing slash !! # -############################################ -cache_base_dir = '/var/tmp/airtime/pypo' -bin_dir = '/usr/lib/airtime/pypo' -log_base_dir = '/var/log/airtime' -pypo_log_dir = '/var/log/airtime/pypo' -liquidsoap_log_dir = '/var/log/airtime/pypo-liquidsoap' - -############################################ -# Liquidsoap settings # -############################################ -ls_host = '127.0.0.1' -ls_port = '1234' - -############################################ -# RabbitMQ settings # -############################################ -rabbitmq_host = 'localhost' -rabbitmq_user = 'guest' -rabbitmq_password = 'guest' -rabbitmq_vhost = '/' - -############################################ -# pypo preferences # -############################################ -prepare_ahead = 24 #in hours -cache_for = 24 #how long to hold the cache, in hours - -# Poll interval in seconds. -# -# This will rarely need to be changed because any schedule changes are -# automatically sent to pypo immediately. -# -# This is how often the poll script downloads new schedules and files from the -# server in the event that no changes are made to the schedule. -# -poll_interval = 3600 # in seconds. - - -# Push interval in seconds. -# -# This is how often the push script checks whether it has something new to -# push to liquidsoap. -# -# It's hard to imagine a situation where this should be more than 1 second. -# -push_interval = 1 # in seconds - -# 'pre' or 'otf'. 'pre' cues while playlist preparation -# while 'otf' (on the fly) cues while loading into ls -# (needs the post_processor patch) -cue_style = 'pre' - -############################################ -# Recorded Audio settings # -############################################ -record_bitrate = 256 -record_samplerate = 44100 -record_channels = 2 -record_sample_size = 16 - -#can be either ogg|mp3, mp3 recording requires installation of the package "lame" -record_file_type = 'ogg' - -# base path to store recordered shows at -base_recorded_files = '/var/tmp/airtime/show-recorder/' diff --git a/install_minimal/upgrades/airtime-2.0.3/airtime-upgrade.php b/install_minimal/upgrades/airtime-2.0.3/airtime-upgrade.php deleted file mode 100644 index dffd187f8..000000000 --- a/install_minimal/upgrades/airtime-2.0.3/airtime-upgrade.php +++ /dev/null @@ -1,75 +0,0 @@ -&1 | grep -v \"will create implicit index\""); - } -} diff --git a/install_minimal/upgrades/airtime-2.1.0/MiscUpgrade.php b/install_minimal/upgrades/airtime-2.1.0/MiscUpgrade.php deleted file mode 100644 index 0007ea21f..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/MiscUpgrade.php +++ /dev/null @@ -1,24 +0,0 @@ -fetchColumn(); - - date_default_timezone_set($timezone); - } - - public static function connectToDatabase($p_exitOnError = true) - { - try { - $con = Propel::getConnection(); - } catch (Exception $e) { - echo $e->getMessage().PHP_EOL; - echo "Database connection problem.".PHP_EOL; - echo "Check if database exists with corresponding permissions.".PHP_EOL; - if ($p_exitOnError) { - exit(1); - } - return false; - } - return true; - } - - - public static function DbTableExists($p_name) - { - $con = Propel::getConnection(); - try { - $sql = "SELECT * FROM ".$p_name." LIMIT 1"; - $con->query($sql); - } catch (PDOException $e){ - return false; - } - return true; - } - - private static function GetAirtimeSrcDir() - { - return __DIR__."/../../../../airtime_mvc"; - } - - public static function MigrateTablesToVersion($dir, $version) - { - echo "Upgrading database, may take several minutes, please wait".PHP_EOL; - - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/common/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction migrations:migrate $version"; - system($command); - } - - public static function BypassMigrations($dir, $version) - { - $appDir = self::GetAirtimeSrcDir(); - $command = "php --php-ini $dir/../../airtime-php.ini ". - "$appDir/library/doctrine/migrations/doctrine-migrations.phar ". - "--configuration=$dir/common/migrations.xml ". - "--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ". - "--no-interaction --add migrations:version $version"; - system($command); - } - - public static function upgradeConfigFiles(){ - - $configFiles = array(UpgradeCommon::CONF_FILE_AIRTIME, - UpgradeCommon::CONF_FILE_PYPO, - UpgradeCommon::CONF_FILE_LIQUIDSOAP, - UpgradeCommon::CONF_FILE_MEDIAMONITOR, - UpgradeCommon::CONF_FILE_API_CLIENT); - - // Backup the config files - $suffix = date("Ymdhis")."-".UpgradeCommon::VERSION_NUMBER; - foreach ($configFiles as $conf) { - // do not back up monit cfg - if (file_exists($conf)) { - echo "Backing up $conf to $conf$suffix.bak".PHP_EOL; - //copy($conf, $conf.$suffix.".bak"); - exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes - } - } - - self::CreateIniFiles(UpgradeCommon::CONF_BACKUP_SUFFIX); - self::MergeConfigFiles($configFiles, $suffix); - } - - /** - * This function creates the /etc/airtime configuration folder - * and copies the default config files to it. - */ - public static function CreateIniFiles($suffix) - { - if (!file_exists("/etc/airtime/")){ - if (!mkdir("/etc/airtime/", 0755, true)){ - echo "Could not create /etc/airtime/ directory. Exiting."; - exit(1); - } - } - - if (!copy(__DIR__."/../etc/airtime.conf.$suffix", self::CONF_FILE_AIRTIME)){ - echo "Could not copy airtime.conf to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/../etc/pypo.cfg.$suffix", self::CONF_FILE_PYPO)){ - echo "Could not copy pypo.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/../etc/media-monitor.cfg.$suffix", self::CONF_FILE_MEDIAMONITOR)){ - echo "Could not copy meadia-monitor.cfg to /etc/airtime/. Exiting."; - exit(1); - } - if (!copy(__DIR__."/../etc/api_client.cfg.$suffix", self::CONF_FILE_API_CLIENT)){ - echo "Could not copy api_client.cfg to /etc/monit/conf.d/. Exiting."; - exit(1); - } - } - - private static function MergeConfigFiles($configFiles, $suffix) { - foreach ($configFiles as $conf) { - // we want to use new liquidsoap.cfg so don't merge - // also for monit - if( $conf == self::CONF_FILE_LIQUIDSOAP){ - continue; - } - if (file_exists("$conf$suffix.bak")) { - - if($conf === self::CONF_FILE_AIRTIME) { - // Parse with sections - $newSettings = parse_ini_file($conf, true); - $oldSettings = parse_ini_file("$conf$suffix.bak", true); - } - else { - $newSettings = self::ReadPythonConfig($conf); - $oldSettings = self::ReadPythonConfig("$conf$suffix.bak"); - } - - $settings = array_keys($newSettings); - - foreach($settings as $section) { - if(isset($oldSettings[$section])) { - if(is_array($oldSettings[$section])) { - $sectionKeys = array_keys($newSettings[$section]); - foreach($sectionKeys as $sectionKey) { - - if(isset($oldSettings[$section][$sectionKey])) { - self::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]); - } - } - } else { - self::UpdateIniValue($conf, $section, $oldSettings[$section]); - } - } - } - } - } - } - - private static function ReadPythonConfig($p_filename) - { - $values = array(); - - $fh = fopen($p_filename, 'r'); - - while(!feof($fh)){ - $line = fgets($fh); - if(substr(trim($line), 0, 1) == '#' || trim($line) == ""){ - continue; - }else{ - $info = explode('=', $line, 2); - $values[trim($info[0])] = trim($info[1]); - } - } - - return $values; - } - - /** - * This function updates an INI style config file. - * - * A property and the value the property should be changed to are - * supplied. If the property is not found, then no changes are made. - * - * @param string $p_filename - * The path the to the file. - * @param string $p_property - * The property to look for in order to change its value. - * @param string $p_value - * The value the property should be changed to. - * - */ - private static function UpdateIniValue($p_filename, $p_property, $p_value) - { - $lines = file($p_filename); - $n=count($lines); - foreach ($lines as &$line) { - if ($line[0] != "#"){ - $key_value = explode("=", $line); - $key = trim($key_value[0]); - - if ($key == $p_property){ - $line = "$p_property = $p_value".PHP_EOL; - } - } - } - - $fp=fopen($p_filename, 'w'); - for($i=0; $i<$n; $i++){ - fwrite($fp, $lines[$i]); - } - fclose($fp); - } - - public static function queryDb($p_sql){ - $con = Propel::getConnection(); - - try { - $result = $con->query($p_sql); - } catch (Exception $e) { - echo "Error executing $p_sql. Exiting."; - exit(1); - } - - return $result; - } -} diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120402103944.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120402103944.php deleted file mode 100644 index 3d78649d1..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120402103944.php +++ /dev/null @@ -1,26 +0,0 @@ -getTable('cc_music_dirs'); - $cc_music_dirs->addColumn('watched', 'boolean', array('default'=> 'true')); - $cc_music_dirs->addColumn('exists', 'boolean', array('default'=> 'true')); - - $cc_files = $schema->getTable('cc_files'); - $cc_files->addColumn('file_exists', 'boolean', array('default'=> 'true')); - $cc_files->addNamedForeignKeyConstraint('cc_music_dirs_folder_fkey', $cc_music_dirs, array('directory'), array('id')); - $cc_files->addIndex(array('file_exists'), 'cc_files_file_exists_idx'); - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120403143635.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120403143635.php deleted file mode 100644 index f69e84c43..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120403143635.php +++ /dev/null @@ -1,23 +0,0 @@ -getTable('cc_show'); - $cc_show->addColumn('live_stream_using_airtime_auth', 'boolean', array('default'=> 0, 'notnull' => 0)); - $cc_show->addColumn('live_stream_using_custom_auth', 'boolean', array('default'=> 0, 'notnull' => 0)); - $cc_show->addColumn('live_stream_user', 'string', array('default'=> 0, 'notnull' => 0, 'length' => 255)); - $cc_show->addColumn('live_stream_pass', 'string', array('default'=> 0, 'notnull' => 0, 'length' => 255)); - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120405114454.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120405114454.php deleted file mode 100644 index 073457cbb..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120405114454.php +++ /dev/null @@ -1,29 +0,0 @@ -createTable('cc_subjs_token'); - - $cc_subjs_token->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); - $cc_subjs_token->addColumn('user_id', 'integer', array('notnull' => 1)); - $cc_subjs_token->addColumn('action', 'string', array('length' => 255, 'notnull' => 1)); - $cc_subjs_token->addColumn('token', 'string', array('length' => 40, 'notnull' => 1)); - $cc_subjs_token->addColumn('created', 'datetime', array('notnull' => 1)); - - $cc_subjs_token->setPrimaryKey(array('id')); - //end create cc_subjs_token table - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120410104441.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120410104441.php deleted file mode 100644 index 80db8b1b3..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120410104441.php +++ /dev/null @@ -1,49 +0,0 @@ -_addSql("DROP TRIGGER calculate_position ON cc_playlistcontents"); - $this->_addSql("DROP FUNCTION calculate_position()"); - - $this->_addSql("ALTER TABLE cc_subjs_token ALTER COLUMN created TYPE timestamp"); - - $this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_idx UNIQUE (token);"); - $this->_addSql("ALTER TABLE cc_subjs_token ADD CONSTRAINT cc_subjs_token_userid_fkey FOREIGN KEY (user_id) REFERENCES cc_subjs(id) ON DELETE CASCADE"); - - //add temp columns for changing bitrate and sample rate to integers. - $this->_addSql("ALTER TABLE cc_files ADD temp_br integer"); - $this->_addSql("ALTER TABLE cc_files ADD temp_sr integer"); - - $this->_addSql("UPDATE cc_files SET temp_br = bit_rate::integer"); - $this->_addSql("UPDATE cc_files SET temp_sr = sample_rate::integer"); - - $this->_addSql("ALTER TABLE cc_files DROP COLUMN sample_rate"); - $this->_addSql("ALTER TABLE cc_files DROP COLUMN bit_rate"); - - $this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_sr TO sample_rate"); - $this->_addSql("ALTER TABLE cc_files RENAME COLUMN temp_br TO bit_rate"); - - //add utime, lptime - $this->_addSql("ALTER TABLE cc_files ADD utime timestamp"); - $this->_addSql("ALTER TABLE cc_files ADD lptime timestamp"); - - //setting these to a default now for timeline refresh purposes. - $now = gmdate("Y-m-d H:i:s"); - $this->_addSql("UPDATE cc_files SET utime = '$now'"); - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120410143340.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120410143340.php deleted file mode 100644 index 9cd72c7fc..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120410143340.php +++ /dev/null @@ -1,41 +0,0 @@ -_addSql("ALTER TABLE cc_playlist ADD creator_id integer"); - $this->_addSql("UPDATE cc_playlist SET creator_id = (SELECT id FROM cc_subjs WHERE creator = login)"); - $this->_addSql("ALTER TABLE cc_playlist DROP COLUMN creator"); - - $this->_addSql("ALTER TABLE cc_playlist ADD CONSTRAINT cc_playlist_createdby_fkey FOREIGN KEY (creator_id) REFERENCES cc_subjs(id) NOT DEFERRABLE INITIALLY IMMEDIATE"); - - $this->_addSql("ALTER TABLE cc_playlist ADD utime timestamp"); - //set the initial created to modified time since this is the closest we can get to inital creation time. - $this->_addSql("UPDATE cc_playlist SET utime = mtime"); - - $this->_addSql("ALTER TABLE cc_playlist ADD length interval default '00:00:00'"); - //copy length property from our old view cc_playlisttimes - $this->_addSql("UPDATE cc_playlist AS pl SET length = (SELECT pt.length FROM cc_playlisttimes AS pt WHERE pt.id = pl.id)"); - //drop the view as it is no longer needed. - $this->_addSql("DROP VIEW cc_playlisttimes"); - - $this->_addSql("ALTER TABLE cc_playlist DROP COLUMN state"); - $this->_addSql("ALTER TABLE cc_playlist DROP COLUMN currentlyaccessing"); - $this->_addSql("ALTER TABLE cc_playlist DROP COLUMN editedby"); - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411102907.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120411102907.php deleted file mode 100644 index 6e4bb3c6c..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411102907.php +++ /dev/null @@ -1,52 +0,0 @@ -_addSql("ALTER TABLE cc_files ALTER COLUMN length TYPE interval"); - $this->_addSql("ALTER TABLE cc_files ALTER COLUMN length SET DEFAULT '00:00:00'::interval"); - $this->_addSql("ALTER TABLE cc_files ALTER COLUMN file_exists DROP NOT NULL"); - - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cuein TYPE interval"); - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cuein SET DEFAULT '00:00:00'"); - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout TYPE interval"); - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cueout SET DEFAULT '00:00:00'"); - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength TYPE interval"); - $this->_addSql("ALTER TABLE cc_playlistcontents ALTER COLUMN cliplength SET DEFAULT '00:00:00'"); - - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in TYPE interval"); - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_in SET DEFAULT '00:00:00'"); - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out TYPE interval"); - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN cue_out SET DEFAULT '00:00:00'"); - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length TYPE interval"); - $this->_addSql("ALTER TABLE cc_schedule ALTER COLUMN clip_length SET DEFAULT '00:00:00'"); - - $this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled TYPE interval"); - $this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN time_filled set DEFAULT '00:00:00'"); - - //remove old columns from cc_schedule that deal with groups or playlists. - $this->_addSql("ALTER TABLE cc_schedule DROP COLUMN group_id"); - $this->_addSql("ALTER TABLE cc_schedule DROP COLUMN schedule_group_played"); - $this->_addSql("ALTER TABLE cc_schedule DROP COLUMN playlist_id"); - - $this->_addSql("ALTER TABLE cc_schedule ADD playout_status smallint DEFAULT 1 NOT NULL"); - - $this->_addSql("ALTER TABLE cc_music_dirs ALTER COLUMN exists DROP NOT NULL, ALTER COLUMN watched DROP NOT NULL"); - } - - public function down(Schema $schema) - { - - } -} \ No newline at end of file diff --git a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php b/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php deleted file mode 100644 index 436070b3b..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/Version20120411174904.php +++ /dev/null @@ -1,30 +0,0 @@ -_addSql("ALTER TABLE cc_show_instances ADD created timestamp"); - $this->_addSql("ALTER TABLE cc_show_instances ADD last_scheduled timestamp"); - - //setting these to a default now for timeline refresh purposes. - $now = gmdate("Y-m-d H:i:s"); - $this->_addSql("UPDATE cc_show_instances SET created = '$now'"); - $this->_addSql("UPDATE cc_show_instances SET last_scheduled = '$now'"); - - $this->_addSql("ALTER TABLE cc_show_instances ALTER COLUMN created SET NOT NULL"); - } - - public function down(Schema $schema) - { - - } -} diff --git a/install_minimal/upgrades/airtime-2.1.0/common/migrations.xml b/install_minimal/upgrades/airtime-2.1.0/common/migrations.xml deleted file mode 100644 index c78b0c499..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/common/migrations.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - Airtime 2.0.0 Database Upgrade - - DoctrineMigrations - - - - ./ - - diff --git a/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql b/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql deleted file mode 100644 index 5d81e8818..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/data/upgrade.sql +++ /dev/null @@ -1,165 +0,0 @@ -DROP TRIGGER calculate_position ON cc_playlistcontents; - -DROP FUNCTION calculate_position(); - -CREATE FUNCTION airtime_to_int(chartoconvert character varying) RETURNS integer - AS - 'SELECT CASE WHEN trim($1) SIMILAR TO ''[0-9]+'' THEN CAST(trim($1) AS integer) ELSE NULL END;' - LANGUAGE SQL - IMMUTABLE - RETURNS NULL ON NULL INPUT; - -ALTER TABLE cc_files - DROP CONSTRAINT cc_music_dirs_folder_fkey; - -ALTER TABLE cc_playlist - DROP CONSTRAINT cc_playlist_editedby_fkey; - -CREATE SEQUENCE cc_live_log_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - -CREATE SEQUENCE cc_subjs_token_id_seq - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - -CREATE TABLE cc_live_log ( - id integer DEFAULT nextval('cc_live_log_id_seq'::regclass) NOT NULL, - "state" character varying(32) NOT NULL, - start_time timestamp without time zone NOT NULL, - end_time timestamp without time zone -); - -CREATE TABLE cc_subjs_token ( - id integer DEFAULT nextval('cc_subjs_token_id_seq'::regclass) NOT NULL, - user_id integer NOT NULL, - "action" character varying(255) NOT NULL, - token character varying(40) NOT NULL, - created timestamp without time zone NOT NULL -); - -ALTER TABLE cc_files - ADD COLUMN utime timestamp(6) without time zone, - ADD COLUMN lptime timestamp(6) without time zone, - ADD COLUMN file_exists boolean DEFAULT true, - ADD COLUMN soundcloud_upload_time timestamp(6) without time zone, - ALTER COLUMN bit_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */, - ALTER COLUMN sample_rate TYPE integer USING airtime_to_int(bit_rate) /* TYPE change - table: cc_files original: character varying(32) new: integer */, - ALTER COLUMN length TYPE interval /* TYPE change - table: cc_files original: time without time zone new: interval */, - ALTER COLUMN length SET DEFAULT '00:00:00'::interval; - -UPDATE cc_files SET utime = now()::timestamp(0); -UPDATE cc_files SET length = '00:00:00' WHERE length is NULL; - -ALTER TABLE cc_music_dirs - ADD COLUMN "exists" boolean DEFAULT true, - ADD COLUMN watched boolean DEFAULT true; - -ALTER TABLE cc_playlist - DROP COLUMN "state", - DROP COLUMN currentlyaccessing, - DROP COLUMN editedby, - DROP COLUMN creator, - ADD COLUMN utime timestamp(6) without time zone, - ADD COLUMN creator_id integer, - ADD COLUMN length interval DEFAULT '00:00:00'::interval; - -UPDATE cc_playlist SET utime = mtime; -UPDATE cc_playlist AS pl SET length = (SELECT pt.length FROM cc_playlisttimes AS pt WHERE pt.id = pl.id); -DROP VIEW cc_playlisttimes; - -ALTER TABLE cc_playlistcontents - ALTER COLUMN cliplength TYPE interval /* TYPE change - table: cc_playlistcontents original: time without time zone new: interval */, - ALTER COLUMN cliplength SET DEFAULT '00:00:00'::interval, - ALTER COLUMN cuein TYPE interval /* TYPE change - table: cc_playlistcontents original: time without time zone new: interval */, - ALTER COLUMN cuein SET DEFAULT '00:00:00'::interval, - ALTER COLUMN cueout TYPE interval /* TYPE change - table: cc_playlistcontents original: time without time zone new: interval */, - ALTER COLUMN cueout SET DEFAULT '00:00:00'::interval; - -UPDATE cc_playlistcontents SET cliplength = '00:00:00' WHERE cliplength is NULL; -UPDATE cc_playlistcontents SET cuein = '00:00:00' WHERE cuein is NULL; -UPDATE cc_playlistcontents SET cueout = '00:00:00' WHERE cueout is NULL; - -ALTER TABLE cc_schedule - DROP COLUMN playlist_id, - DROP COLUMN group_id, - DROP COLUMN schedule_group_played, - ADD COLUMN playout_status smallint DEFAULT 1 NOT NULL, - ADD COLUMN broadcasted smallint DEFAULT 0 NOT NULL, - ALTER COLUMN clip_length TYPE interval /* TYPE change - table: cc_schedule original: time without time zone new: interval */, - ALTER COLUMN clip_length SET DEFAULT '00:00:00'::interval, - ALTER COLUMN cue_in TYPE interval /* TYPE change - table: cc_schedule original: time without time zone new: interval */, - ALTER COLUMN cue_in SET DEFAULT '00:00:00'::interval, - ALTER COLUMN cue_out TYPE interval /* TYPE change - table: cc_schedule original: time without time zone new: interval */, - ALTER COLUMN cue_out SET DEFAULT '00:00:00'::interval; - -UPDATE cc_schedule SET clip_length = '00:00:00' WHERE clip_length is NULL; -UPDATE cc_schedule SET cue_in = '00:00:00' WHERE cue_in is NULL; -UPDATE cc_schedule SET cue_out = '00:00:00' WHERE cue_out is NULL; - -ALTER TABLE cc_show - ADD COLUMN live_stream_using_airtime_auth boolean DEFAULT false, - ADD COLUMN live_stream_using_custom_auth boolean DEFAULT false, - ADD COLUMN live_stream_user character varying(255), - ADD COLUMN live_stream_pass character varying(255); - -ALTER TABLE cc_show_instances - ADD COLUMN created timestamp without time zone, - ADD COLUMN last_scheduled timestamp without time zone, - ALTER COLUMN time_filled TYPE interval /* TYPE change - table: cc_show_instances original: time without time zone new: interval */, - ALTER COLUMN time_filled SET DEFAULT '00:00:00'::interval; - -UPDATE cc_show_instances SET time_filled = '00:00:00' WHERE time_filled is NULL; -UPDATE cc_show_instances SET created = now(); -UPDATE cc_show_instances SET last_scheduled = now(); - -ALTER TABLE cc_show_instances - ALTER COLUMN created SET NOT NULL; - -ALTER TABLE cc_live_log - ADD CONSTRAINT cc_live_log_pkey PRIMARY KEY (id); - -ALTER TABLE cc_subjs_token - ADD CONSTRAINT cc_subjs_token_pkey PRIMARY KEY (id); - -ALTER TABLE cc_files - ADD CONSTRAINT cc_music_dirs_folder_fkey FOREIGN KEY (directory) REFERENCES cc_music_dirs(id); - -ALTER TABLE cc_playlist - ADD CONSTRAINT cc_playlist_createdby_fkey FOREIGN KEY (creator_id) REFERENCES cc_subjs(id); - -ALTER TABLE cc_subjs_token - ADD CONSTRAINT cc_subjs_token_idx UNIQUE (token); - -ALTER TABLE cc_subjs_token - ADD CONSTRAINT cc_subjs_token_userid_fkey FOREIGN KEY (user_id) REFERENCES cc_subjs(id) ON DELETE CASCADE; - -CREATE INDEX cc_files_file_exists_idx ON cc_files USING btree (file_exists); - -DROP FUNCTION airtime_to_int(chartoconvert character varying); - - -UPDATE cc_playlist SET creator_id = (SELECT id FROM cc_subjs WHERE type = 'A' LIMIT 1); - -DELETE FROM cc_pref WHERE keystr = 'scheduled_play_switch'; -INSERT INTO cc_pref(keystr, valstr) VALUES('scheduled_play_switch', 'on'); - -INSERT INTO cc_live_log(state, start_time) VALUES('S', now() at time zone 'UTC'); - -DELETE FROM cc_pref WHERE keystr = 'system_version'; -INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.1.0'); - ---UPDATE -UPDATE cc_schedule SET playout_status = 1 WHERE id in (SELECT DISTINCT s.id FROM cc_schedule as s LEFT JOIN cc_show_instances as si ON si.id = s.instance_id WHERE s.ends <= si.ends AND s.playout_status >= 0); - -UPDATE cc_schedule SET playout_status = 2 WHERE id in (SELECT DISTINCT s.id FROM cc_schedule as s LEFT JOIN cc_show_instances as si ON si.id = s.instance_id WHERE s.starts < si.ends AND s.ends > si.ends AND s.playout_status >= 0); - -UPDATE cc_schedule SET playout_status = 0 WHERE id in (SELECT DISTINCT s.id FROM cc_schedule as s LEFT JOIN cc_show_instances as si ON si.id = s.instance_id WHERE s.starts > si.ends AND s.playout_status >= 0); - - diff --git a/install_minimal/upgrades/airtime-2.1.0/etc/airtime.conf.210 b/install_minimal/upgrades/airtime-2.1.0/etc/airtime.conf.210 deleted file mode 100644 index 0853cedc9..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/etc/airtime.conf.210 +++ /dev/null @@ -1,31 +0,0 @@ -[database] -host = localhost -dbname = airtime -dbuser = airtime -dbpass = airtime - -[rabbitmq] -host = 127.0.0.1 -port = 5672 -user = guest -password = guest -vhost = / - -[general] -api_key = AAA -web_server_user = www-data -airtime_dir = x -base_url = localhost -base_port = 80 - -;How many hours ahead of time should Airtime playout engine (PYPO) -;cache scheduled media files. -cache_ahead_hours = 1 - -[monit] -monit_user = guest -monit_password = airtime - -[soundcloud] -connection_retries = 3 -time_between_retries = 60 diff --git a/install_minimal/upgrades/airtime-2.1.0/etc/api_client.cfg.210 b/install_minimal/upgrades/airtime-2.1.0/etc/api_client.cfg.210 deleted file mode 100644 index 2ff113b9c..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/etc/api_client.cfg.210 +++ /dev/null @@ -1,111 +0,0 @@ -bin_dir = "/usr/lib/airtime/api_clients" - -############################# -## Common -############################# - -# Value needed to access the API -api_key = 'AAA' - -# Path to the base of the API -api_base = 'api' - -# URL to get the version number of the server API -version_url = 'version/api_key/%%api_key%%' - -#URL to register a components IP Address with the central web server -register_component = 'register-component/format/json/api_key/%%api_key%%/component/%%component%%' - -# Hostname -base_url = 'localhost' -base_port = 80 - -############################# -## Config for Media Monitor -############################# - -# URL to setup the media monitor -media_setup_url = 'media-monitor-setup/format/json/api_key/%%api_key%%' - -# Tell Airtime the file id associated with a show instance. -upload_recorded = 'upload-recorded/format/json/api_key/%%api_key%%/fileid/%%fileid%%/showinstanceid/%%showinstanceid%%' - -# URL to tell Airtime to update file's meta data -update_media_url = 'reload-metadata/format/json/api_key/%%api_key%%/mode/%%mode%%' - -# URL to tell Airtime we want a listing of all files it knows about -list_all_db_files = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%' - -# URL to tell Airtime we want a listing of all dirs its watching (including the stor dir) -list_all_watched_dirs = 'list-all-watched-dirs/format/json/api_key/%%api_key%%' - -# URL to tell Airtime we want to add watched directory -add_watched_dir = 'add-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%' - -# URL to tell Airtime we want to add watched directory -remove_watched_dir = 'remove-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%' - -# URL to tell Airtime we want to add watched directory -set_storage_dir = 'set-storage-dir/format/json/api_key/%%api_key%%/path/%%path%%' - -# URL to tell Airtime about file system mount change -update_fs_mount = 'update-file-system-mount/format/json/api_key/%%api_key%%' - -# URL to tell Airtime about file system mount change -handle_watched_dir_missing = 'handle-watched-dir-missing/format/json/api_key/%%api_key%%/dir/%%dir%%' - -############################# -## Config for Recorder -############################# - -# URL to get the schedule of shows set to record -show_schedule_url = 'recorded-shows/format/json/api_key/%%api_key%%' - -# URL to upload the recorded show's file to Airtime -upload_file_url = 'upload-file/format/json/api_key/%%api_key%%' - -#number of retries to upload file if connection problem -upload_retries = 3 - -#time to wait between attempts to upload file if connection problem (in seconds) -upload_wait = 60 - -################################################################################ -# Uncomment *one of the sets* of values from the API clients below, and comment -# out all the others. -################################################################################ - -############################# -## Config for Pypo -############################# - -# Schedule export path. -# %%from%% - starting date/time in the form YYYY-MM-DD-hh-mm -# %%to%% - starting date/time in the form YYYY-MM-DD-hh-mm -export_url = 'schedule/api_key/%%api_key%%' - -get_media_url = 'get-media/file/%%file%%/api_key/%%api_key%%' - -# Update whether a schedule group has begun playing. -update_item_url = 'notify-schedule-group-play/api_key/%%api_key%%/schedule_id/%%schedule_id%%' - -# Update whether an audio clip is currently playing. -update_start_playing_url = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/schedule_id/%%schedule_id%%' - -# ??? -generate_range_url = 'generate_range_dp.php' - -# URL to tell Airtime we want to get stream setting -get_stream_setting = 'get-stream-setting/format/json/api_key/%%api_key%%/' - -#URL to update liquidsoap status -update_liquidsoap_status = 'update-liquidsoap-status/format/json/api_key/%%api_key%%/msg/%%msg%%/stream_id/%%stream_id%%/boot_time/%%boot_time%%' - -#URL to check live stream auth -check_live_stream_auth = 'check-live-stream-auth/format/json/api_key/%%api_key%%/username/%%username%%/password/%%password%%/djtype/%%djtype%%' - -#URL to update source status -update_source_status = 'update-source-status/format/json/api_key/%%api_key%%/sourcename/%%sourcename%%/status/%%status%%' - -get_bootstrap_info = 'get-bootstrap-info/format/json/api_key/%%api_key%%' - diff --git a/install_minimal/upgrades/airtime-2.1.0/etc/liquidsoap.cfg.210 b/install_minimal/upgrades/airtime-2.1.0/etc/liquidsoap.cfg.210 deleted file mode 100644 index d76e3af3d..000000000 --- a/install_minimal/upgrades/airtime-2.1.0/etc/liquidsoap.cfg.210 +++ /dev/null @@ -1,69 +0,0 @@ -########################################### -# Liquidsoap config file # -########################################### - -########################################### -# Output settings # -########################################### -output_sound_device = false -output_sound_device_type = "ALSA" -s1_output = "icecast" -s2_output = "icecast" -s3_output = "icecast" - -s1_enable = true -s2_enable = false -s3_enable = false - -s1_type = "ogg" -s2_type = "ogg" -s3_type = "mp3" - -s1_bitrate = 128 -s2_bitrate = 128 -s3_bitrate = 160 - -########################################### -# Logging settings # -########################################### -log_file = "/var/log/airtime/pypo-liquidsoap/