ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjectGroupDataSet Class Reference
+ Inheritance diagram for ilObjectGroupDataSet:
+ Collaboration diagram for ilObjectGroupDataSet:

Public Member Functions

 getSupportedVersions ()
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from DB. More...
 
 getXmlRecord (string $a_entity, string $a_version, array $a_set)
 Get xml record for version. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 
 init (string $a_entity, string $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from DB. More...
 
 initByExporter (ilXmlExporter $xml_exporter)
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setDSPrefix (string $a_val)
 
 getDSPrefix ()
 
 getDSPrefixString ()
 
 getDirectDataFromQuery (string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper (string $a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text" > <ftype name="field_2" type="date" > <ftype name="field_3" type="integer" > </types> <types ...> ... </types> <set entity="table_name"> <rec> <field_1>content</field_1> <field_2>my_date</field_2> <field_3>my_number</field_3> </rec> ... </set> </dataset> More...
 
 addRecordsXml (ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="")
 
 afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set)
 
 getNamespaces (array &$namespaces, string $a_entity, string $a_schema_version)
 
 getXmlRecord (string $a_entity, string $a_version, array $a_set)
 Get xml record for version. More...
 
 getXmlTypes (string $a_entity, string $a_version)
 Get xml types. More...
 
 getXMLEntityName (string $a_entity, string $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag (string $a_entity, string $a_schema_version)
 Get entity tag. More...
 
 setImport (ilSurveyImporter $a_val)
 
 getImport ()
 
 setCurrentInstallationId (string $a_val)
 
 getCurrentInstallationId ()
 
 importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 Needs to be overwritten for import use case. More...
 
 getCollection (array $record, string $entity, string $schema_version, string $field, string $value)
 
 getContainerExportConfig (array $record, string $entity, string $schema_version, string $field, string $value)
 

Protected Member Functions

 getTypes (string $a_entity, string $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
 
- Protected Member Functions inherited from ilDataSet
 getTypes (string $a_entity, string $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 getExportDirInContainer (string $exp_dir)
 
 getIRSSContainerExportConfig (StorableResource $source_container, string $source_path, string $target_path="")
 
 getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
 
 createObjectExportId (string $a_type, string $a_id)
 Build ilias export id. More...
 
 parseObjectExportId (string $a_id, ?string $a_fallback_id=null)
 Parse export id. More...
 
 stripTags (array $rec, array $omit_keys=[])
 

Protected Attributes

ilObjObjectGroup $current_obj
 
- Protected Attributes inherited from ilDataSet
ILIAS ResourceStorage Services $irss
 
string $current_installation_id = ""
 
array $data = []
 
ilDBInterface $db
 
ilLogger $ds_log
 
string $import_directory = ""
 
string $entity = ""
 
string $schema_version = ""
 
string $component_export_dir = ""
 
string $ds_prefix = "ds"
 
string $version = ""
 
ilSurveyImporter $import
 
ilExport $export
 

Private Member Functions

 resolveDisplay (array $a_set)
 
 resolveBehaviour (array $a_set)
 
 exportEntity (string $entity)
 
 normalizeImportedRecord (array $record)
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
const DATASET_NS = 'http://www.ilias.de/Services/DataSet/ds/4_3'
 
const DATASET_NS_PREFIX = 'ds'
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 
int $dircnt = 0
 

Detailed Description

Definition at line 21 of file class.ilObjectGroupDataSet.php.

Member Function Documentation

◆ exportEntity()

ilObjectGroupDataSet::exportEntity ( string  $entity)
private

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

219 : string
220 {
221 return match ($entity) {
222 'itgr' => 'obgr',
223 'itgr_item' => 'obgr_item',
224 default => $entity,
225 };
226 }
string $entity

◆ getDependencies()

ilObjectGroupDataSet::getDependencies ( string  $a_entity,
string  $a_version,
?array  $a_rec = null,
?array  $a_ids = null 
)
protected

Reimplemented from ilDataSet.

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

123 : array {
124 return match ($a_entity) {
125 'obgr' => ['obgr_item' => ['ids' => $a_rec['Id'] ?? []]],
126 default => [],
127 };
128 }

◆ getSupportedVersions()

ilObjectGroupDataSet::getSupportedVersions ( )

Reimplemented from ilDataSet.

Definition at line 25 of file class.ilObjectGroupDataSet.php.

25 : array
26 {
27 return ['4.3.0', '5.3.0', '10.12'];
28 }

◆ getTypes()

ilObjectGroupDataSet::getTypes ( string  $a_entity,
string  $a_version 
)
protected

Get (abstract) types for (abstract) field names.

Please note that the abstract fields/types only depend on the version! Not on a choosen representation!

Returns
array types array, e.g. array("field_1" => "text", "field_2" => "integer", ...)

Reimplemented from ilDataSet.

Definition at line 35 of file class.ilObjectGroupDataSet.php.

35 : array
36 {
37 $object_types = match ($a_version) {
38 '4.3.0' => [
40 'Title' => ilDBConstants::T_TEXT,
41 'Description' => ilDBConstants::T_TEXT,
42 ],
43 '5.3.0' => [
45 'HideTitle' => ilDBConstants::T_INTEGER,
46 'Behaviour' => ilDBConstants::T_INTEGER,
47 'ListPresentation' => ilDBConstants::T_TEXT,
48 'TileSize' => ilDBConstants::T_INTEGER,
49 'Title' => ilDBConstants::T_TEXT,
50 'Description' => ilDBConstants::T_TEXT,
51 ],
52 '10.12' => [
54 'Display' => ilDBConstants::T_TEXT,
55 'ToggleableInitially' => ilDBConstants::T_TEXT,
56 'ListPresentation' => ilDBConstants::T_TEXT,
57 'TileSize' => ilDBConstants::T_INTEGER,
58 'Title' => ilDBConstants::T_TEXT,
59 'Description' => ilDBConstants::T_TEXT,
60 ],
61 default => [],
62 };
63
64 return match ($a_entity) {
65 'obgr' => $object_types,
66 'obgr_item' => match ($a_version) {
67 '4.3.0', '5.3.0', '10.12' => [
68 'ObjectGroupId' => ilDBConstants::T_INTEGER,
69 'ItemId' => ilDBConstants::T_TEXT,
70 ],
71 default => [],
72 },
73 default => [],
74 };
75 }

References ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

◆ getXmlNamespace()

ilObjectGroupDataSet::getXmlNamespace ( string  $a_entity,
string  $a_schema_version 
)

Reimplemented from ilDataSet.

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

30 : string
31 {
32 return "https://www.ilias.de/xml/Modules/ObjectGroup/{$a_entity}";
33 }

◆ getXmlRecord()

ilObjectGroupDataSet::getXmlRecord ( string  $a_entity,
string  $a_version,
array  $a_set 
)

Get xml record for version.

Parameters
array$a_setabstract data record

Reimplemented from ilDataSet.

Definition at line 109 of file class.ilObjectGroupDataSet.php.

109 : array
110 {
111 if ($a_entity === 'obgr_item') {
112 $a_set['ItemId'] = ilObject::_lookupObjId($a_set['ItemId']);
113 }
114
115 return $a_set;
116 }
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ normalizeImportedRecord()

ilObjectGroupDataSet::normalizeImportedRecord ( array  $record)
private
Parameters
array<string,mixed>$record
Returns
array<string, mixed>

Definition at line 232 of file class.ilObjectGroupDataSet.php.

232 : array
233 {
234 if (!isset($record['ObjectGroupId'])) {
235 $record['ObjectGroupId'] = $record['ItemGroupId'] ?? $record['ItgrId'] ?? null;
236 }
237
238 return $record;
239 }

◆ readData()

ilObjectGroupDataSet::readData ( string  $a_entity,
string  $a_version,
array  $a_ids 
)

Read data from DB.

This should result in the abstract field structure of the version set in the constructor.

Reimplemented from ilDataSet.

Definition at line 77 of file class.ilObjectGroupDataSet.php.

77 : void
78 {
79 $in_obj_id = $this->db->in('obj_id', $a_ids, false, ilDBConstants::T_INTEGER);
80 match ($a_entity) {
81 'obgr' => match ($a_version) {
82 '4.3.0' => $this->getDirectDataFromQuery(
83 "SELECT obj_id id, title, description, list_presentation, tile_size FROM object_data
84 WHERE {$in_obj_id}"
85 ),
86 '5.3.0' => $this->getDirectDataFromQuery(
87 "SELECT obj_id id, title, description, hide_title, behaviour, list_presentation, tile_size FROM object_data
88 INNER JOIN obgr_data ON object_data.obj_id = obgr_data.id
89 WHERE {$in_obj_id}"
90 ),
91 '10.12' => $this->getDirectDataFromQuery(
92 "SELECT obj_id id, title, description, list_presentation, tile_size, display, toggleable_initially FROM object_data
93 INNER JOIN obgr_data ON object_data.obj_id = obgr_data.id
94 WHERE {$in_obj_id}"
95 ),
96 default => '',
97 },
98 'obgr_item' => match ($a_version) {
99 '4.3.0', '5.3.0', '10.12' => $this->getDirectDataFromQuery(
100 "SELECT object_group_id, object_ref_id item_id FROM object_group_item
101 WHERE {$this->db->in('object_group_id', $a_ids, false, ilDBConstants::T_INTEGER)}"
102 ),
103 default => null,
104 },
105 default => null,
106 };
107 }
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...

References ilDataSet\getDirectDataFromQuery(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ resolveBehaviour()

ilObjectGroupDataSet::resolveBehaviour ( array  $a_set)
private

Definition at line 203 of file class.ilObjectGroupDataSet.php.

203 : string
204 {
205 if (isset($a_set['Behaviour'])) {
206 return match ($a_set['Behaviour']) {
209 };
210 }
211
212 $toggleable_initially = $a_set['ToggleableInitially'] ?? '';
213 return match ($toggleable_initially) {
216 };
217 }
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED
const DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN

References ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED, and ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN.

◆ resolveDisplay()

ilObjectGroupDataSet::resolveDisplay ( array  $a_set)
private

Definition at line 187 of file class.ilObjectGroupDataSet.php.

187 : string
188 {
189 if (isset($a_set['HideTitle'])) {
190 return match ($a_set['HideTitle']) {
193 };
194 }
195
196 $display = $a_set['Display'] ?? '';
197 return match ($display) {
200 };
201 }

References ilObjectGroupAR\DISPLAY_WITH_TITLE, ilObjectGroupAR\DISPLAY_WITH_TITLE_AND_TOGGLEABLE, and ilObjectGroupAR\DISPLAY_WITHOUT_TITLE.

Field Documentation

◆ $current_obj

ilObjObjectGroup ilObjectGroupDataSet::$current_obj
protected

Definition at line 23 of file class.ilObjectGroupDataSet.php.


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