class Time in Lightning Workflow 8.3
Decorates the time service to facilitate testing.
Hierarchy
- class \Drupal\Component\Datetime\Time implements TimeInterface
- class \Drupal\lightning_scheduler\Time
Expanded class hierarchy of Time
2 string references to 'Time'
- lightning_scheduler.services.yml in modules/
lightning_scheduler/ lightning_scheduler.services.yml - modules/lightning_scheduler/lightning_scheduler.services.yml
- ModerationHistoryTest::testModerationHistory in tests/
src/ Functional/ ModerationHistoryTest.php - Tests the moderation_history view for a node with revisions.
1 service uses Time
- lightning_scheduler.datetime.time in modules/
lightning_scheduler/ lightning_scheduler.services.yml - Drupal\lightning_scheduler\Time
File
- modules/
lightning_scheduler/ src/ Time.php, line 12
Namespace
Drupal\lightning_schedulerView source
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:: |