You are here

public function Fixed::generateFirstBillingPeriod in Commerce Recurring Framework 8

Generates the first billing period.

Parameters

\Drupal\Core\Datetime\DrupalDateTime $start_date: The billing start date/time.

Return value

\Drupal\commerce_recurring\BillingPeriod The billing period.

Overrides BillingScheduleInterface::generateFirstBillingPeriod

File

src/Plugin/Commerce/BillingSchedule/Fixed.php, line 98

Class

Fixed
Provides a fixed interval billing schedule.

Namespace

Drupal\commerce_recurring\Plugin\Commerce\BillingSchedule

Code

public function generateFirstBillingPeriod(DrupalDateTime $start_date) {

  // @todo $start_date->setTimezone($site_timezone)
  $interval = $this
    ->getInterval();
  $adjusted_start_date = $this
    ->adjustStartDate($start_date);
  return new BillingPeriod($adjusted_start_date, $interval
    ->add($adjusted_start_date));
}