ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeAssignment Class Reference

Represents one assignment of the user to a program tree. More...

+ Collaboration diagram for ilStudyProgrammeAssignment:

Public Member Functions

 __construct (int $id)
 
 getId ()
 
 getRootId ()
 
 withRootId (int $root_prg_id)
 
 getUserId ()
 
 withUserId (int $usr_id)
 
 getLastChangeBy ()
 
 getLastChange ()
 
 withLastChange (int $last_change_by, DateTimeImmutable $timestamp)
 
 getRestartDate ()
 
 getRestartedAssignmentId ()
 
 withRestarted (int $restarted_asssignment_id, DateTimeImmutable $restart_date=null)
 

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

Represents one assignment of the user to a program tree.

One user can have multiple assignments to the same tree.

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
: Nils Haagen nils..nosp@m.haag.nosp@m.en@co.nosp@m.ncep.nosp@m.ts-an.nosp@m.d-tr.nosp@m.ainin.nosp@m.g.de

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

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeAssignment::__construct ( int  $id)

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

References $id.

62  {
63  $this->id = $id;
64  }

Member Function Documentation

◆ getId()

◆ getLastChange()

ilStudyProgrammeAssignment::getLastChange ( )

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

References $last_change.

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

101  {
102  if ($this->last_change) {
103  return DateTimeImmutable::createFromFormat(self::DATE_TIME_FORMAT, $this->last_change);
104  }
105  return $this->last_change;
106  }
+ Here is the caller graph for this function:

◆ getLastChangeBy()

ilStudyProgrammeAssignment::getLastChangeBy ( )

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

References $last_change_by.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRestartDate()

ilStudyProgrammeAssignment::getRestartDate ( )

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

References $restart_date.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRestartedAssignmentId()

ilStudyProgrammeAssignment::getRestartedAssignmentId ( )

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

References $restarted_asssignment_id.

Referenced by ilStudyProgrammeAssignmentDBRepository\update().

+ Here is the caller graph for this function:

◆ getRootId()

◆ getUserId()

◆ withLastChange()

ilStudyProgrammeAssignment::withLastChange ( int  $last_change_by,
DateTimeImmutable  $timestamp 
)
Exceptions
ilExceptionif new date is earlier than the existing one

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

References $last_change_by, and getLastChange().

115  $new_date = $timestamp->format(self::DATE_TIME_FORMAT);
116  if ($this->getLastChange() && $this->getLastChange()->format(self::DATE_TIME_FORMAT) > $new_date) {
117  throw new ilException(
118  "Cannot set last change to an earlier date:"
119  . "\ncurrent: " . $this->getLastChange()->format(self::DATE_TIME_FORMAT)
120  . "\nnew: " . $new_date,
121  1
122  );
123  }
124  $clone = clone $this;
125  $clone->last_change = $new_date;
126  $clone->last_change_by = $last_change_by;
127  return $clone;
128  }
Represents one assignment of the user to a program tree.
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the call graph for this function:

◆ withRestarted()

ilStudyProgrammeAssignment::withRestarted ( int  $restarted_asssignment_id,
DateTimeImmutable  $restart_date = null 
)

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

References $restart_date, and $restarted_asssignment_id.

144  $clone = clone $this;
145  $clone->restarted_asssignment_id = $restarted_asssignment_id;
146  $clone->restart_date = $restart_date;
147  return $clone;
148  }
Represents one assignment of the user to a program tree.

◆ withRootId()

ilStudyProgrammeAssignment::withRootId ( int  $root_prg_id)

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

References $root_prg_id.

Referenced by ilStudyProgrammeAssignmentDBRepository\assignmentByRow().

77  {
78  $clone = clone $this;
79  $clone->root_prg_id = $root_prg_id;
80  return $clone;
81  }
Represents one assignment of the user to a program tree.
+ Here is the caller graph for this function:

◆ withUserId()

ilStudyProgrammeAssignment::withUserId ( int  $usr_id)

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

References $usr_id.

89  {
90  $clone = clone $this;
91  $clone->usr_id = $usr_id;
92  return $clone;
93  }
Represents one assignment of the user to a program tree.

Field Documentation

◆ $id

ilStudyProgrammeAssignment::$id
protected

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

Referenced by __construct(), and getId().

◆ $last_change

ilStudyProgrammeAssignment::$last_change
protected

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

Referenced by getLastChange().

◆ $last_change_by

ilStudyProgrammeAssignment::$last_change_by
protected

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

Referenced by getLastChangeBy(), and withLastChange().

◆ $restart_date

ilStudyProgrammeAssignment::$restart_date
protected

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

Referenced by getRestartDate(), and withRestarted().

◆ $restarted_asssignment_id

ilStudyProgrammeAssignment::$restarted_asssignment_id = self::NO_RESTARTED_ASSIGNMENT
protected

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

Referenced by getRestartedAssignmentId(), and withRestarted().

◆ $root_prg_id

ilStudyProgrammeAssignment::$root_prg_id
protected

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

Referenced by getRootId(), and withRootId().

◆ $usr_id

ilStudyProgrammeAssignment::$usr_id
protected

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

Referenced by getUserId(), and withUserId().

◆ AUTO_ASSIGNED_BY_COURSE

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_COURSE = -3

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

◆ AUTO_ASSIGNED_BY_GROUP

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_GROUP = -4

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

◆ AUTO_ASSIGNED_BY_ORGU

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_ORGU = -2

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

◆ AUTO_ASSIGNED_BY_ROLE

const ilStudyProgrammeAssignment::AUTO_ASSIGNED_BY_ROLE = -1

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

◆ 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: