Overview

Namespaces

  • DocPlanner
    • SDK
      • Base
        • ServiceDescription
      • Core
      • Model
        • Doctor
        • Geo
        • User
        • Visit
  • PHP

Classes

  • DocPlannerSDK
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Author: Ɓukasz Barulski
  4:  * Date: 23.04.13 17:37
  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:      * @var Doctor
 22:      */
 23:     protected $doctor;
 24: 
 25:     /**
 26:      * @var User
 27:      */
 28:     protected $user;
 29: 
 30:     /**
 31:      * @var Geo
 32:      */
 33:     protected $geo;
 34: 
 35:     /**
 36:      * @var Visit
 37:      */
 38:     protected $visit;
 39: 
 40:     /**
 41:      * @var BaseSDK
 42:      */
 43:     protected $baseSDK;
 44: 
 45:     /**
 46:      * @var Base\Parameter
 47:      */
 48:     protected $parameter;
 49: 
 50:     /**
 51:      * @param string $consumerKey
 52:      * @param string $consumerSecret
 53:      * @param string $resultType
 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:      * @return Doctor
 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:      * @return User
 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:      * @return Geo
 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:      * @return Visit
 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:      * @param $token
111:      * @param $token_secret
112:      *
113:      * @return void
114:      */
115:     public function setToken($token, $token_secret)
116:     {
117:         $this->baseSDK->setToken($token, $token_secret);
118:     }
119: 
120:     /**
121:      * @return array
122:      */
123:     public function getToken()
124:     {
125:         return $this->baseSDK->getToken();
126:     }
127: }
Docplanner API documentation generated by ApiGen 2.8.0