ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References $type_id.

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

Member Function Documentation

◆ getTypeId()

ilStudyProgrammeTypeSettings::getTypeId ( )

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

References $type_id.

Referenced by toFormInput().

33  : int
34  {
35  return $this->type_id;
36  }
+ Here is the caller graph for this function:

◆ toFormInput()

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

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

References getTypeId(), ilLanguage\txt(), ILIAS\UI\Implementation\Component\Input\ViewControl\withAdditionalTransformation(), and ILIAS\UI\Implementation\Component\Input\withValue().

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  }
txt(string $a_topic, string $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...
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
This describes inputs that can be used in forms.
Definition: FormInput.php:31
Refinery Factory $refinery
+ Here is the call graph for this function:

◆ withTypeId()

ilStudyProgrammeTypeSettings::withTypeId ( int  $type_id)

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

References $type_id.

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

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: