ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.

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 }

References $points, and $status.

Member Function Documentation

◆ getPoints()

ilStudyProgrammeAssessmentSettings::getPoints ( )

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

50 : int
51 {
52 return $this->points;
53 }

References $points.

◆ getStatus()

ilStudyProgrammeAssessmentSettings::getStatus ( )

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

68 : int
69 {
70 return $this->status;
71 }

References $status.

◆ getStatusOptions()

ilStudyProgrammeAssessmentSettings::getStatusOptions ( ilLanguage  $lng)
protected

◆ toFormInput()

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

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

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 }

◆ withPoints()

ilStudyProgrammeAssessmentSettings::withPoints ( int  $points)

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

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 }

References $points.

◆ withStatus()

ilStudyProgrammeAssessmentSettings::withStatus ( int  $status)

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

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 }

References $status.

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: