Exemplo n.º 1
0
 /**
  * @brief returns the cache of an event in a specific peroid
  * @param (int) $id - id of the event
  * @param (DateTime) $from - start for period in UTC
  * @param (DateTime) $until - end for period in UTC
  * @return (array)
  */
 public static function get_inperiod($id, $from, $until)
 {
     $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_repeat` WHERE `eventid` = ?' . ' AND ((`startdate` >= ? AND `startdate` <= ?)' . ' OR (`enddate` >= ? AND `enddate` <= ?))');
     $result = $stmt->execute(array($id, OC_Calendar_Object::getUTCforMDB($from), OC_Calendar_Object::getUTCforMDB($until), OC_Calendar_Object::getUTCforMDB($from), OC_Calendar_Object::getUTCforMDB($until)));
     $return = array();
     while ($row = $result->fetchRow()) {
         $return[] = $row;
     }
     return $return;
 }