forked from oroinc/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCacheState.php
More file actions
38 lines (33 loc) · 783 Bytes
/
Copy pathCacheState.php
File metadata and controls
38 lines (33 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Oro\Bundle\MessageQueueBundle\Consumption;
/**
* Allows to update and get the date when cache was changed.
*/
class CacheState
{
/** @var StateDriverInterface */
private $driver;
/**
* @param StateDriverInterface $driver
*/
public function __construct(StateDriverInterface $driver)
{
$this->driver = $driver;
}
/**
* Renews the date when cache was changed.
*/
public function renewChangeDate()
{
$this->driver->setChangeStateDate(new \DateTime('now', new \DateTimeZone('UTC')));
}
/**
* Returns the date when cache was changed.
*
* @return \DateTime|null
*/
public function getChangeDate()
{
return $this->driver->getChangeStateDate();
}
}