ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeAssessmentSettings Class Reference
+ Collaboration diagram for ilStudyProgrammeAssessmentSettings:

Public Member Functions

 __construct (int $points, int $status)
 
 getPoints ()
 
 withPoints (int $points)
 
 getStatus ()
 
 withStatus (int $status)
 
 toFormInput (Field\Factory $input, \ilLanguage $lng, Refinery $refinery)
 

Data Fields

const STATUS_DRAFT = 10
 
const STATUS_ACTIVE = 20
 
const STATUS_OUTDATED = 30
 

Static Public Attributes

static $STATUS
 

Protected Member Functions

 getStatusOptions (ilLanguage $lng)
 

Protected Attributes

 $points
 
 $status
 

Detailed Description

Definition at line 10 of file class.ilStudyProgrammeAssessmentSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeAssessmentSettings::__construct ( int  $points,
int  $status 
)

Definition at line 32 of file class.ilStudyProgrammeAssessmentSettings.php.

References $points, and $status.

33  {
34  if (0 > $points) {
35  throw new InvalidArgumentException(
36  'Numbers less than 0 are not allowed'
37  );
38  }
39 
40  if (!in_array($status, self::$STATUS)) {
41  throw new InvalidArgumentException(
42  'No valid status: ' . '\'$status\''
43  );
44  }
45 
46  $this->points = $points;
47  $this->status = $status;
48  }

Member Function Documentation

◆ getPoints()

ilStudyProgrammeAssessmentSettings::getPoints ( )

Definition at line 50 of file class.ilStudyProgrammeAssessmentSettings.php.

References $points.

Referenced by toFormInput().

+ Here is the caller graph for this function:

◆ getStatus()

ilStudyProgrammeAssessmentSettings::getStatus ( )

Definition at line 68 of file class.ilStudyProgrammeAssessmentSettings.php.

References $status.

Referenced by toFormInput().

+ Here is the caller graph for this function:

◆ getStatusOptions()

ilStudyProgrammeAssessmentSettings::getStatusOptions ( ilLanguage  $lng)
protected

Definition at line 121 of file class.ilStudyProgrammeAssessmentSettings.php.

References ilStudyProgrammeSettings\STATUS_ACTIVE, ilStudyProgrammeSettings\STATUS_DRAFT, ilStudyProgrammeSettings\STATUS_OUTDATED, and ilLanguage\txt().

Referenced by toFormInput().

121  : array
122  {
123  return [
124  ilStudyProgrammeSettings::STATUS_DRAFT => $lng->txt("prg_status_draft"),
125  ilStudyProgrammeSettings::STATUS_ACTIVE => $lng->txt("prg_status_active"),
126  ilStudyProgrammeSettings::STATUS_OUTDATED => $lng->txt("prg_status_outdated")
127  ];
128  }
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toFormInput()

ilStudyProgrammeAssessmentSettings::toFormInput ( Field\Factory  $input,
\ilLanguage  $lng,
Refinery  $refinery 
)

Definition at line 86 of file class.ilStudyProgrammeAssessmentSettings.php.

References getPoints(), getStatus(), getStatusOptions(), and ilLanguage\txt().

90  : Field\Input {
91  $num = $input
92  ->numeric($lng->txt('prg_points'), $lng->txt('prg_points_byline'))
93  ->withValue($this->getPoints())
94  ->withAdditionalTransformation($refinery->int()->isGreaterThan(-1))
95  ;
96  $select = $input
97  ->select(
98  $lng->txt('prg_status'),
99  $this->getStatusOptions($lng),
100  $lng->txt('prg_status_byline')
101  )
102  ->withValue($this->getStatus())
103  ->withRequired(true)
104  ;
105 
106  return $input->section(
107  [
108  'points' => $num,
109  'status' => $select
110  ],
111  $lng->txt('prg_assessment')
112  )
113  ->withAdditionalTransformation($refinery->custom()->transformation(function ($vals) {
115  (int) $vals['points'],
116  (int) $vals['status']
117  );
118  }));
119  }
$lng
+ Here is the call graph for this function:

◆ withPoints()

ilStudyProgrammeAssessmentSettings::withPoints ( int  $points)

Definition at line 55 of file class.ilStudyProgrammeAssessmentSettings.php.

References $points.

56  {
57  if (0 > $points) {
58  throw new InvalidArgumentException(
59  'Numbers less than 0 are not allowed'
60  );
61  }
62 
63  $clone = clone $this;
64  $clone->points = $points;
65  return $clone;
66  }

◆ withStatus()

ilStudyProgrammeAssessmentSettings::withStatus ( int  $status)

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

References $status.

74  {
75  if (!in_array($status, self::$STATUS)) {
76  throw new InvalidArgumentException(
77  'No valid status: ' . '\'$status\''
78  );
79  }
80 
81  $clone = clone $this;
82  $clone->status = $status;
83  return $clone;
84  }

Field Documentation

◆ $points

ilStudyProgrammeAssessmentSettings::$points
protected

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

Referenced by __construct(), getPoints(), and withPoints().

◆ $STATUS

ilStudyProgrammeAssessmentSettings::$STATUS
static
Initial value:
= array(
self::STATUS_DRAFT,
self::STATUS_ACTIVE,
self::STATUS_OUTDATED
)

Definition at line 16 of file class.ilStudyProgrammeAssessmentSettings.php.

◆ $status

ilStudyProgrammeAssessmentSettings::$status
protected

Definition at line 30 of file class.ilStudyProgrammeAssessmentSettings.php.

Referenced by __construct(), getStatus(), and withStatus().

◆ STATUS_ACTIVE

const ilStudyProgrammeAssessmentSettings::STATUS_ACTIVE = 20

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

◆ STATUS_DRAFT

const ilStudyProgrammeAssessmentSettings::STATUS_DRAFT = 10

Definition at line 12 of file class.ilStudyProgrammeAssessmentSettings.php.

◆ STATUS_OUTDATED

const ilStudyProgrammeAssessmentSettings::STATUS_OUTDATED = 30

Definition at line 14 of file class.ilStudyProgrammeAssessmentSettings.php.


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