/** * This method is only for rest purposes * * @access private */ public function addFile(array $fileParameters) { if (!$this->isActionAllowed(self::ACTION_EDIT)) { throw new TasksException('Access denied', TasksException::TE_ACTION_NOT_ALLOWED); } $attachmentId = (int) Attachment::add($this->getId(), $fileParameters, array('USER_ID' => $GLOBALS['USER']->GetId(), 'ENTITY_ID' => UserField::getTargetEntityId(), 'FIELD_NAME' => 'UF_TASK_WEBDAV_FILES')); // drop cache $this->markCacheAsDirty(); return $attachmentId; }