1 | <?php |
||
33 | class VerifyTicket |
||
34 | { |
||
35 | /** |
||
36 | * Cache manager. |
||
37 | * |
||
38 | * @var \Doctrine\Common\Cache\Cache |
||
39 | */ |
||
40 | protected $cache; |
||
41 | |||
42 | /** |
||
43 | * App Id. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $appId; |
||
48 | |||
49 | /** |
||
50 | * Cache Key. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | private $cacheKey; |
||
55 | |||
56 | /** |
||
57 | * Cache key prefix. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $prefix = 'easywechat.open_platform.component_verify_ticket.'; |
||
62 | |||
63 | /** |
||
64 | * VerifyTicket constructor. |
||
65 | * |
||
66 | * @param string $appId |
||
67 | * @param \Doctrine\Common\Cache\Cache $cache |
||
68 | */ |
||
69 | 6 | public function __construct($appId, Cache $cache) |
|
74 | |||
75 | /** |
||
76 | * Set component verify ticket to the cache. |
||
77 | * |
||
78 | * @param string $ticket |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | 3 | public function setTicket($ticket) |
|
86 | |||
87 | /** |
||
88 | * Get component verify ticket. |
||
89 | * |
||
90 | * @return string |
||
91 | * |
||
92 | * @throws \EasyWeChat\Core\Exceptions\RuntimeException |
||
93 | */ |
||
94 | 2 | public function getTicket() |
|
102 | |||
103 | /** |
||
104 | * Set component verify ticket cache key. |
||
105 | * |
||
106 | * @param string $cacheKey |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | 1 | public function setCacheKey($cacheKey) |
|
116 | |||
117 | /** |
||
118 | * Get component verify ticket cache key. |
||
119 | * |
||
120 | * @return string $this->cacheKey |
||
121 | */ |
||
122 | 4 | public function getCacheKey() |
|
130 | } |
||
131 |