ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStudyProgrammeTypeSettings Class Reference
+ Collaboration diagram for ilStudyProgrammeTypeSettings:

Public Member Functions

 __construct (protected int $type_id)
 
 getTypeId ()
 
 withTypeId (int $type_id)
 
 toFormInput (Field\Factory $input, ilLanguage $lng, Refinery $refinery, array $sp_types)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeTypeSettings::__construct ( protected int  $type_id)

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

28 {
29 }

Member Function Documentation

◆ getTypeId()

ilStudyProgrammeTypeSettings::getTypeId ( )

Definition at line 31 of file class.ilStudyProgrammeTypeSettings.php.

31 : int
32 {
33 return $this->type_id;
34 }

◆ toFormInput()

ilStudyProgrammeTypeSettings::toFormInput ( Field\Factory  $input,
ilLanguage  $lng,
Refinery  $refinery,
array  $sp_types 
)

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

49 $select = $input
50 ->select($lng->txt('type'), $sp_types, $lng->txt('prg_type_byline'))
51 ->withValue($this->getTypeId() === 0 ? "" : $this->getTypeId())
52 ->withAdditionalTransformation($refinery->custom()->transformation(function ($v) {
53 if ($v == "") {
54 return 0;
55 }
56 return $v;
57 }))
58 ;
59
60 return $input->section(
61 [
62 'type' => $select
63 ],
64 $lng->txt('prg_type')
65 )
66 ->withAdditionalTransformation($refinery->custom()->transformation(function ($vals) {
67 return new ilStudyProgrammeTypeSettings((int) $vals['type']);
68 }));
69 }
This describes inputs that can be used in forms.
Definition: FormInput.php:33
withValue($value)
Get an input like this with another value displayed on the client side.
global $lng
Definition: privfeed.php:31

◆ withTypeId()

ilStudyProgrammeTypeSettings::withTypeId ( int  $type_id)

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

37 {
38 $clone = clone $this;
39 $clone->type_id = $type_id;
40 return $clone;
41 }

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