ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilAdvancedMDFieldDefinitionText Class Reference

AMD field type text. More...

+ Inheritance diagram for ilAdvancedMDFieldDefinitionText:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionText:

Public Member Functions

 getType ()
 
 getADTGroup ()
 
 getTitles ()
 
 hasComplexOptions ()
 
 isMultilingualValueSupport ()
 
 setMultilingualValueSupport (bool $multilingual_value_support)
 
 setMaxLength (?int $max_length)
 
 getMaxLength ()
 
 setMulti (bool $a_value)
 
 isMulti ()
 
 getFieldDefinitionForTableGUI (string $content_language)
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 Import custom post values from definition form. More...
 
 importXMLProperty (string $a_key, string $a_value)
 
 importValueFromXML (string $a_cdata)
 
 importFromECS (string $a_ecs_type, $a_value, string $a_sub_id)
 
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 
 getSearchQueryParserValue (ilADTSearchBridge $a_adt_search)
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
 
- Public Member Functions inherited from ilAdvancedMDFieldDefinitionGroupBased
 setOptions (?array $a_values=null)
 
 getOptions ()
 
 getFieldDefinitionForTableGUI (string $content_language)
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 
 importXMLProperty (string $a_key, string $a_value)
 
 getValueForXML (ilADT $element)
 
 importValueFromXML (string $a_cdata)
 
 getADTGroup ()
 
 getTitles ()
 
 hasComplexOptions ()
 
 getComplexOptionsOverview (object $a_parent_gui, string $a_parent_cmd)
 
 exportOptionToTableGUI ($a_option, array &$a_item)
 
 initOptionForm (ilPropertyFormGUI $a_form, $a_option_id)
 
 updateComplexOption (ilPropertyFormGUI $a_form, $a_option_id)
 
- Public Member Functions inherited from ilAdvancedMDFieldDefinition
 __construct (GenericData $generic_data, string $language='')
 
 getType ()
 Get type. More...
 
 useDefaultLanguageMode (string $language)
 Check if default language mode has to be used: no language given or language equals default language. More...
 
 getTypeTitle ()
 
 getADTDefinition ()
 Get ADT definition instance. More...
 
 getADT ()
 
 getFieldId ()
 Get field_id. More...
 
 setRecordId (int $a_id)
 Set record id. More...
 
 getRecordId ()
 Get record id. More...
 
 setImportId (string $a_id_string)
 Set import id. More...
 
 getImportId ()
 Get import id. More...
 
 setPosition (int $a_pos)
 Set position. More...
 
 getPosition ()
 Get position. More...
 
 setTitle (string $a_title)
 Get title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription (string $a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 isSearchSupported ()
 Is search supported at all. More...
 
 isFilterSupported ()
 Is search by filter supported. More...
 
 setSearchable (bool $a_status)
 Toggle searchable. More...
 
 isSearchable ()
 Is searchable. More...
 
 setRequired (bool $a_status)
 Toggle required. More...
 
 isRequired ()
 Is required field. More...
 
 getFieldDefinitionForTableGUI (string $content_language)
 Parse properties for table gui. More...
 
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions, string $language='')
 Add input elements to definition form. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 Import custom post values from definition form. More...
 
 importDefinitionFormPostValues (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions, string $active_language)
 Import post values from definition form. More...
 
 importDefinitionFormPostValuesNeedsConfirmation ()
 
 prepareCustomDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 prepareDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 generateImportId (int $a_field_id)
 Generate unique record id. More...
 
 save (bool $keep_pos_and_import_id=false, bool $keep_import_id=false)
 Create new field entry. More...
 
 update ()
 Update field entry. More...
 
 delete ()
 Delete field entry. More...
 
 toXML (ilXmlWriter $a_writer)
 To Xml. More...
 
 importXMLProperty (string $a_key, string $a_value)
 Import property from XML. More...
 
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export) More...
 
 importValueFromXML (string $a_cdata)
 Import value from xml. More...
 
 importFromECS (string $a_ecs_type, $a_value, string $a_sub_id)
 Import meta data from ECS. More...
 
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 Prepare editor form elements. More...
 
 getSearchQueryParserValue (ilADTSearchBridge $a_adt_search)
 Get value for search query parser. More...
 
 getSearchValueSerialized (ilADTSearchBridge $a_adt_search)
 
 setSearchValueSerialized (ilADTSearchBridge $a_adt_search, $a_value)
 Set value from search persistence. More...
 
 searchSubObjects (ilADTSearchBridge $a_adt_search, int $a_obj_id, string $sub_obj_type)
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
 Search objects. More...
 
 getLuceneSearchString ($a_value)
 Get search string in lucene syntax. More...
 
 prepareElementForSearch (ilADTSearchBridge $a_bridge)
 Prepare search form elements. More...
 
 _clone (int $a_new_record_id)
 Clone field definition. More...
 
 hasComplexOptions ()
 
 getComplexOptionsOverview (object $a_parent_gui, string $parent_cmd)
 

Data Fields

const XML_SEPARATOR_TRANSLATIONS = "~|~"
 
const XML_SEPARATOR_TRANSLATION = '~+~'
 
const KEY_MULTI = "multi"
 
- Data Fields inherited from ilAdvancedMDFieldDefinition
const TYPE_SELECT = 1
 TODO: put this in when minimum php version is set to 8.2. More...
 
const TYPE_TEXT = 2
 
const TYPE_DATE = 3
 
const TYPE_DATETIME = 4
 
const TYPE_INTEGER = 5
 
const TYPE_FLOAT = 6
 
const TYPE_LOCATION = 7
 
const TYPE_SELECT_MULTI = 8
 
const TYPE_ADDRESS = 99
 
const TYPE_EXTERNAL_LINK = 9
 
const TYPE_INTERNAL_LINK = 10
 

Protected Member Functions

 initADTDefinition ()
 
 importFieldDefinition (array $a_def)
 
 getFieldDefinition ()
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, bool $a_disabled=false, string $language='')
 Add input elements to definition form. More...
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 
 parseSearchObjects (array $a_records, array $a_object_types)
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinitionGroupBased
 initADTDefinition ()
 
 importFieldDefinition (array $a_def)
 
 getFieldDefinition ()
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, bool $a_disabled=false, string $language='')
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 
 getADTForOption (string $a_option)
 
 importComplexOptionFromForm (string $a_option, ilADT $a_adt)
 
 findOptionById (string $a_id)
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 initADTDefinition ()
 Init adt instance. More...
 
 setADT (ilADT $a_adt)
 Set ADT instance. More...
 
 importFieldDefinition (array $a_def)
 Import (type-specific) field definition from DB. More...
 
 getFieldDefinition ()
 Get (type-specific) field definition. More...
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, bool $a_disabled=false, string $language='')
 Add custom input elements to definition form. More...
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 Add (type-specific) properties to xml export. More...
 
 parseSearchObjects (array $a_records, array $a_object_types)
 Add object-data needed for global search to AMD search results. More...
 

Protected Attributes

int $max_length = null
 
bool $multi = false
 
bool $multilingual_value_support = true
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinitionGroupBased
 $options = []
 
 $complex = []
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
GenericData $generic_data
 
ilADTDefinition $adt_def = null
 
ilADT $adt = null
 
string $language = ''
 
ilDBInterface $db
 
ilLanguage $lng
 
ilLogger $logger
 
GlobalHttpState $http
 
RefineryFactory $refinery
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstance (?int $a_field_id, ?int $a_type=null, string $language='')
 
static exists (int $a_field_id)
 
static getInstanceByTypeString (string $a_type)
 Get instance by type string (used by import) More...
 
static getInstancesByRecordId ( $a_record_id, $a_only_searchable=false, string $language='')
 Get definitions by record id. More...
 
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
 
static getInstanceByImportId (string $a_import_id)
 
static getSearchableDefinitionIds ()
 Get searchable definition ids (performance is key) More...
 
static getADTGroupForDefinitions (array $a_defs)
 Init ADTGroup for definitions. More...
 
static getValidTypes ()
 Get all valid types. More...
 
static isValidType (int $a_type)
 
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstanceWithData (GenericData $generic_data, string $language='')
 
static getTypeString (int $a_type)
 Get type as string. More...
 

Detailed Description

AMD field type text.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ addCustomFieldToDefinitionForm()

ilAdvancedMDFieldDefinitionText::addCustomFieldToDefinitionForm ( ilPropertyFormGUI  $a_form,
bool  $a_disabled = false,
string  $language = '' 
)
protected

Add input elements to definition form.

Parameters
ilPropertyFormGUI$a_form
bool$a_disabled
string$language

Definition at line 154 of file class.ilAdvancedMDFieldDefinitionText.php.

References $DIC, ilAdvancedMDFieldDefinition\$lng, ilPropertyFormGUI\addItem(), ilAdvancedMDRecordTranslations\getInstanceByRecordId(), getMaxLength(), ilAdvancedMDFieldDefinition\getRecordId(), isMulti(), isMultilingualValueSupport(), ilLanguage\loadLanguageModule(), ilNumberInputGUI\setValue(), and ilLanguage\txt().

158  : void {
159  global $DIC;
160 
161  $lng = $DIC['lng'];
162  $lng->loadLanguageModule('meta');
163 
164  $max = new ilNumberInputGUI($lng->txt("md_adv_text_max_length"), "max");
165  $max->setValue((string) $this->getMaxLength());
166  $max->setSize(10);
167  $max->setSuffix($lng->txt("characters"));
168  $max->setMinValue(1);
169  $max->setMaxValue(4000); // DB limit
170  $a_form->addItem($max);
171 
172  $multi = new ilCheckboxInputGUI($lng->txt("md_adv_text_multi"), self::KEY_MULTI);
173  $multi->setValue("1");
174  $multi->setChecked($this->isMulti());
175  $a_form->addItem($multi);
176 
177  if ($a_disabled) {
178  $max->setDisabled(true);
179  $multi->setDisabled(true);
180  }
182  if (!count($record_translations->getTranslations())) {
183  return;
184  }
185  $multilingual_values = new ilCheckboxInputGUI(
186  $lng->txt('md_adv_text_multi_val'),
187  'multilingual'
188  );
189  $multilingual_values->setInfo($lng->txt('md_adv_text_multi_val_info'));
190  $multilingual_values->setChecked($this->isMultilingualValueSupport());
191  $multilingual_values->setValue("1");
192  $a_form->addItem($multilingual_values);
193  }
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...
loadLanguageModule(string $a_module)
Load language module.
This class represents a number property in a property form.
setValue(?string $a_value)
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ addPropertiesToXML()

ilAdvancedMDFieldDefinitionText::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

Definition at line 212 of file class.ilAdvancedMDFieldDefinitionText.php.

References getMaxLength(), isMulti(), isMultilingualValueSupport(), and ilXmlWriter\xmlElement().

212  : void
213  {
214  $a_writer->xmlElement('FieldValue', array("id" => "max"), $this->getMaxLength());
215  $a_writer->xmlElement('FieldValue', array("id" => self::KEY_MULTI), $this->isMulti());
216  $a_writer->xmlElement('FieldValue', ['id' => 'multilingual_values'], $this->isMultilingualValueSupport());
217  }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ getADTGroup()

ilAdvancedMDFieldDefinitionText::getADTGroup ( )

Definition at line 46 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilAdvancedMDFieldDefinition\getADTDefinition().

47  {
48  return $this->getADTDefinition();
49  }
getADTDefinition()
Get ADT definition instance.
ADT definition base class.
+ Here is the call graph for this function:

◆ getFieldDefinition()

ilAdvancedMDFieldDefinitionText::getFieldDefinition ( )
protected

Definition at line 121 of file class.ilAdvancedMDFieldDefinitionText.php.

References getMaxLength(), isMulti(), and isMultilingualValueSupport().

121  : array
122  {
123  return [
124  "max" => $this->getMaxLength(),
125  self::KEY_MULTI => $this->isMulti(),
126  'multilingual_values' => $this->isMultilingualValueSupport()
127  ];
128  }
+ Here is the call graph for this function:

◆ getFieldDefinitionForTableGUI()

ilAdvancedMDFieldDefinitionText::getFieldDefinitionForTableGUI ( string  $content_language)

Definition at line 130 of file class.ilAdvancedMDFieldDefinitionText.php.

References $DIC, ilAdvancedMDFieldDefinition\$lng, $res, getMaxLength(), isMulti(), null, and ilLanguage\txt().

130  : array
131  {
132  global $DIC;
133 
134  $lng = $DIC['lng'];
135 
136  $res = array();
137 
138  if ($this->getMaxLength() !== null) {
139  $res[$lng->txt("md_adv_text_max_length")] = $this->getMaxLength();
140  }
141  if ($this->isMulti()) {
142  $res[$lng->txt("md_adv_text_multi")] = $lng->txt("yes");
143  }
144 
145  return $res;
146  }
$res
Definition: ltiservices.php:66
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ getMaxLength()

ilAdvancedMDFieldDefinitionText::getMaxLength ( )

◆ getSearchQueryParserValue()

ilAdvancedMDFieldDefinitionText::getSearchQueryParserValue ( ilADTSearchBridge  $a_adt_search)

Definition at line 309 of file class.ilAdvancedMDFieldDefinitionText.php.

309  : string
310  {
311  return (string) $a_adt_search->getADT()->getText();
312  }

◆ getTitles()

ilAdvancedMDFieldDefinitionText::getTitles ( )

Definition at line 51 of file class.ilAdvancedMDFieldDefinitionText.php.

51  : array
52  {
53  return [];
54  }

◆ getType()

ilAdvancedMDFieldDefinitionText::getType ( )

Definition at line 41 of file class.ilAdvancedMDFieldDefinitionText.php.

Referenced by searchObjects().

41  : int
42  {
43  return self::TYPE_TEXT;
44  }
+ Here is the caller graph for this function:

◆ hasComplexOptions()

ilAdvancedMDFieldDefinitionText::hasComplexOptions ( )

Definition at line 56 of file class.ilAdvancedMDFieldDefinitionText.php.

56  : bool
57  {
58  return false;
59  }

◆ importCustomDefinitionFormPostValues()

ilAdvancedMDFieldDefinitionText::importCustomDefinitionFormPostValues ( ilPropertyFormGUI  $a_form,
string  $language = '' 
)

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form
string$language

Definition at line 200 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilPropertyFormGUI\getInput(), null, setMaxLength(), setMulti(), and setMultilingualValueSupport().

200  : void
201  {
202  $max = $a_form->getInput("max");
203  $this->setMaxLength(($max !== "" && $max !== null) ? (int) $max : null);
204  $this->setMulti((bool) $a_form->getInput(self::KEY_MULTI));
205  $this->setMultilingualValueSupport((bool) $a_form->getInput('multilingual'));
206  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
setMultilingualValueSupport(bool $multilingual_value_support)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ importFieldDefinition()

ilAdvancedMDFieldDefinitionText::importFieldDefinition ( array  $a_def)
protected

Definition at line 113 of file class.ilAdvancedMDFieldDefinitionText.php.

References null, setMaxLength(), setMulti(), and setMultilingualValueSupport().

113  : void
114  {
115  $this->setMaxLength(isset($a_def["max"]) ? (int) $a_def["max"] : null);
116  $this->setMulti((bool) ($a_def[self::KEY_MULTI] ?? false));
117  $multilingual_values = (bool) ($a_def['multilingual_values'] ?? true);
118  $this->setMultilingualValueSupport($multilingual_values);
119  }
setMultilingualValueSupport(bool $multilingual_value_support)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ importFromECS()

ilAdvancedMDFieldDefinitionText::importFromECS ( string  $a_ecs_type,
  $a_value,
string  $a_sub_id 
)

Definition at line 270 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilAdvancedMDFieldDefinition\getADT(), ILIAS\Repository\int(), null, ilECSUtils\TYPE_ARRAY, ilECSUtils\TYPE_INT, ilECSUtils\TYPE_STRING, and ilECSUtils\TYPE_TIMEPLACE.

270  : bool
271  {
272  $value = '';
273  switch ($a_ecs_type) {
275  $value = implode(',', (array) $a_value);
276  break;
277 
279  $value = (int) $a_value;
280  break;
281 
283  $value = (string) $a_value;
284  break;
285 
287  if ($a_value instanceof ilECSTimePlace) {
288  $value = $a_value->{'get' . ucfirst($a_sub_id)}();
289  }
290  break;
291  }
292 
293  if (trim((string) $value)) {
294  $this->getADT()->setText(is_null($value) ? null : (string) $value);
295  return true;
296  }
297  return false;
298  }
Representation of ECS EContent Time Place.
const TYPE_TIMEPLACE
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ importValueFromXML()

ilAdvancedMDFieldDefinitionText::importValueFromXML ( string  $a_cdata)
Parameters
string$a_cdata

Definition at line 250 of file class.ilAdvancedMDFieldDefinitionText.php.

References $parts, ilAdvancedMDRecord\_getInstanceByRecordId(), and ilAdvancedMDFieldDefinition\getADT().

250  : void
251  {
252  // an import from release < 7
253  if (strpos($a_cdata, self::XML_SEPARATOR_TRANSLATION) === false) {
254  $this->getADT()->setText($a_cdata);
255  $record = ilAdvancedMDRecord::_getInstanceByRecordId($this->record_id);
256  $this->getADT()->setTranslation($record->getDefaultLanguage(), $a_cdata);
257  return;
258  }
259 
260  $translations = explode(self::XML_SEPARATOR_TRANSLATIONS, $a_cdata);
261  foreach ($translations as $translation) {
262  $parts = explode(self::XML_SEPARATOR_TRANSLATION, $translation);
263  if ($parts === false) {
264  continue;
265  }
266  $this->getADT()->setTranslation($parts[0], $parts[1]);
267  }
268  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
static _getInstanceByRecordId(int $a_record_id)
+ Here is the call graph for this function:

◆ importXMLProperty()

ilAdvancedMDFieldDefinitionText::importXMLProperty ( string  $a_key,
string  $a_value 
)

Definition at line 219 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilAdvancedMDFieldDefinitionGroupBased\getValueForXML(), null, setMaxLength(), setMulti(), and setMultilingualValueSupport().

219  : void
220  {
221  if ($a_key === "max") {
222  $this->setMaxLength($a_value !== "" ? (int) $a_value : null);
223  }
224  if ($a_key === self::KEY_MULTI) {
225  $this->setMulti((bool) $a_value);
226  }
227  if ($a_key == 'multilingual_values') {
229  $a_value != '' ? true : false
230  );
231  }
232  }
setMultilingualValueSupport(bool $multilingual_value_support)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionText::initADTDefinition ( )
protected
Returns
ilADTDefinition
Exceptions
Exception

Definition at line 65 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilADTFactory\getInstance(), ilAdvancedMDFieldTranslations\getInstanceByRecordId(), getMaxLength(), ilAdvancedMDFieldDefinition\getRecordId(), isMultilingualValueSupport(), and ilADTFactory\TYPE_LOCALIZED_TEXT.

66  {
68 
69  $definition = ilADTFactory::getInstance()->getDefinitionInstanceByType(ilADTFactory::TYPE_LOCALIZED_TEXT);
70  $definition->setMaxLength($this->getMaxLength());
71  $definition->setActiveLanguages($field_translations->getActivatedLanguages($this->getFieldId(), true));
72  $definition->setDefaultLanguage($field_translations->getDefaultLanguage());
73  $definition->setMultilingualValueSupport($this->isMultilingualValueSupport());
74  return $definition;
75  }
ADT definition base class.
+ Here is the call graph for this function:

◆ isMulti()

ilAdvancedMDFieldDefinitionText::isMulti ( )

Definition at line 103 of file class.ilAdvancedMDFieldDefinitionText.php.

References $multi.

Referenced by addCustomFieldToDefinitionForm(), addPropertiesToXML(), getFieldDefinition(), getFieldDefinitionForTableGUI(), and prepareElementForEditor().

103  : bool
104  {
105  return $this->multi;
106  }
+ Here is the caller graph for this function:

◆ isMultilingualValueSupport()

ilAdvancedMDFieldDefinitionText::isMultilingualValueSupport ( )

Definition at line 78 of file class.ilAdvancedMDFieldDefinitionText.php.

References $multilingual_value_support.

Referenced by addCustomFieldToDefinitionForm(), addPropertiesToXML(), getFieldDefinition(), and initADTDefinition().

+ Here is the caller graph for this function:

◆ parseSearchObjects()

ilAdvancedMDFieldDefinitionText::parseSearchObjects ( array  $a_records,
array  $a_object_types 
)
protected

Definition at line 314 of file class.ilAdvancedMDFieldDefinitionText.php.

References $DIC, $ilDB, and $res.

Referenced by searchObjects().

314  : array
315  {
316  global $DIC;
317 
318  $ilDB = $DIC->database();
319 
320  $res = array();
321 
322  $obj_ids = array();
323  foreach ($a_records as $record) {
324  if ($record["sub_type"] == "-") {
325  // keep found information
326  $obj_ids[$record["obj_id"]] = $record;
327  }
328  }
329 
330  $sql = "SELECT obj_id,type" .
331  " FROM object_data" .
332  " WHERE " . $ilDB->in("obj_id", array_keys($obj_ids), false, "integer") .
333  " AND " . $ilDB->in("type", $a_object_types, false, "text");
334  $set = $ilDB->query($sql);
335  while ($row = $ilDB->fetchAssoc($set)) {
336  $row["found"] = array();
337  foreach ($obj_ids[(int) $row["obj_id"]] as $field => $value) {
338  if (substr($field, 0, 5) == "found") {
339  $row["found"][$field] = $value;
340  }
341  }
342  $res[] = $row;
343  }
344 
345  return $res;
346  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ prepareElementForEditor()

ilAdvancedMDFieldDefinitionText::prepareElementForEditor ( ilADTFormBridge  $a_bridge)

Definition at line 300 of file class.ilAdvancedMDFieldDefinitionText.php.

References isMulti(), and ILIAS\Repository\logger().

300  : void
301  {
302  if (!$a_bridge instanceof ilADTLocalizedTextFormBridge) {
303  $this->logger->warning('Passed ' . get_class($a_bridge));
304  return;
305  }
306  $a_bridge->setMulti($this->isMulti());
307  }
Class ilADTLocalizedTextDBBridge.
+ Here is the call graph for this function:

◆ searchObjects()

ilAdvancedMDFieldDefinitionText::searchObjects ( ilADTSearchBridge  $a_adt_search,
ilQueryParser  $a_parser,
array  $a_object_types,
string  $a_locate,
string  $a_search_type 
)

Definition at line 348 of file class.ilAdvancedMDFieldDefinitionText.php.

References ilADTActiveRecordByType\find(), ilAdvancedMDFieldDefinition\getADT(), ilAdvancedMDFieldDefinition\getFieldId(), ilQueryParser\getQuotedWords(), ilADTSearchBridge\getSQLCondition(), getType(), parseSearchObjects(), ilADTActiveRecordByType\SINGLE_COLUMN_NAME, and ilADTTextSearchBridgeSingle\SQL_LIKE.

354  : array {
355  // :TODO: search type (like, fulltext)
356 
357  $condition = $a_adt_search->getSQLCondition(
360  $a_parser->getQuotedWords()
361  );
362  if ($condition) {
364  'adv_md_values',
365  $this->getADT()->getType(),
366  $this->getFieldId(),
367  $condition,
368  $a_locate
369  );
370  if (isset($objects) && count($objects)) {
371  return $this->parseSearchObjects($objects, $a_object_types);
372  }
373  return [];
374  }
375  return [];
376  }
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
Get SQL condition for current value(s)
getQuotedWords(bool $with_quotation=false)
parseSearchObjects(array $a_records, array $a_object_types)
static find(string $a_table, string $a_type, int $a_field_id, string $a_condition, ?string $a_additional_fields=null)
Find entries.
+ Here is the call graph for this function:

◆ setMaxLength()

ilAdvancedMDFieldDefinitionText::setMaxLength ( ?int  $max_length)

Definition at line 88 of file class.ilAdvancedMDFieldDefinitionText.php.

References $max_length.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

89  {
90  $this->max_length = $max_length;
91  }
+ Here is the caller graph for this function:

◆ setMulti()

ilAdvancedMDFieldDefinitionText::setMulti ( bool  $a_value)

Definition at line 98 of file class.ilAdvancedMDFieldDefinitionText.php.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

98  : void
99  {
100  $this->multi = $a_value;
101  }
+ Here is the caller graph for this function:

◆ setMultilingualValueSupport()

ilAdvancedMDFieldDefinitionText::setMultilingualValueSupport ( bool  $multilingual_value_support)

Definition at line 83 of file class.ilAdvancedMDFieldDefinitionText.php.

References $multilingual_value_support.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

83  : void
84  {
85  $this->multilingual_value_support = $multilingual_value_support;
86  }
+ Here is the caller graph for this function:

Field Documentation

◆ $max_length

int ilAdvancedMDFieldDefinitionText::$max_length = null
protected

Definition at line 32 of file class.ilAdvancedMDFieldDefinitionText.php.

Referenced by getMaxLength(), and setMaxLength().

◆ $multi

bool ilAdvancedMDFieldDefinitionText::$multi = false
protected

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

Referenced by isMulti().

◆ $multilingual_value_support

bool ilAdvancedMDFieldDefinitionText::$multilingual_value_support = true
protected

◆ KEY_MULTI

const ilAdvancedMDFieldDefinitionText::KEY_MULTI = "multi"

Definition at line 30 of file class.ilAdvancedMDFieldDefinitionText.php.

◆ XML_SEPARATOR_TRANSLATION

const ilAdvancedMDFieldDefinitionText::XML_SEPARATOR_TRANSLATION = '~+~'

Definition at line 29 of file class.ilAdvancedMDFieldDefinitionText.php.

◆ XML_SEPARATOR_TRANSLATIONS

const ilAdvancedMDFieldDefinitionText::XML_SEPARATOR_TRANSLATIONS = "~|~"

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


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