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
- class \Drupal\Component\Datetime\Time implements TimeInterface
- class \Drupal\lightning_scheduler\Time
Expanded class hierarchy of Time
1 string reference to 'Time'
1 service uses Time
File
- src/
Time.php, line 15
Namespace
Drupal\lightning_schedulerView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Time:: |
protected | property | The request stack. | |
Time:: |
private | property | The state service. | |
Time:: |
public | function |
Returns the current system time with microsecond precision. Overrides TimeInterface:: |
|
Time:: |
public | function |
Returns the current system time as an integer. Overrides TimeInterface:: |
|
Time:: |
public | function |
Returns the timestamp for the current request with microsecond precision. Overrides TimeInterface:: |
|
Time:: |
public | function |
Returns the timestamp for the current request. Overrides Time:: |
|
Time:: |
public | function |
Time constructor. Overrides Time:: |