ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAppointmentCourseFileHandler.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4
6
14{
18 public function getFiles() : array
19 {
20 $cat_info = $this->getCatInfo();
21
22 //checking permissions of the parent object.
23 // get course ref id (this is possible, since courses only have one ref id)
24 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
25 $crs_ref_id = current($refs);
26
27 $files = [];
28 if ($this->access->checkAccessOfUser($this->user->getId(), "read", "", $crs_ref_id)) {
29 $course_files = ilCourseFile::_readFilesByCourse($cat_info['obj_id']);
30 foreach ($course_files as $course_file) {
31
32 $file_property = new ilFileProperty();
33 $file_property->setAbsolutePath($course_file->getAbsolutePath());
34 $file_property->setFileName($course_file->getFileName());
35
36 $files[] = $file_property;
37 }
38 }
39 return $files;
40 }
41}
An exception for terminatinating execution or to throw for unit testing.
Base file handler class for appointment classes.
static _readFilesByCourse($a_course_id)
static _getAllReferences($a_id)
get all reference ids of object
Appointment file handler interface.