ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
ilAdvancedMDFieldDefinitionInternalLink Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAdvancedMDFieldDefinitionInternalLink:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionInternalLink:

Public Member Functions

 getType ()
 
 getValueForXML (ilADT $element)
 
 importValueFromXML (string $a_cdata)
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
 
 getLuceneSearchString ($a_value)
 
- 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 $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)
 

Protected Member Functions

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

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)
 
- 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
 
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstanceWithData (GenericData $generic_data, string $language='')
 
static getTypeString (int $a_type)
 Get type as string. More...
 
- 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
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning AMD field type date Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Member Function Documentation

◆ getLuceneSearchString()

ilAdvancedMDFieldDefinitionInternalLink::getLuceneSearchString (   $a_value)

Definition at line 86 of file class.ilAdvancedMDFieldDefinitionInternalLink.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

86  : string
87  {
88  $query = 'select ref_id from object_reference obr join object_data obd on obr.obj_id = obd.obj_id ' .
89  'where ' . $this->db->like('title', 'text', $a_value . '%');
90  $res = $this->db->query($query);
91  $ref_ids = [];
92  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
93  $ref_ids[] = (int) $row->ref_id;
94  }
95  if (count($ref_ids)) {
96  return '(' . implode(' ', $ref_ids) . ') ';
97  }
98  return 'null';
99  }
$res
Definition: ltiservices.php:67
+ Here is the call graph for this function:

◆ getType()

ilAdvancedMDFieldDefinitionInternalLink::getType ( )

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

Referenced by searchObjects().

28  : int
29  {
30  return self::TYPE_INTERNAL_LINK;
31  }
+ Here is the caller graph for this function:

◆ getValueForXML()

ilAdvancedMDFieldDefinitionInternalLink::getValueForXML ( ilADT  $element)

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

References ilObject\_lookupType(), and IL_INST_ID.

38  : string
39  {
40  $type = ilObject::_lookupType($element->getTargetRefId(), true);
41 
42  if ($element->getTargetRefId() && strlen($type)) {
43  return 'il_' . IL_INST_ID . '_' . $type . '_' . $element->getTargetRefId();
44  }
45  return '';
46  }
const IL_INST_ID
Definition: constants.php:40
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ importValueFromXML()

ilAdvancedMDFieldDefinitionInternalLink::importValueFromXML ( string  $a_cdata)

Definition at line 48 of file class.ilAdvancedMDFieldDefinitionInternalLink.php.

References ilObject\_exists(), ilAdvancedMDFieldDefinition\getADT(), IL_INST_ID, and ilUtil\parseImportId().

48  : void
49  {
50  $parsed_import_id = ilUtil::parseImportId($a_cdata);
51 
52  if (
53  (strcmp((string) $parsed_import_id['inst_id'], IL_INST_ID) == 0) &&
54  ilObject::_exists($parsed_import_id['id'], true, $parsed_import_id['type'])
55  ) {
56  $this->getADT()->setTargetRefId($parsed_import_id['id']);
57  }
58  }
const IL_INST_ID
Definition: constants.php:40
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static parseImportId(string $a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionInternalLink::initADTDefinition ( )
protected

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

References ilADTFactory\getInstance().

34  {
35  return ilADTFactory::getInstance()->getDefinitionInstanceByType("InternalLink");
36  }
ADT definition base class.
+ Here is the call graph for this function:

◆ searchObjects()

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

Definition at line 60 of file class.ilAdvancedMDFieldDefinitionInternalLink.php.

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

66  : array {
68  if ($condition) {
70  "adv_md_values",
71  $this->getADT()->getType(),
72  $this->getFieldId(),
73  $condition,
74  $a_locate
75  );
76  if (!is_null($objects) && count($objects)) {
77  return $this->parseSearchObjects($objects, $a_object_types);
78  }
79  }
80  return [];
81  }
parseSearchObjects(array $a_records, array $a_object_types)
Add object-data needed for global search to AMD search results.
getSQLCondition(string $a_element_id, int $mode=self::SQL_LIKE, array $quotedWords=[])
Get SQL condition for current value(s)
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:

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