You are here

class ActiveHoursDates in SMS Framework 8

Same name and namespace in other branches
  1. 2.x modules/sms_user/src/ActiveHoursDates.php \Drupal\sms_user\ActiveHoursDates
  2. 2.1.x modules/sms_user/src/ActiveHoursDates.php \Drupal\sms_user\ActiveHoursDates

Define a start and end date container for DrupalDateTime.

This class is similar to \DatePeriod, but without an interval.

Hierarchy

Expanded class hierarchy of ActiveHoursDates

File

modules/sms_user/src/ActiveHoursDates.php, line 12

Namespace

Drupal\sms_user
View source
class ActiveHoursDates {

  /**
   * The start date.
   *
   * @var \Drupal\Core\Datetime\DrupalDateTime
   */
  protected $start;

  /**
   * The end date.
   *
   * @var \Drupal\Core\Datetime\DrupalDateTime
   */
  protected $end;

  /**
   * Construct a new ActiveHoursDates object.
   *
   * @param \Drupal\Core\Datetime\DrupalDateTime $start
   *   The start date.
   * @param \Drupal\Core\Datetime\DrupalDateTime $end
   *   The end date.
   */
  public function __construct(DrupalDateTime $start, DrupalDateTime $end) {
    $this->start = $start;
    $this->end = $end;
  }

  /**
   * Get the start date.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   The start date.
   */
  public function getStartDate() {
    return $this->start;
  }

  /**
   * Get the end date.
   *
   * @return \Drupal\Core\Datetime\DrupalDateTime
   *   The end date.
   */
  public function getEndDate() {
    return $this->end;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActiveHoursDates::$end protected property The end date.
ActiveHoursDates::$start protected property The start date.
ActiveHoursDates::getEndDate public function Get the end date.
ActiveHoursDates::getStartDate public function Get the start date.
ActiveHoursDates::__construct public function Construct a new ActiveHoursDates object.