ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStudyProgrammeAssignment Class Reference

Class ilStudyProgrammeAssignment. More...

+ Collaboration diagram for ilStudyProgrammeAssignment:

Public Member Functions

 __construct (int $id)
 
 getId ()
 Get the id of the assignment. More...
 
 getRootId ()
 Get the object id of the program the user was assigned to. More...
 
 setRootId (int $id)
 
 getUserId ()
 Get the id of the user who is assigned. More...
 
 setUserId (int $usr_id)
 
 getLastChangeBy ()
 Get the id of the user who did the last change on this assignment. More...
 
 setLastChangeBy (int $assigned_by_id)
 Set the id of the user who did the last change on this assignment. More...
 
 getLastChange ()
 Get the timestamp of the last change on this program or a sub program. More...
 
 updateLastChange ()
 Update the last change timestamp to the current time. More...
 
 setLastChange (DateTime $timestamp)
 Set the last change timestamp to the given time. More...
 
 setRestartDate (DateTime $date=null)
 Set the date, at which the user is to be reassigned to the programme. More...
 
 getRestartDate ()
 Get the date, at which the user is to be reassigned to the programme. More...
 
 setRestartedAssignmentId (int $id)
 Set the id of the assignment which was intiated due to expiring progress of this assignment. More...
 
 getRestartedAssignmentId ()
 Get the id of the assignment which was intiated due to expiring progress of this assignment. More...
 

Data Fields

const NO_RESTARTED_ASSIGNMENT = -1
 
const DATE_TIME_FORMAT = 'Y-m-d H:i:s'
 
const DATE_FORMAT = 'Y-m-d'
 
const AUTO_ASSIGNED_BY_ROLE = -1
 
const AUTO_ASSIGNED_BY_ORGU = -2
 
const AUTO_ASSIGNED_BY_COURSE = -3
 
const AUTO_ASSIGNED_BY_GROUP = -4
 

Protected Attributes

 $id
 
 $usr_id
 
 $root_prg_id
 
 $last_change
 
 $last_change_by
 
 $restart_date
 
 $restarted_asssignment_id = self::NO_RESTARTED_ASSIGNMENT
 

Detailed Description

Class ilStudyProgrammeAssignment.

Represents one assignment of the user to a program tree.

One user can have multiple assignments to the same tree. This makes it possible to represent programs that need to be accomplished periodically as well.

Author
: Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de
Version
: 0.1.0

Definition at line 18 of file class.ilStudyProgrammeAssignment.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeAssignment::__construct ( int  $id)

Definition at line 84 of file class.ilStudyProgrammeAssignment.php.

References $id.

Member Function Documentation

◆ getId()

ilStudyProgrammeAssignment::getId ( )

Get the id of the assignment.

Returns
int

Definition at line 94 of file class.ilStudyProgrammeAssignment.php.

94 : int
95 {
96 return $this->id;
97 }

References $id.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getLastChange()

ilStudyProgrammeAssignment::getLastChange ( )

Get the timestamp of the last change on this program or a sub program.

Returns
DateTime

Definition at line 174 of file class.ilStudyProgrammeAssignment.php.

174 : DateTime
175 {
176 return DateTime::createFromFormat(self::DATE_TIME_FORMAT, $this->last_change);
177 }

Referenced by ilObjStudyProgramme\getAssignmentsRaw(), and ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getLastChangeBy()

ilStudyProgrammeAssignment::getLastChangeBy ( )

Get the id of the user who did the last change on this assignment.

Returns
int

Definition at line 136 of file class.ilStudyProgrammeAssignment.php.

References $last_change_by.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRestartDate()

ilStudyProgrammeAssignment::getRestartDate ( )

Get the date, at which the user is to be reassigned to the programme.

Returns
DateTime | null

Definition at line 215 of file class.ilStudyProgrammeAssignment.php.

References $restart_date.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRestartedAssignmentId()

ilStudyProgrammeAssignment::getRestartedAssignmentId ( )

Get the id of the assignment which was intiated due to expiring progress of this assignment.

Returns
int

Definition at line 234 of file class.ilStudyProgrammeAssignment.php.

References $restarted_asssignment_id.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRootId()

ilStudyProgrammeAssignment::getRootId ( )

Get the object id of the program the user was assigned to.

Returns
int

Definition at line 104 of file class.ilStudyProgrammeAssignment.php.

References $root_prg_id.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getUserId()

ilStudyProgrammeAssignment::getUserId ( )

Get the id of the user who is assigned.

Returns
int

Definition at line 120 of file class.ilStudyProgrammeAssignment.php.

References $usr_id.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ setLastChange()

ilStudyProgrammeAssignment::setLastChange ( DateTime  $timestamp)

Set the last change timestamp to the given time.

Returns
$this

Definition at line 195 of file class.ilStudyProgrammeAssignment.php.

196 {
197 $this->last_change = $timestamp->format(self::DATE_TIME_FORMAT);
198 return $this;
199 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
Class ilStudyProgrammeAssignment.

References $timestamp.

Referenced by updateLastChange().

+ Here is the caller graph for this function:

◆ setLastChangeBy()

ilStudyProgrammeAssignment::setLastChangeBy ( int  $assigned_by_id)

Set the id of the user who did the last change on this assignment.

Throws when $a_usr_id is not the id of a user.

Exceptions
ilException
Returns
$this

Definition at line 149 of file class.ilStudyProgrammeAssignment.php.

150 {
151 $auto_assignment = [
156 ];
157 $is_auto_assignment = in_array($assigned_by_id, $auto_assignment);
158 $exists = ilObject::_exists($assigned_by_id);
159 $is_usr = ilObject::_lookupType($assigned_by_id) == "usr";
160 if (!$is_auto_assignment && ($exists && !$is_usr)) {
161 throw new ilException("ilStudyProgrammeAssignment::setLastChangeBy: '$assigned_by_id' "
162 . "is neither a user's id nor a valid membership source.");
163 }
164
165 $this->last_change_by = $assigned_by_id;
166 return $this;
167 }
Base class for ILIAS Exception handling.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupType($a_id, $a_reference=false)
lookup object type

References ilObject\_exists(), ilObject\_lookupType(), AUTO_ASSIGNED_BY_COURSE, AUTO_ASSIGNED_BY_GROUP, AUTO_ASSIGNED_BY_ORGU, and AUTO_ASSIGNED_BY_ROLE.

+ Here is the call graph for this function:

◆ setRestartDate()

ilStudyProgrammeAssignment::setRestartDate ( DateTime  $date = null)

Set the date, at which the user is to be reassigned to the programme.

Definition at line 204 of file class.ilStudyProgrammeAssignment.php.

205 {
206 $this->restart_date = $date;
207 return $this;
208 }

◆ setRestartedAssignmentId()

ilStudyProgrammeAssignment::setRestartedAssignmentId ( int  $id)

Set the id of the assignment which was intiated due to expiring progress of this assignment.

Definition at line 223 of file class.ilStudyProgrammeAssignment.php.

224 {
225 $this->restarted_asssignment_id = $id;
226 return $this;
227 }

References $id.

◆ setRootId()

ilStudyProgrammeAssignment::setRootId ( int  $id)

Definition at line 109 of file class.ilStudyProgrammeAssignment.php.

110 {
111 $this->root_prg_id = $id;
112 return $this;
113 }

References $id.

Referenced by ilStudyProgrammeAssignmentDBRepository\assignmentByRow().

+ Here is the caller graph for this function:

◆ setUserId()

ilStudyProgrammeAssignment::setUserId ( int  $usr_id)

Definition at line 125 of file class.ilStudyProgrammeAssignment.php.

126 {
127 $this->usr_id = $usr_id;
128 return $this;
129 }

References $usr_id.

◆ updateLastChange()

ilStudyProgrammeAssignment::updateLastChange ( )

Update the last change timestamp to the current time.

Returns
$this

Definition at line 184 of file class.ilStudyProgrammeAssignment.php.

185 {
186 $this->setLastChange(new DateTime());
187 return $this;
188 }
setLastChange(DateTime $timestamp)
Set the last change timestamp to the given time.

References setLastChange().

+ Here is the call graph for this function:

Field Documentation

◆ $id

ilStudyProgrammeAssignment::$id
protected

◆ $last_change

ilStudyProgrammeAssignment::$last_change
protected

Definition at line 59 of file class.ilStudyProgrammeAssignment.php.

◆ $last_change_by

ilStudyProgrammeAssignment::$last_change_by
protected

Definition at line 66 of file class.ilStudyProgrammeAssignment.php.

Referenced by getLastChangeBy().

◆ $restart_date

ilStudyProgrammeAssignment::$restart_date
protected

Definition at line 73 of file class.ilStudyProgrammeAssignment.php.

Referenced by getRestartDate().

◆ $restarted_asssignment_id

ilStudyProgrammeAssignment::$restarted_asssignment_id = self::NO_RESTARTED_ASSIGNMENT
protected

Definition at line 81 of file class.ilStudyProgrammeAssignment.php.

Referenced by getRestartedAssignmentId().

◆ $root_prg_id

ilStudyProgrammeAssignment::$root_prg_id
protected

Definition at line 51 of file class.ilStudyProgrammeAssignment.php.

Referenced by getRootId().

◆ $usr_id

ilStudyProgrammeAssignment::$usr_id
protected

Definition at line 43 of file class.ilStudyProgrammeAssignment.php.

Referenced by getUserId(), and setUserId().

◆ AUTO_ASSIGNED_BY_COURSE

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_COURSE = -3

Definition at line 27 of file class.ilStudyProgrammeAssignment.php.

Referenced by setLastChangeBy().

◆ AUTO_ASSIGNED_BY_GROUP

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_GROUP = -4

Definition at line 28 of file class.ilStudyProgrammeAssignment.php.

Referenced by setLastChangeBy().

◆ AUTO_ASSIGNED_BY_ORGU

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_ORGU = -2

Definition at line 26 of file class.ilStudyProgrammeAssignment.php.

Referenced by setLastChangeBy().

◆ AUTO_ASSIGNED_BY_ROLE

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_ROLE = -1

Definition at line 25 of file class.ilStudyProgrammeAssignment.php.

Referenced by setLastChangeBy().

◆ DATE_FORMAT

◆ DATE_TIME_FORMAT

const ilStudyProgrammeAssignment::DATE_TIME_FORMAT = 'Y-m-d H:i:s'

◆ NO_RESTARTED_ASSIGNMENT


The documentation for this class was generated from the following file: