ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilStudyProgrammeAutoMembershipSource.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types = 1);
4
11{
12 const TYPE_ROLE = 'role';
13 const TYPE_GROUP = 'grp';
14 const TYPE_COURSE = 'crs';
15 const TYPE_ORGU = 'orgu';
16
22 ];
23
24
28 protected $prg_obj_id;
29
33 protected $source_type;
34
38 protected $source_id;
39
43 protected $enabled;
44
49
53 protected $last_edited;
54
55 public function __construct(
56 int $prg_obj_id,
57 string $source_type,
58 int $source_id,
59 bool $enabled,
61 \DateTimeImmutable $last_edited
62 ) {
63 if (!in_array($source_type, [
64 self::TYPE_ROLE,
65 self::TYPE_GROUP,
66 self::TYPE_COURSE,
67 self::TYPE_ORGU
68 ])) {
69 throw new \InvalidArgumentException("Invalid source-type: " . $source_type, 1);
70 }
71
72 $this->prg_obj_id = $prg_obj_id;
73 $this->source_type = $source_type;
74 $this->source_id = $source_id;
75 $this->enabled = $enabled;
76 $this->last_edited_usr_id = $last_edited_usr_id;
77 $this->last_edited = $last_edited;
78 }
79
80 public function getPrgObjId() : int
81 {
82 return $this->prg_obj_id;
83 }
84
85 public function getSourceType() : string
86 {
87 return $this->source_type;
88 }
89
90 public function getSourceId() : int
91 {
92 return $this->source_id;
93 }
94
95 public function isEnabled() : bool
96 {
97 return $this->enabled;
98 }
99
100 public function getLastEditorId() : int
101 {
103 }
104
105 public function getLastEdited() : \DateTimeImmutable
106 {
107 return $this->last_edited;
108 }
109}
An exception for terminatinating execution or to throw for unit testing.
__construct(int $prg_obj_id, string $source_type, int $source_id, bool $enabled, int $last_edited_usr_id, \DateTimeImmutable $last_edited)