You are here

final class Time in Lightning Scheduler 8

@internal This is an internal part of Lightning Scheduler and may be changed or removed at any time without warning. It should not be used by external code in any way.

Hierarchy

Expanded class hierarchy of Time

1 string reference to 'Time'
lightning_scheduler.services.yml in ./lightning_scheduler.services.yml
lightning_scheduler.services.yml
1 service uses Time
lightning_scheduler.datetime.time in ./lightning_scheduler.services.yml
Drupal\lightning_scheduler\Time

File

src/Time.php, line 15

Namespace

Drupal\lightning_scheduler
View source
final class Time extends BaseTime {

  /**
   * The state service.
   *
   * @var \Drupal\Core\State\StateInterface
   */
  private $state;

  /**
   * Time constructor.
   *
   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
   *   The request stack.
   * @param \Drupal\Core\State\StateInterface $state
   *   The state service.
   */
  public function __construct(RequestStack $request_stack, StateInterface $state) {
    parent::__construct($request_stack);
    $this->state = $state;
  }

  /**
   * {@inheritdoc}
   */
  public function getRequestTime() {
    return $this->state
      ->get('lightning_scheduler.request_time', parent::getRequestTime());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Time::$requestStack protected property The request stack.
Time::$state private property The state service.
Time::getCurrentMicroTime public function Returns the current system time with microsecond precision. Overrides TimeInterface::getCurrentMicroTime
Time::getCurrentTime public function Returns the current system time as an integer. Overrides TimeInterface::getCurrentTime
Time::getRequestMicroTime public function Returns the timestamp for the current request with microsecond precision. Overrides TimeInterface::getRequestMicroTime
Time::getRequestTime public function Returns the timestamp for the current request. Overrides Time::getRequestTime
Time::__construct public function Time constructor. Overrides Time::__construct