ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

Referenced by toFormInput().

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

◆ toFormInput()

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

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

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

48  : \ILIAS\UI\Component\Input\Container\Form\FormInput {
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  }
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:61
+ Here is the call graph for this function:

◆ 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: