Created empty showInstance service.
Split populateShowUntil into 2 new functions: getPopulateDateUntil, and getShowDays
This commit is contained in:
parent
d497cfa857
commit
c29e11fa0f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
class Application_Service_ShowInstanceService
|
||||
{
|
||||
public function createShowInstances($showId, $populateUntil)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue