. */ namespace Doctrine\ORM\Cache; use function time; use function uniqid; /** * Cache Lock */ class Lock { /** @var string */ public $value; /** @var int */ public $time; /** * @param string $value * @param int $time */ public function __construct($value, $time = null) { $this->value = $value; $this->time = $time ? : time(); } /** * @return Lock */ public static function createLockRead() { return new self(uniqid(time(), true)); } }