コード例 #1
0
 /**
  * This function creates a queue for the differential sync
  *
  * @param   string   $data      String containing the JSON data to be sync   
  *
  * @return  mixed    returns the ticket of the queue, or false if an error exists
  */
 public function eventDifferentialSync($data)
 {
     global $arrConf;
     if (!$this->_checkUserAuthorized('calendar')) {
         return false;
     }
     $dbCalendar = $this->_getDB($arrConf['dsn_conn_database']);
     $pCalendar = new paloSantoCalendar($dbCalendar);
     // Obtener el ID del usuario logoneado
     $id_user = $this->_leerIdUser();
     if (is_null($id_user)) {
         return false;
     }
     $result = $pCalendar->addQueue($data, "event", $id_user);
     if (!$result) {
         $this->errMsg["fc"] = 'DBERROR';
         $this->errMsg["fm"] = 'Database operation failed';
         $this->errMsg["fd"] = 'Unable to write data - ' . $pCalendar->_DB->errMsg;
         $this->errMsg["cn"] = get_class($pCalendar);
         return false;
     } else {
         return $result;
     }
 }