1: <?php
2: 3: 4: 5:
6: namespace DocPlanner\SDK;
7:
8: use DocPlanner\SDK\Base\BaseSDK;
9: use DocPlanner\SDK\Base\Parameter;
10: use DocPlanner\SDK\Core\Doctor;
11: use DocPlanner\SDK\Core\User;
12: use DocPlanner\SDK\Core\Geo;
13: use DocPlanner\SDK\Core\Visit;
14:
15: class DocPlannerSDK
16: {
17: const RESULT_TYPE_RESULT_OBJECT = BaseSDK::RESULT_TYPE_RESULT_OBJECT;
18: const RESULT_TYPE_ARRAY = BaseSDK::RESULT_TYPE_ARRAY;
19:
20: 21: 22:
23: protected $doctor;
24:
25: 26: 27:
28: protected $user;
29:
30: 31: 32:
33: protected $geo;
34:
35: 36: 37:
38: protected $visit;
39:
40: 41: 42:
43: protected $baseSDK;
44:
45: 46: 47:
48: protected $parameter;
49:
50: 51: 52: 53: 54:
55: public function __construct($consumerKey, $consumerSecret, $resultType = self::RESULT_TYPE_RESULT_OBJECT)
56: {
57: $this->baseSDK = new BaseSDK($consumerKey, $consumerSecret, $resultType);
58: $this->parameter = new Parameter();
59: }
60:
61: 62: 63:
64: public function doctor()
65: {
66: if (null === $this->doctor)
67: {
68: $this->doctor = new Doctor($this->baseSDK, $this->parameter);
69: }
70: return $this->doctor;
71: }
72:
73: 74: 75:
76: public function user()
77: {
78: if (null === $this->user)
79: {
80: $this->user = new User($this->baseSDK, $this->parameter);
81: }
82: return $this->user;
83: }
84:
85: 86: 87:
88: public function geo()
89: {
90: if (null === $this->geo)
91: {
92: $this->geo = new Geo($this->baseSDK, $this->parameter);
93: }
94: return $this->geo;
95: }
96:
97: 98: 99:
100: public function visit()
101: {
102: if (null === $this->visit)
103: {
104: $this->visit = new Visit($this->baseSDK, $this->parameter);
105: }
106: return $this->visit;
107: }
108:
109: 110: 111: 112: 113: 114:
115: public function setToken($token, $token_secret)
116: {
117: $this->baseSDK->setToken($token, $token_secret);
118: }
119:
120: 121: 122:
123: public function getToken()
124: {
125: return $this->baseSDK->getToken();
126: }
127: }