Example #1
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     if ($generator = Configure::read('Qlogin.generator')) {
         $this->generator = $generator;
     }
     parent::__construct($id, $table, $ds);
 }
Example #2
0
 /**
  * Not really necessary probably
  */
 public function find($type = null, $query = [])
 {
     if ($type === 'last') {
         $options = array_merge(['order' => [$this->alias . '.id' => 'DESC']], $query);
         return parent::find('first', $options);
     }
     return parent::find($type, $query);
 }
Example #3
0
File: Qurl.php Project: Jony01/LLD
 public function beforeSave($options = array())
 {
     parent::beforeSave($options);
     if (isset($this->data[$this->alias]['content'])) {
         $this->data[$this->alias]['content'] = serialize($this->data[$this->alias]['content']);
     }
     return true;
 }
Example #4
0
 /**
  * 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);
 }