ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAppointmentCourseFileHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
33 public function getFiles(): array
34 {
35 $cat_info = $this->getCatInfo();
36
37 //checking permissions of the parent object.
38 // get course ref id (this is possible, since courses only have one ref id)
39 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
40 $crs_ref_id = current($refs);
41
42 $files = [];
43 if (
44 $this->appointment['event']->isAutoGenerated() &&
45 $this->access->checkAccessOfUser($this->user->getId(), "read", "", $crs_ref_id)
46 ) {
47 $course_files = ilCourseFile::_readFilesByCourse($cat_info['obj_id']);
48 foreach ($course_files as $course_file) {
49 $file_property = new ilFileProperty();
50 $file_property->setAbsolutePath($course_file->getAbsolutePath());
51 $file_property->setFileName($course_file->getFileName());
52 $files[] = $file_property;
53 }
54 }
55 return $files;
56 }
57}
Base file handler class for appointment classes.
static _readFilesByCourse(int $a_course_id)
static _getAllReferences(int $id)
get all reference ids for object ID
Appointment file handler interface.