Пример #1
0
 public function unlinkDoctorAccount(Doctor $doctor)
 {
     $token = AccessToken::getByDoctor($doctor);
     if ($token instanceof AccessToken) {
         $token->remove();
     }
 }
Пример #2
0
 public function __construct(Application_Model_Medical_Doctor $doctor)
 {
     parent::__construct('', '', '');
     $this->_doctor = $doctor;
     $this->_accessToken = Application_Model_Api_Google_AccessToken::getByDoctor($this->_doctor);
     if (!$this->_accessToken) {
         $this->_client = MedOptima_Service_Google_Config::getCalendarClient($this->_doctor->getId());
     }
 }
Пример #3
0
 public function __construct(Doctor $doctor)
 {
     $token = AccessToken::getByDoctor($doctor);
     if ($token instanceof AccessToken && !$token->isExpired()) {
         $client = MedOptima_Service_Google_Config::getCalendarClient();
         $client->setAccessToken($token->jsonSerialize());
         $this->_cal = new Google_CalendarService($client);
     }
     return $this;
 }