Created empty showInstance service.

Split populateShowUntil into 2 new functions: getPopulateDateUntil, and getShowDays
This commit is contained in:
denise 2013-02-26 13:21:39 -05:00
parent 2717c0845b
commit 8c8a7d11e1
3 changed files with 44 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -0,0 +1,8 @@
<?php
class Application_Service_ShowInstanceService
{
public function createShowInstances($showId, $populateUntil)
{
}
}

View File

@ -142,4 +142,36 @@ class Application_Service_ShowService
}
}
}
/**
*
* Gets the date and time shows (particularly repeating shows)
* can be populated until.
*
* @return DateTime object
*/
public function getPopulateShowUntilDateTIme()
{
$populateUntil = Application_Model_Preference::GetShowsPopulatedUntil();
if (is_null($populateUntil)) {
$populateUntil = new DateTime("now", new DateTimeZone('UTC'));
Application_Model_Preference::SetShowsPopulatedUntil($populateUntil);
}
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');
}
}