当前位置: 首页>>代码示例>>PHP>>正文


PHP DateRange::GetEnd方法代码示例

本文整理汇总了PHP中DateRange::GetEnd方法的典型用法代码示例。如果您正苦于以下问题:PHP DateRange::GetEnd方法的具体用法?PHP DateRange::GetEnd怎么用?PHP DateRange::GetEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DateRange的用法示例。


在下文中一共展示了DateRange::GetEnd方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetReservations

 public function GetReservations(DateRange $dateRangeUtc, $scheduleId, $targetTimezone)
 {
     $reservationListing = $this->_coordinatorFactory->CreateReservationListing($targetTimezone);
     $reservations = $this->_repository->GetReservationList($dateRangeUtc->GetBegin(), $dateRangeUtc->GetEnd(), null, null, $scheduleId, null);
     Log::Debug("Found %s reservations for schedule %s between %s and %s", count($reservations), $scheduleId, $dateRangeUtc->GetBegin(), $dateRangeUtc->GetEnd());
     foreach ($reservations as $reservation) {
         $reservationListing->Add($reservation);
     }
     $blackouts = $this->_repository->GetBlackoutsWithin($dateRangeUtc, $scheduleId);
     Log::Debug("Found %s blackouts for schedule %s between %s and %s", count($blackouts), $scheduleId, $dateRangeUtc->GetBegin(), $dateRangeUtc->GetEnd());
     foreach ($blackouts as $blackout) {
         $reservationListing->AddBlackout($blackout);
     }
     return $reservationListing;
 }
开发者ID:hugutux,项目名称:booked,代码行数:15,代码来源:ReservationService.php

示例2: EndDate

 /**
  * @return Date
  */
 public function EndDate()
 {
     return $this->date->GetEnd();
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:7,代码来源:Blackout.php

示例3: GetBlackoutsWithin

 public function GetBlackoutsWithin(DateRange $dateRange, $scheduleId = ReservationViewRepository::ALL_SCHEDULES)
 {
     $getBlackoutsCommand = new GetBlackoutListCommand($dateRange->GetBegin(), $dateRange->GetEnd(), $scheduleId);
     $result = ServiceLocator::GetDatabase()->Query($getBlackoutsCommand);
     $blackouts = array();
     while ($row = $result->GetRow()) {
         $blackouts[] = BlackoutItemView::Populate($row);
     }
     $result->Free();
     return $blackouts;
 }
开发者ID:JoseTfg,项目名称:Booked,代码行数:11,代码来源:ReservationViewRepository.php

示例4: SetReservationDate

 public function SetReservationDate(DateRange $reservationDate)
 {
     $this->startDate = $reservationDate->GetBegin();
     $this->endDate = $reservationDate->GetEnd();
 }
开发者ID:ViraSoftware,项目名称:booked,代码行数:5,代码来源:Reservation.php

示例5: testConflictsIfResourceReservationExistsAtSameTime

 public function testConflictsIfResourceReservationExistsAtSameTime()
 {
     $resourceId = 1;
     $currentId = 19;
     $currentDate = new DateRange(Date::Now()->AddDays(10), Date::Now()->AddDays(15));
     $current = new TestReservation('ref', $currentDate);
     $current->SetReservationId($currentId);
     $series = new ExistingReservationSeries();
     $series->WithPrimaryResource(new FakeBookableResource($resourceId));
     $series->WithResource(new FakeBookableResource($resourceId + 1));
     $series->WithCurrentInstance($current);
     $reservations = array(new TestReservationItemView($currentId + 1, $currentDate->GetBegin(), $currentDate->GetEnd(), $resourceId));
     $this->strategy->expects($this->once())->method('GetItemsBetween')->with($this->anything(), $this->anything())->will($this->returnValue($reservations));
     $rule = new ExistingResourceAvailabilityRule($this->strategy, $this->timezone);
     $ruleResult = $rule->Validate($series);
     $this->assertFalse($ruleResult->IsValid());
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:17,代码来源:ExistingResourceAvailabilityRuleTests.php

示例6: Equals

 /**
  * @param DateRange $otherRange
  * @return bool
  */
 public function Equals(DateRange $otherRange)
 {
     return $this->_begin->Equals($otherRange->GetBegin()) && $this->_end->Equals($otherRange->GetEnd());
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:8,代码来源:DateRange.php

示例7: Update

 public function Update($blackoutInstanceId, DateRange $blackoutDate, $resourceIds, $title, IReservationConflictResolution $reservationConflictResolution, IRepeatOptions $repeatOptions, $scope)
 {
     if (!$blackoutDate->GetEnd()->GreaterThan($blackoutDate->GetBegin())) {
         return new BlackoutDateTimeValidationResult();
     }
     $userId = ServiceLocator::GetServer()->GetUserSession()->UserId;
     $blackoutSeries = $this->LoadBlackout($blackoutInstanceId, $userId);
     if ($blackoutSeries == null) {
         return new BlackoutSecurityValidationResult();
     }
     $blackoutSeries->Update($userId, $scope, $title, $blackoutDate, $repeatOptions, $resourceIds);
     $conflictingBlackouts = $this->GetConflictingBlackouts($blackoutSeries);
     $conflictingReservations = array();
     if (empty($conflictingBlackouts)) {
         $conflictingReservations = $this->GetConflictingReservations($blackoutSeries, $reservationConflictResolution);
     }
     $blackoutValidationResult = new BlackoutValidationResult($conflictingBlackouts, $conflictingReservations);
     if ($blackoutValidationResult->CanBeSaved()) {
         $this->blackoutRepository->Update($blackoutSeries);
     }
     return $blackoutValidationResult;
 }
开发者ID:hugutux,项目名称:booked,代码行数:22,代码来源:ManageBlackoutsService.php

示例8: Split

 /**
  * @param DateRange $dateRange
  * @return array|DateRange[]
  */
 public function Split(DateRange $dateRange)
 {
     $ranges = array();
     $start = $dateRange->GetBegin();
     $end = $dateRange->GetEnd();
     if (!$this->SameYear($start, $end)) {
         $current = $start;
         while (!$this->SameYear($current, $end)) {
             $next = $this->GetFirstOfYear($current, 1);
             $ranges[] = new DateRange($current, $next);
             $current = $next;
             if ($this->SameYear($current, $end)) {
                 $ranges[] = new DateRange($current, $end);
             }
         }
     } else {
         $ranges[] = $dateRange;
     }
     return $ranges;
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:24,代码来源:Quota.php

示例9: WithInstance

 /**
  * @param int $instanceId
  * @param string $referenceNum
  * @param DateRange $duration
  * @return ReservationInstanceRow
  */
 public function WithInstance($instanceId, $referenceNum, $duration)
 {
     $this->rows[] = array(ColumnNames::SERIES_ID => $this->seriesId, ColumnNames::RESERVATION_INSTANCE_ID => $instanceId, ColumnNames::REFERENCE_NUMBER => $referenceNum, ColumnNames::RESERVATION_START => $duration->GetBegin()->ToDatabase(), ColumnNames::RESERVATION_END => $duration->GetEnd()->ToDatabase());
     return $this;
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:11,代码来源:DBRows.php

示例10: GetDates

 public function GetDates(DateRange $startingRange)
 {
     $dates = array();
     $begin = $startingRange->GetBegin();
     $end = $startingRange->GetEnd();
     $nextStartYear = $begin->Year();
     $nextEndYear = $end->Year();
     $timezone = $begin->Timezone();
     $startDate = $begin;
     while ($startDate->DateCompare($this->_terminationDate) <= 0) {
         $nextStartYear = $nextStartYear + $this->_interval;
         $nextEndYear = $nextEndYear + $this->_interval;
         $startDate = Date::Create($nextStartYear, $begin->Month(), $begin->Day(), $begin->Hour(), $begin->Minute(), $begin->Second(), $timezone);
         $endDate = Date::Create($nextEndYear, $end->Month(), $end->Day(), $end->Hour(), $end->Minute(), $end->Second(), $timezone);
         if ($startDate->DateCompare($this->_terminationDate) <= 0) {
             $dates[] = new DateRange($startDate->ToUtc(), $endDate->ToUtc());
         }
     }
     return $dates;
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:20,代码来源:RepeatOptions.php

示例11: Add

 /**
  * @param AccessoryReservation $accessoryReservation
  * @return void
  */
 public function Add(AccessoryReservation $accessoryReservation)
 {
     if ($accessoryReservation->GetStartDate()->Equals($this->duration->GetEnd()) || $accessoryReservation->GetEndDate()->Equals($this->duration->GetBegin())) {
         return;
     }
     if (array_key_exists($accessoryReservation->GetReferenceNumber(), $this->addedReservations)) {
         return;
     }
     $this->addedReservations[$accessoryReservation->GetReferenceNumber()] = true;
     $accessoryId = $accessoryReservation->GetAccessoryId();
     if (array_key_exists($accessoryId, $this->quantities)) {
         $this->quantities[$accessoryId] += $accessoryReservation->QuantityReserved();
     }
 }
开发者ID:JoseTfg,项目名称:Booked,代码行数:18,代码来源:AccessoryAvailabilityRule.php

示例12: BindDisplayDates

 /**
  * @see ISchedulePageBuilder::BindDisplayDates()
  */
 public function BindDisplayDates(ISchedulePage $page, DateRange $dateRange, UserSession $userSession, ISchedule $schedule)
 {
     $scheduleLength = $schedule->GetDaysVisible();
     if ($page->GetShowFullWeek()) {
         $scheduleLength = 7;
     }
     // we don't want to display the last date in the range (it will be midnight of the last day)
     $adjustedDateRange = new DateRange($dateRange->GetBegin()->ToTimezone($userSession->Timezone), $dateRange->GetEnd()->ToTimezone($userSession->Timezone)->AddDays(-1));
     $page->SetDisplayDates($adjustedDateRange);
     $startDate = $adjustedDateRange->GetBegin();
     $startDay = $schedule->GetWeekdayStart();
     if ($startDay == Schedule::Today) {
         $adjustment = $scheduleLength;
         $prevAdjustment = $scheduleLength;
     } else {
         $adjustment = max($scheduleLength, 7);
         $prevAdjustment = 7 * floor($adjustment / 7);
         // ie, if 10, we only want to go back 7 days so there is overlap
     }
     $page->SetPreviousNextDates($startDate->AddDays(-$prevAdjustment), $startDate->AddDays($adjustment));
     $page->ShowFullWeekToggle($scheduleLength < 7);
 }
开发者ID:hugutux,项目名称:booked,代码行数:25,代码来源:SchedulePageBuilder.php


注:本文中的DateRange::GetEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。