ILIAS  release_8 Revision v8.24
class.InvitationsManager.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
26
32{
36
37 public function __construct(
38 InternalRepoService $repo_service
39 ) {
40 $this->repo = $repo_service->participants()->invitations();
41 $this->run_repo = $repo_service->execution()->run();
42 $this->set_repo = $repo_service->settings();
43 }
44
51 public function remove(
52 int $survey_id,
53 int $user_id
54 ): void {
55 $this->repo->remove($survey_id, $user_id);
56 }
57
58 public function removeAll(
59 int $survey_id
60 ): void {
61 $this->repo->removeAll($survey_id);
62 }
63
64
71 public function add(
72 int $survey_id,
73 int $user_id
74 ): void {
75 $this->repo->add($survey_id, $user_id);
76 }
77
83 public function getAllForSurvey(
84 int $survey_id
85 ): array {
86 return $this->repo->getAllForSurvey($survey_id);
87 }
88
93 public function getOpenInvitationsOfUser(
94 int $user_id
95 ): array {
96 // get all invitations
97 $survey_ids = $this->repo->getAllForUser($user_id);
98
99 // check if user started already
100 $finished_surveys = $this->run_repo->getFinishedSurveysOfUser($user_id);
101
102 $open_surveys = array_filter($survey_ids, static function (int $i) use ($finished_surveys) {
103 return !in_array($i, $finished_surveys, true);
104 });
105
106 // filter all surveys that have ended
107 $has_ended = $this->set_repo->hasEnded($open_surveys);
108 $open_surveys = array_filter($open_surveys, static function (int $i) use ($has_ended): bool {
109 return !($has_ended[$i] ?? false);
110 });
111
112 return $open_surveys;
113 }
114}
add(int $survey_id, int $user_id)
Add invitation.
__construct(InternalRepoService $repo_service)
getAllForSurvey(int $survey_id)
Get invitations for survey.
getOpenInvitationsOfUser(int $user_id)
Get all open invitations of a user.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
$i
Definition: metadata.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...