ILIAS  release_8 Revision v8.24
ilAdvancedMDFieldDefinitionText Class Reference

AMD field type text. More...

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

Public Member Functions

 getType ()
 Get type. More...
 
 getADTGroup ()
 
 getTitles ()
 
 hasComplexOptions ()
 
 setMaxLength (?int $max_length)
 
 getMaxLength ()
 
 setMulti (bool $a_value)
 
 isMulti ()
 
 getFieldDefinitionForTableGUI (string $content_language)
 Parse properties for table gui. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 Import custom post values from definition form. More...
 
 importXMLProperty (string $a_key, string $a_value)
 Import property from XML. More...
 
 importValueFromXML (string $a_cdata)
 
 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...
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
 Search objects. More...
 
- Public Member Functions inherited from ilAdvancedMDFieldDefinitionGroupBased
 setOptions (array $a_values=null)
 
 getOptions ()
 
 getFieldDefinitionForTableGUI (string $content_language)
 Parse properties for table gui. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 Import custom post values from definition form. 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...
 
 getADTGroup ()
 
 getTitles ()
 
 hasComplexOptions ()
 
 getComplexOptionsOverview (object $a_parent_gui, string $a_parent_cmd)
 
Parameters
object$a_parent_gui
string$parent_cmd
Returns
null
More...
 
 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 (?int $a_field_id=null, 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 $a_keep_pos=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
 
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)
 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 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 Member Functions inherited from ilAdvancedMDFieldDefinitionGroupBased
 initADTDefinition ()
 Init 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...
 
 getADTForOption (string $a_option)
 
 importComplexOptionFromForm (string $a_option, ilADT $a_adt)
 
 findOptionById (string $a_id)
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 init ()
 
 initADTDefinition ()
 Init adt instance. More...
 
 setADT (ilADT $a_adt)
 Set ADT instance. More...
 
 setFieldId (int $a_id)
 Set field_id. 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...
 
 getLastPosition ()
 Get last position of record. More...
 
 getDBProperties ()
 Get all definition properties for DB. More...
 
 import (array $a_data)
 Import from DB. More...
 
 read (?int $a_field_id)
 Read field definition. 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
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinitionGroupBased
 $options = []
 
 $complex = []
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
int $field_id = null
 
int $record_id = 0
 
string $import_id = ''
 
int $position = 0
 
string $title = ''
 
string $description = ''
 
bool $searchable = false
 
bool $required = false
 
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 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

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

146 : void {
147 global $DIC;
148
149 $lng = $DIC['lng'];
150
151 $max = new ilNumberInputGUI($lng->txt("md_adv_text_max_length"), "max");
152 $max->setValue((string) $this->getMaxLength());
153 $max->setSize(10);
154 $max->setSuffix($lng->txt("characters"));
155 $max->setMinValue(1);
156 $max->setMaxValue(4000); // DB limit
157 $a_form->addItem($max);
158
159 $multi = new ilCheckboxInputGUI($lng->txt("md_adv_text_multi"), self::KEY_MULTI);
160 $multi->setValue("1");
161 $multi->setChecked($this->isMulti());
162 $a_form->addItem($multi);
163
164 if ($a_disabled) {
165 $max->setDisabled(true);
166 $multi->setDisabled(true);
167 }
168 }
This class represents a checkbox property in a property form.
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...
This class represents a number property in a property form.
global $DIC
Definition: feed.php:28

◆ addPropertiesToXML()

ilAdvancedMDFieldDefinitionText::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

Add (type-specific) properties to xml export.

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

186 : void
187 {
188 $a_writer->xmlElement('FieldValue', array("id" => "max"), $this->getMaxLength());
189 $a_writer->xmlElement('FieldValue', array("id" => self::KEY_MULTI), $this->isMulti());
190 }
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)

References ilXmlWriter\xmlElement().

+ Here is the call graph for this function:

◆ getADTGroup()

ilAdvancedMDFieldDefinitionText::getADTGroup ( )

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

45 {
46 return $this->getADTDefinition();
47 }
ADT definition base class.
getADTDefinition()
Get ADT definition instance.

References ilAdvancedMDFieldDefinition\getADTDefinition().

+ Here is the call graph for this function:

◆ getFieldDefinition()

ilAdvancedMDFieldDefinitionText::getFieldDefinition ( )
protected

Get (type-specific) field definition.

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

110 : array
111 {
112 return array(
113 "max" => $this->getMaxLength(),
114 self::KEY_MULTI => $this->isMulti()
115 );
116 }

References getMaxLength(), and isMulti().

+ Here is the call graph for this function:

◆ getFieldDefinitionForTableGUI()

ilAdvancedMDFieldDefinitionText::getFieldDefinitionForTableGUI ( string  $content_language)

Parse properties for table gui.

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

118 : array
119 {
120 global $DIC;
121
122 $lng = $DIC['lng'];
123
124 $res = array();
125
126 if ($this->getMaxLength() !== null) {
127 $res[$lng->txt("md_adv_text_max_length")] = $this->getMaxLength();
128 }
129 if ($this->isMulti()) {
130 $res[$lng->txt("md_adv_text_multi")] = $lng->txt("yes");
131 }
132
133 return $res;
134 }
$res
Definition: ltiservices.php:69

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

+ Here is the call graph for this function:

◆ getMaxLength()

ilAdvancedMDFieldDefinitionText::getMaxLength ( )

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

References $max_length.

Referenced by getFieldDefinition(), getFieldDefinitionForTableGUI(), and initADTDefinition().

+ Here is the caller graph for this function:

◆ getSearchQueryParserValue()

ilAdvancedMDFieldDefinitionText::getSearchQueryParserValue ( ilADTSearchBridge  $a_adt_search)

Get value for search query parser.

Parameters
ilADTSearchBridge$a_adt_search
Returns
string
Todo:
check if string type is applicable

Reimplemented from ilAdvancedMDFieldDefinition.

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

277 : string
278 {
279 return (string) $a_adt_search->getADT()->getText();
280 }

◆ getTitles()

ilAdvancedMDFieldDefinitionText::getTitles ( )

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

49 : array
50 {
51 return [];
52 }

◆ getType()

ilAdvancedMDFieldDefinitionText::getType ( )

Get type.

Reimplemented from ilAdvancedMDFieldDefinition.

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

References ilAdvancedMDFieldDefinition\TYPE_TEXT.

◆ hasComplexOptions()

ilAdvancedMDFieldDefinitionText::hasComplexOptions ( )

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

54 : bool
55 {
56 return false;
57 }

◆ importCustomDefinitionFormPostValues()

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

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form
string$language

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

175 : void
176 {
177 $max = $a_form->getInput("max");
178 $this->setMaxLength(($max !== "" && $max !== null) ? (int) $max : null);
179 $this->setMulti((bool) $a_form->getInput(self::KEY_MULTI));
180 }
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-...

References ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ importFieldDefinition()

ilAdvancedMDFieldDefinitionText::importFieldDefinition ( array  $a_def)
protected

Import (type-specific) field definition from DB.

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

104 : void
105 {
106 $this->setMaxLength(isset($a_def["max"]) ? (int) $a_def["max"] : null);
107 $this->setMulti((bool) ($a_def[self::KEY_MULTI] ?? false));
108 }

References setMaxLength(), and setMulti().

+ Here is the call graph for this function:

◆ importFromECS()

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

Import meta data from ECS.

Reimplemented from ilAdvancedMDFieldDefinition.

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

238 : bool
239 {
240 $value = '';
241 switch ($a_ecs_type) {
243 $value = implode(',', (array) $a_value);
244 break;
245
247 $value = (int) $a_value;
248 break;
249
251 $value = (string) $a_value;
252 break;
253
255 if ($a_value instanceof ilECSTimePlace) {
256 $value = $a_value->{'get' . ucfirst($a_sub_id)}();
257 }
258 break;
259 }
260
261 if (trim((string) $value)) {
262 $this->getADT()->setText(is_null($value) ? null : (string) $value);
263 return true;
264 }
265 return false;
266 }
Representation of ECS EContent Time Place.
const TYPE_TIMEPLACE

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

+ Here is the call graph for this function:

◆ importValueFromXML()

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

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

218 : void
219 {
220 // an import from release < 7
221 if (strpos($a_cdata, self::XML_SEPARATOR_TRANSLATION) === false) {
222 $this->getADT()->setText($a_cdata);
223 $record = ilAdvancedMDRecord::_getInstanceByRecordId($this->record_id);
224 $this->getADT()->setTranslation($record->getDefaultLanguage(), $a_cdata);
225 return;
226 }
227
228 $translations = explode(self::XML_SEPARATOR_TRANSLATIONS, $a_cdata);
229 foreach ($translations as $translation) {
230 $parts = explode(self::XML_SEPARATOR_TRANSLATION, $translation);
231 if ($parts === false) {
232 continue;
233 }
234 $this->getADT()->setTranslation($parts[0], $parts[1]);
235 }
236 }
static _getInstanceByRecordId(int $a_record_id)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64

References $parts, and ilAdvancedMDRecord\_getInstanceByRecordId().

+ Here is the call graph for this function:

◆ importXMLProperty()

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

Import property from XML.

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

192 : void
193 {
194 if ($a_key === "max") {
195 $this->setMaxLength($a_value !== "" ? (int) $a_value : null);
196 }
197 if ($a_key === self::KEY_MULTI) {
198 $this->setMulti((bool) $a_value);
199 }
200 }

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionText::initADTDefinition ( )
protected
Returns
ilADTDefinition
Exceptions
Exception

Reimplemented from ilAdvancedMDFieldDefinitionGroupBased.

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

64 {
66
67 $definition = ilADTFactory::getInstance()->getDefinitionInstanceByType(ilADTFactory::TYPE_LOCALIZED_TEXT);
68 $definition->setMaxLength($this->getMaxLength());
69 $definition->setActiveLanguages($field_translations->getActivatedLanguages($this->getFieldId(), true));
70 $definition->setDefaultLanguage($field_translations->getDefaultLanguage());
71 return $definition;
72 }

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

+ Here is the call graph for this function:

◆ isMulti()

ilAdvancedMDFieldDefinitionText::isMulti ( )

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

94 : bool
95 {
96 return $this->multi;
97 }

References $multi.

Referenced by getFieldDefinition(), and getFieldDefinitionForTableGUI().

+ Here is the caller graph for this function:

◆ parseSearchObjects()

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

Add object-data needed for global search to AMD search results.

Reimplemented from ilAdvancedMDFieldDefinition.

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

282 : array
283 {
284 global $DIC;
285
286 $ilDB = $DIC->database();
287
288 $res = array();
289
290 $obj_ids = array();
291 foreach ($a_records as $record) {
292 if ($record["sub_type"] == "-") {
293 // keep found information
294 $obj_ids[$record["obj_id"]] = $record;
295 }
296 }
297
298 $sql = "SELECT obj_id,type" .
299 " FROM object_data" .
300 " WHERE " . $ilDB->in("obj_id", array_keys($obj_ids), false, "integer") .
301 " AND " . $ilDB->in("type", $a_object_types, false, "text");
302 $set = $ilDB->query($sql);
303 while ($row = $ilDB->fetchAssoc($set)) {
304 $row["found"] = array();
305 foreach ($obj_ids[(int) $row["obj_id"]] as $field => $value) {
306 if (substr($field, 0, 5) == "found") {
307 $row["found"][$field] = $value;
308 }
309 }
310 $res[] = $row;
311 }
312
313 return $res;
314 }

References $DIC, $ilDB, and $res.

◆ prepareElementForEditor()

ilAdvancedMDFieldDefinitionText::prepareElementForEditor ( ilADTFormBridge  $a_bridge)

Prepare editor form elements.

Reimplemented from ilAdvancedMDFieldDefinition.

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

268 : void
269 {
270 if (!$a_bridge instanceof ilADTLocalizedTextFormBridge) {
271 $this->logger->warning('Passed ' . get_class($a_bridge));
272 return;
273 }
274 $a_bridge->setMulti($this->isMulti());
275 }

References ILIAS\Repository\logger().

+ 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 
)

Search objects.

Reimplemented from ilAdvancedMDFieldDefinition.

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

322 : array {
323 // :TODO: search type (like, fulltext)
324
325 $condition = $a_adt_search->getSQLCondition(
328 $a_parser->getQuotedWords()
329 );
330 if ($condition) {
332 'adv_md_values',
333 $this->getADT()->getType(),
334 $this->getFieldId(),
335 $condition,
336 $a_locate
337 );
338 if (isset($objects) && count($objects)) {
339 return $this->parseSearchObjects($objects, $a_object_types);
340 }
341 return [];
342 }
343 return [];
344 }
static find(string $a_table, string $a_type, int $a_field_id, string $a_condition, ?string $a_additional_fields=null)
Find entries.
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
Get SQL condition for current value(s)
parseSearchObjects(array $a_records, array $a_object_types)
Add object-data needed for global search to AMD search results.
getQuotedWords(bool $with_quotation=false)

References ilADTActiveRecordByType\find().

+ Here is the call graph for this function:

◆ setMaxLength()

ilAdvancedMDFieldDefinitionText::setMaxLength ( ?int  $max_length)

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

80 {
81 $this->max_length = $max_length;
82 }

References $max_length.

Referenced by importFieldDefinition().

+ Here is the caller graph for this function:

◆ setMulti()

ilAdvancedMDFieldDefinitionText::setMulti ( bool  $a_value)

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

89 : void
90 {
91 $this->multi = $a_value;
92 }

Referenced by importFieldDefinition().

+ 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().

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