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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
* @created: 22.01.15, 11:41
*/
namespace Commercetools\Core\Client\OAuth;
/**
* @package Commercetools\Core\OAuth
*/
class Token
{
/**
* @var string
*/
protected $token;
/**
* @var \DateTime
*/
protected $validTo;
/**
* @var int
*/
protected $ttl;
/**
* @var string
*/
protected $scope;
/**
* @var string
*/
protected $refreshToken;
public function __construct($token = null, $ttl = null, $scope = null)
{
$this->setToken($token)->setTtl($ttl)->setScope($scope);
}
/**
* @return string
*/
public function getToken()
{
return $this->token;
}
/**
* @param string $token
* @return $this
*/
public function setToken($token)
{
$this->token = $token;
return $this;
}
/**
* @return \DateTime
*/
public function getValidTo()
{
return $this->validTo;
}
/**
* @param \DateTime $validTo
* @return $this
*/
public function setValidTo(\DateTime $validTo)
{
$this->validTo = $validTo;
return $this;
}
/**
* @return int
*/
public function getTtl()
{
return $this->ttl;
}
/**
* @param int $ttl
* @return $this
*/
public function setTtl($ttl)
{
$this->ttl = $ttl;
return $this;
}
/**
* @return string
*/
public function getScope()
{
return $this->scope;
}
/**
* @param string $scope
* @return $this
*/
public function setScope($scope)
{
$this->scope = $scope;
return $this;
}
/**
* @return string
*/
public function getRefreshToken()
{
return $this->refreshToken;
}
/**
* @param string $refreshToken
* @return $this
*/
public function setRefreshToken($refreshToken)
{
$this->refreshToken = $refreshToken;
return $this;
}
}