1
0
mirror of synced 2025-01-19 15:01:40 +03:00

67 lines
1.1 KiB
PHP
Raw Normal View History

2015-02-11 09:59:41 +01:00
<?php
namespace Doctrine\Tests\Models\Cache;
/**
* @Entity
* @Cache("READ_ONLY")
* @Table("cache_token")
*/
class Token
{
const CLASSNAME = __CLASS__;
/**
* @Id
* @Column(type="string")
*/
protected $token;
/**
* @Column(type="date")
*/
protected $expiresAt;
/**
* @OneToOne(targetEntity="Client")
*/
protected $client;
public function __construct($token, Client $client = null)
{
$this->token = $token;
$this->client = $client;
$this->expiresAt = new \DateTime(date('Y-m-d H:i:s', strtotime("+7 day")));
}
public function getToken()
{
return $this->token;
}
public function getExpiresAt()
{
return $this->expiresAt;
}
public function getClient()
{
return $this->client;
}
public function setToken($token)
{
$this->token = $token;
}
public function setExpiresAt(DateTime $expiresAt)
{
$this->expiresAt = $expiresAt;
}
public function setClient(Client $client)
{
$this->client = $client;
}
}