ILIAS  release_8 Revision v8.24
ilStudyProgrammeTypeSettings Class Reference
+ Collaboration diagram for ilStudyProgrammeTypeSettings:

Public Member Functions

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

Protected Attributes

int $type_id
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeTypeSettings::__construct ( int  $type_id)

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

29 {
30 $this->type_id = $type_id;
31 }

References $type_id.

Member Function Documentation

◆ getTypeId()

ilStudyProgrammeTypeSettings::getTypeId ( )

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

33 : int
34 {
35 return $this->type_id;
36 }

References $type_id.

◆ toFormInput()

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

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

51 $select = $input
52 ->select($lng->txt('type'), $sp_types, $lng->txt('prg_type_byline'))
53 ->withValue($this->getTypeId() === 0 ? "" : $this->getTypeId())
54 ->withAdditionalTransformation($refinery->custom()->transformation(function ($v) {
55 if ($v == "") {
56 return 0;
57 }
58 return $v;
59 }))
60 ;
61
62 return $input->section(
63 [
64 'type' => $select
65 ],
66 $lng->txt('prg_type')
67 )
68 ->withAdditionalTransformation($refinery->custom()->transformation(function ($vals) {
69 return new ilStudyProgrammeTypeSettings((int) $vals['type']);
70 }));
71 }
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
$lng

◆ withTypeId()

ilStudyProgrammeTypeSettings::withTypeId ( int  $type_id)

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

39 {
40 $clone = clone $this;
41 $clone->type_id = $type_id;
42 return $clone;
43 }

References $type_id.

Field Documentation

◆ $type_id

int ilStudyProgrammeTypeSettings::$type_id
protected

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

Referenced by __construct(), getTypeId(), and withTypeId().


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