ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjectPropertyTitleAndDescription Class Reference
+ Inheritance diagram for ilObjectPropertyTitleAndDescription:
+ Collaboration diagram for ilObjectPropertyTitleAndDescription:

Public Member Functions

 __construct (private string $title='', private string $long_description='', private ?ilObjectTypeSpecificPropertyModifications $object_type_specific_property_modifications=null)
 
 getTitle ()
 
 withTitle (string $title)
 
 getDescription ()
 
 withDescription (string $description)
 
 getLongDescription ()
 
 toForm (\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
 
- Public Member Functions inherited from ilObjectProperty
 toForm (ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
 

Private Attributes

const TITLE_LABEL = 'title'
 
const DESCRIPTION_LABEL = 'description'
 
const GROUP_LABEL = 'title_and_description'
 

Detailed Description

Author
Stephan Kergomard

Definition at line 29 of file ilObjectPropertyTitleAndDescription.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectPropertyTitleAndDescription::__construct ( private string  $title = '',
private string  $long_description = '',
private ?ilObjectTypeSpecificPropertyModifications  $object_type_specific_property_modifications = null 
)

Definition at line 35 of file ilObjectPropertyTitleAndDescription.php.

39  {
40  }

Member Function Documentation

◆ getDescription()

ilObjectPropertyTitleAndDescription::getDescription ( )

Definition at line 58 of file ilObjectPropertyTitleAndDescription.php.

References ilObject\DESC_LENGTH, and getLongDescription().

58  : string
59  {
60  return mb_substr($this->getLongDescription(), 0, ilObject::DESC_LENGTH);
61  }
const DESC_LENGTH
+ Here is the call graph for this function:

◆ getLongDescription()

ilObjectPropertyTitleAndDescription::getLongDescription ( )

Definition at line 70 of file ilObjectPropertyTitleAndDescription.php.

References null.

Referenced by getDescription(), and ilObjectProperties\storePropertyTitleAndDescription().

70  : ?string
71  {
72  if ($this->object_type_specific_property_modifications !== null) {
73  return $this->object_type_specific_property_modifications->modifyDescription($this->long_description);
74  }
75  return $this->long_description;
76  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getTitle()

ilObjectPropertyTitleAndDescription::getTitle ( )

Definition at line 42 of file ilObjectPropertyTitleAndDescription.php.

References null.

Referenced by ilObjectProperties\storePropertyTitleAndDescription().

42  : string
43  {
44  if ($this->object_type_specific_property_modifications !== null) {
45  return $this->object_type_specific_property_modifications->modifyTitle($this->title);
46  }
47 
48  return $this->title;
49  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ toForm()

ilObjectPropertyTitleAndDescription::toForm ( \ilLanguage  $language,
FieldFactory  $field_factory,
Refinery  $refinery 
)

Definition at line 78 of file ilObjectPropertyTitleAndDescription.php.

References ilObject\LONG_DESC_LENGTH, ilObject\TITLE_LENGTH, ilLanguage\txt(), and ILIAS\UI\Component\Input\Container\Form\FormInput\withRequired().

82  : FormInput {
83  $trafo = $refinery->custom()->transformation(
84  function ($vs): ilObjectProperty {
85  list($title, $long_description) = $vs;
87  $title,
88  $long_description
89  );
90  }
91  );
92 
93  $title_input = $field_factory->text($language->txt(self::TITLE_LABEL))
94  ->withoutStripTags()
95  ->withMaxLength(ilObject::TITLE_LENGTH)
96  ->withRequired(true)
97  ->withValue($this->title);
98  $description_input = $field_factory->textarea($language->txt(self::DESCRIPTION_LABEL))
99  ->withoutStripTags()
100  ->withMaxLimit(ilObject::LONG_DESC_LENGTH)
101  ->withValue($this->long_description);
102  return $field_factory->group([$title_input, $description_input], self::GROUP_LABEL)
103  ->withAdditionalTransformation($trafo);
104  }
const TITLE_LENGTH
const LONG_DESC_LENGTH
This describes inputs that can be used in forms.
Definition: FormInput.php:32
+ Here is the call graph for this function:

◆ withDescription()

ilObjectPropertyTitleAndDescription::withDescription ( string  $description)

Definition at line 63 of file ilObjectPropertyTitleAndDescription.php.

63  : self
64  {
65  $clone = clone $this;
66  $clone->long_description = $description;
67  return $clone;
68  }

◆ withTitle()

ilObjectPropertyTitleAndDescription::withTitle ( string  $title)

Definition at line 51 of file ilObjectPropertyTitleAndDescription.php.

51  : self
52  {
53  $clone = clone $this;
54  $clone->title = $title;
55  return $clone;
56  }

Field Documentation

◆ DESCRIPTION_LABEL

const ilObjectPropertyTitleAndDescription::DESCRIPTION_LABEL = 'description'
private

Definition at line 32 of file ilObjectPropertyTitleAndDescription.php.

◆ GROUP_LABEL

const ilObjectPropertyTitleAndDescription::GROUP_LABEL = 'title_and_description'
private

Definition at line 33 of file ilObjectPropertyTitleAndDescription.php.

◆ TITLE_LABEL

const ilObjectPropertyTitleAndDescription::TITLE_LABEL = 'title'
private

Definition at line 31 of file ilObjectPropertyTitleAndDescription.php.


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