public function unlinkDoctorAccount(Doctor $doctor) { $token = AccessToken::getByDoctor($doctor); if ($token instanceof AccessToken) { $token->remove(); } }
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()); } }
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; }