ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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 array $STATUS
 

Protected Member Functions

 getStatusOptions (ilLanguage $lng)
 

Protected Attributes

int $points
 
int $status
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

40 {
41 if (0 > $points) {
42 throw new InvalidArgumentException('Numbers less than 0 are not allowed');
43 }
44
45 if (!in_array($status, self::$STATUS)) {
46 throw new InvalidArgumentException("No valid status: '$status'");
47 }
48
49 $this->points = $points;
50 $this->status = $status;
51 }

References $points, and $status.

Member Function Documentation

◆ getPoints()

ilStudyProgrammeAssessmentSettings::getPoints ( )

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

53 : int
54 {
55 return $this->points;
56 }

References $points.

◆ getStatus()

ilStudyProgrammeAssessmentSettings::getStatus ( )

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

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

References $status.

◆ getStatusOptions()

ilStudyProgrammeAssessmentSettings::getStatusOptions ( ilLanguage  $lng)
protected

◆ toFormInput()

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

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

90 $num = $input
91 ->numeric($lng->txt('prg_points'), $lng->txt('prg_points_byline'))
92 ->withValue($this->getPoints())
93 ->withAdditionalTransformation($refinery->int()->isGreaterThanOrEqual(0))
94 ;
95 $select = $input
96 ->select(
97 $lng->txt('prg_status'),
98 $this->getStatusOptions($lng),
99 $lng->txt('prg_status_byline')
100 )
101 ->withValue($this->getStatus())
102 ->withRequired(true)
103 ;
104
105 return $input->section(
106 [
107 'points' => $num,
108 'status' => $select
109 ],
110 $lng->txt('prg_assessment')
111 )
112 ->withAdditionalTransformation($refinery->custom()->transformation(function ($vals) {
114 (int) $vals['points'],
115 (int) $vals['status']
116 );
117 }));
118 }
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9
This describes inputs that can be used in forms.
Definition: FormInput.php:32
withValue($value)
Get an input like this with another value displayed on the client side.
Refinery Factory $refinery

◆ withPoints()

ilStudyProgrammeAssessmentSettings::withPoints ( int  $points)

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

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

References $points.

◆ withStatus()

ilStudyProgrammeAssessmentSettings::withStatus ( int  $status)

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

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

References $status.

Field Documentation

◆ $points

int ilStudyProgrammeAssessmentSettings::$points
protected

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

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

◆ $STATUS

◆ $status

int ilStudyProgrammeAssessmentSettings::$status
protected

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

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

◆ STATUS_ACTIVE

const ilStudyProgrammeAssessmentSettings::STATUS_ACTIVE = 20

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

◆ STATUS_DRAFT

const ilStudyProgrammeAssessmentSettings::STATUS_DRAFT = 10

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

◆ STATUS_OUTDATED

const ilStudyProgrammeAssessmentSettings::STATUS_OUTDATED = 30

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


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