public function __construct($id = false, $table = null, $ds = null) { if ($generator = Configure::read('Qlogin.generator')) { $this->generator = $generator; } parent::__construct($id, $table, $ds); }
/** * Constructor * * @param mixed $id The id to start the model on. * @param string $table The table to use for this model. * @param string $ds The connection name this model is connected to. */ public function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); Configure::config('default', new PhpReader(ROOT . '/plugins/Tools/Config/')); Configure::load('google', 'default'); set_include_path(ROOT . '/plugins/Tools/Lib/' . PATH_SEPARATOR . get_include_path()); require_once 'Google/Client.php'; require_once 'Google/Service/Calendar.php'; $this->__client = new Google_Client(); $this->__client->setClientId(Configure::read('google_client_id')); $this->__client->setClientSecret(Configure::read('google_client_secret')); $this->__client->setRedirectUri(Configure::read('google_redirect_url')); $this->__client->setAccessType('offline'); $this->__client->addScope("https://www.googleapis.com/auth/calendar"); $this->__service = new Google_Service_Calendar($this->__client); }