Ejemplo n.º 1
0
 public function AddBlackout(Blackout $blackout)
 {
     $this->blackouts[$this->ToKey($blackout->Date())] = $blackout;
 }
Ejemplo n.º 2
0
 /**
  * @param int $blackoutId
  * @return BlackoutSeries
  */
 public function LoadByBlackoutId($blackoutId)
 {
     $db = ServiceLocator::GetDatabase();
     $result = $db->Query(new GetBlackoutSeriesByBlackoutIdCommand($blackoutId));
     if ($row = $result->GetRow()) {
         $series = BlackoutSeries::FromRow($row);
         $result = $db->Query(new GetBlackoutInstancesCommand($series->Id()));
         while ($row = $result->GetRow()) {
             $instance = new Blackout(new DateRange(Date::FromDatabase($row[ColumnNames::BLACKOUT_START]), Date::FromDatabase($row[ColumnNames::BLACKOUT_END])));
             $instance->WithId($row[ColumnNames::BLACKOUT_INSTANCE_ID]);
             $series->AddBlackout($instance);
         }
         $result = $db->Query(new GetBlackoutResourcesCommand($series->Id()));
         while ($row = $result->GetRow()) {
             $series->AddResource(new BlackoutResource($row[ColumnNames::RESOURCE_ID], $row[ColumnNames::RESOURCE_NAME], $row[ColumnNames::SCHEDULE_ID], $row[ColumnNames::RESOURCE_ADMIN_GROUP_ID], $row[ColumnNames::SCHEDULE_ADMIN_GROUP_ID_ALIAS], $row[ColumnNames::RESOURCE_STATUS_ID]));
         }
         return $series;
     } else {
         return null;
     }
 }
Ejemplo n.º 3
0
/**
* Prints out reservation info depending on what parameters
*  were passed in through the query string
* @param none
*/
function present_blackout($blackoutid)
{
    // Get info about this reservation
    $blackout = new Blackout($blackoutid);
    $blackout->print_res();
}