Example #1
0
 /**
  * @param boolean $force return value all the time
  * @return mixed (integer|null)
  */
 public function getRuds($force = false)
 {
     if ($force && $this->ruds === null) {
         if ($this->calendar instanceof ICalendar) {
             $cruds = $this->calendar->getCruds();
             if ($cruds & Permissions::CREATE) {
                 return $cruds - Permissions::CREATE;
             } else {
                 return $cruds;
             }
         }
     }
     return $this->getter('ruds');
 }
 /**
  * Reset values that shall not be updated by the user directly
  * @param \OCA\Calendar\ICalendar &$new
  * @param \OCA\Calendar\ICalendar $old
  */
 private function resetReadOnlyProperties(ICalendar &$new, ICalendar $old)
 {
     $new->setUserId($old->getUserId());
     $new->setOwnerId($old->getOwnerId());
     $new->setCruds($old->getCruds());
     $new->setCtag($old->getCtag());
 }