ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Plumrocket\Base\Library\Mobile\Cache;
|
||||
|
||||
/**
|
||||
* Simple cache item (key, value, ttl) that is being
|
||||
* used by all the detection methods of Mobile Detect class.
|
||||
*/
|
||||
class CacheItem
|
||||
{
|
||||
/**
|
||||
* @var string Unique key for the cache record.
|
||||
*/
|
||||
protected $key;
|
||||
/**
|
||||
* @var bool|null Mobile Detect only needs to store booleans (e.g. "isMobile" => true)
|
||||
*/
|
||||
protected $value = null;
|
||||
protected $ttl = 0;
|
||||
public function __construct($key, $value = null, $ttl = null)
|
||||
{
|
||||
$this->key = $key;
|
||||
if (!is_null($value)) {
|
||||
$this->value = $value;
|
||||
}
|
||||
$this->ttl = $ttl;
|
||||
}
|
||||
|
||||
public function getKey(): string
|
||||
{
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function set($value): void
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getTtl(): ?int
|
||||
{
|
||||
return $this->ttl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user