1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the overtrue/wechat. |
5
|
|
|
* |
6
|
|
|
* (c) overtrue <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* AbstractOpenPlatform.php. |
14
|
|
|
* |
15
|
|
|
* Part of Overtrue\WeChat. |
16
|
|
|
* |
17
|
|
|
* For the full copyright and license information, please view the LICENSE |
18
|
|
|
* file that was distributed with this source code. |
19
|
|
|
* |
20
|
|
|
* @author mingyoung <[email protected]> |
21
|
|
|
* @author lixiao <[email protected]> |
22
|
|
|
* @copyright 2016 |
23
|
|
|
* |
24
|
|
|
* @see https://github.com/overtrue |
25
|
|
|
* @see http://overtrue.me |
26
|
|
|
*/ |
27
|
|
|
|
28
|
|
|
namespace EasyWeChat\OpenPlatform\Api; |
29
|
|
|
|
30
|
|
|
use EasyWeChat\Core\AbstractAPI; |
31
|
|
|
use EasyWeChat\OpenPlatform\AccessToken; |
32
|
|
|
use Symfony\Component\HttpFoundation\Request; |
33
|
|
|
|
34
|
|
|
abstract class AbstractOpenPlatform extends AbstractAPI |
35
|
|
|
{ |
36
|
|
|
/** |
37
|
|
|
* Request. |
38
|
|
|
* |
39
|
|
|
* @var \Symfony\Component\HttpFoundation\Request |
40
|
|
|
*/ |
41
|
|
|
protected $request; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* AbstractOpenPlatform constructor. |
45
|
|
|
* |
46
|
|
|
* @param \EasyWeChat\OpenPlatform\AccessToken $accessToken |
47
|
|
|
* @param \Symfony\Component\HttpFoundation\Request $request |
48
|
|
|
*/ |
49
|
12 |
|
public function __construct(AccessToken $accessToken, Request $request) |
50
|
|
|
{ |
51
|
12 |
|
parent::__construct($accessToken); |
52
|
|
|
|
53
|
12 |
|
$this->request = $request; |
54
|
12 |
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Get OpenPlatform AppId. |
58
|
|
|
* |
59
|
|
|
* @return string |
60
|
|
|
*/ |
61
|
10 |
|
public function getAppId() |
62
|
|
|
{ |
63
|
10 |
|
return $this->getAccessToken()->getAppId(); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|