ILIAS  release_8 Revision v8.24
class.ilAppointmentCourseFileHandler.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
6
8
15{
19 public function getFiles(): array
20 {
21 $cat_info = $this->getCatInfo();
22
23 //checking permissions of the parent object.
24 // get course ref id (this is possible, since courses only have one ref id)
25 $refs = ilObject::_getAllReferences($cat_info['obj_id']);
26 $crs_ref_id = current($refs);
27
28 $files = [];
29 if ($this->access->checkAccessOfUser($this->user->getId(), "read", "", $crs_ref_id)) {
30 $course_files = ilCourseFile::_readFilesByCourse($cat_info['obj_id']);
31 foreach ($course_files as $course_file) {
32 $file_property = new ilFileProperty();
33 $file_property->setAbsolutePath($course_file->getAbsolutePath());
34 $file_property->setFileName($course_file->getFileName());
35 $files[] = $file_property;
36 }
37 }
38 return $files;
39 }
40}
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.