ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContainerFilterAdvMDAdapter Class Reference

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

+ Collaboration diagram for ilContainerFilterAdvMDAdapter:

Public Member Functions

 __construct ()
 
 getAvailableRecordSets ()
 Get active record sets. More...
 
 getTitle (int $record_id, int $filter_id)
 Get name for filter. More...
 
 getAdvType (int $filter_id)
 
 getOptions (int $filter_id)
 

Protected Attributes

array $types = ["crs", "cat", "grp", "sess"]
 
array $supported_types
 
ilLanguage $lng
 

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 Adapter for advanced metadata service

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilContainerFilterAdvMDAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerFilterAdvMDAdapter::__construct ( )

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

References $DIC, and ILIAS\Repository\lng().

36  {
37  global $DIC;
38  $this->lng = $DIC->language();
39  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getAdvType()

ilContainerFilterAdvMDAdapter::getAdvType ( int  $filter_id)
Exceptions
ilException

Definition at line 91 of file class.ilContainerFilterAdvMDAdapter.php.

References ilAdvancedMDFieldDefinition\getInstance().

91  : string
92  {
93  $field = ilAdvancedMDFieldDefinition::getInstance($filter_id);
94  return (string) $field->getType();
95  }
static getInstance(?int $a_field_id, ?int $a_type=null, string $language='')
+ Here is the call graph for this function:

◆ getAvailableRecordSets()

ilContainerFilterAdvMDAdapter::getAvailableRecordSets ( )

Get active record sets.

Returns
ilAdvancedMDRecord[]

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

References Vendor\Package\$f, $supported_types, $type, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), and ilAdvancedMDFieldDefinition\getInstancesByRecordId().

46  : array
47  {
48  $records = [];
49  foreach ($this->types as $type) {
50  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType($type) as $record_obj) {
51  if ($record_obj->isActive() && $record_obj->getParentObject() === 0) {
52  $records[] = $record_obj;
53  }
54  }
55  }
56  return $records;
57  }
$type
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
+ Here is the call graph for this function:

◆ getOptions()

ilContainerFilterAdvMDAdapter::getOptions ( int  $filter_id)

Definition at line 97 of file class.ilContainerFilterAdvMDAdapter.php.

References ilAdvancedMDFieldDefinition\getInstance().

97  : array
98  {
99  $field = ilAdvancedMDFieldDefinition::getInstance($filter_id);
100  return $field->getOptions();
101  }
static getInstance(?int $a_field_id, ?int $a_type=null, string $language='')
+ Here is the call graph for this function:

◆ getTitle()

ilContainerFilterAdvMDAdapter::getTitle ( int  $record_id,
int  $filter_id 
)

Get name for filter.

Exceptions
ilException

Definition at line 76 of file class.ilContainerFilterAdvMDAdapter.php.

References $lng, ilAdvancedMDFieldDefinition\getInstance(), and ilLanguage\txt().

76  : string
77  {
78  $lng = $this->lng;
79 
80  if ($record_id === 0) {
81  return $lng->txt("cont_std_filter_title_" . $filter_id);
82  }
83 
84  $field = ilAdvancedMDFieldDefinition::getInstance($filter_id);
85  return $field->getTitle();
86  }
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...
static getInstance(?int $a_field_id, ?int $a_type=null, string $language='')
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilContainerFilterAdvMDAdapter::$lng
protected

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

Referenced by getTitle().

◆ $supported_types

◆ $types

array ilContainerFilterAdvMDAdapter::$types = ["crs", "cat", "grp", "sess"]
protected

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


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