ILIAS  release_8 Revision v8.24
ilOerHarvesterSettings Class Reference

Cron job for definition for oer harvesting. More...

+ Collaboration diagram for ilOerHarvesterSettings:

Public Member Functions

 supportsHarvesting (string $a_type)
 
 getHarvestingTypes ()
 
 setTarget (int $a_target)
 
 getTarget ()
 
 setCopyrightTemplates (array $a_template_ids)
 
 getCopyrightTemplates ()
 
 isActiveCopyrightTemplate (int $a_id)
 
 getCopyRightTemplatesInLomFormat ()
 Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID". More...
 
 save ()
 
 read ()
 

Static Public Member Functions

static getInstance ()
 

Data Fields

const CRON_JOB_IDENTIFIER = 'meta_oer_harvester'
 
const STORAGE_IDENTIFIER = 'meta_oer'
 
const COLLECTED_TYPES
 

Protected Member Functions

 __construct ()
 

Protected Attributes

ilSetting $storage
 
ilSetting $settings
 

Private Attributes

int $target = 0
 
array $copyright_templates = []
 
ilCronOerHarvester $cronjob = null
 

Static Private Attributes

static ilOerHarvesterSettings $instance = null
 

Detailed Description

Cron job for definition for oer harvesting.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 13 of file class.ilOerHarvesterSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilOerHarvesterSettings::__construct ( )
protected

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

36 {
37 global $DIC;
38
39 $this->storage = new ilSetting(self::STORAGE_IDENTIFIER);
40 $this->settings = $DIC->settings();
41
42 $this->read();
43 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, read(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getCopyrightTemplates()

ilOerHarvesterSettings::getCopyrightTemplates ( )
Returns
string[]

Definition at line 87 of file class.ilOerHarvesterSettings.php.

87 : array
88 {
90 }

References $copyright_templates.

Referenced by getCopyRightTemplatesInLomFormat(), and isActiveCopyrightTemplate().

+ Here is the caller graph for this function:

◆ getCopyRightTemplatesInLomFormat()

ilOerHarvesterSettings::getCopyRightTemplatesInLomFormat ( )

Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID".

Returns
string[]

Definition at line 101 of file class.ilOerHarvesterSettings.php.

101 : array
102 {
103 $lom_entries = [];
104 foreach ($this->getCopyrightTemplates() as $copyright_id) {
105 $lom_entries[] = 'il_copyright_entry__' . $this->settings->get('inst_id', '0') . '__' . $copyright_id;
106 }
107 return $lom_entries;
108 }

References getCopyrightTemplates(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ getHarvestingTypes()

ilOerHarvesterSettings::getHarvestingTypes ( )
Returns
string[]

Definition at line 61 of file class.ilOerHarvesterSettings.php.

61 : array
62 {
64 }

References COLLECTED_TYPES.

◆ getInstance()

static ilOerHarvesterSettings::getInstance ( )
static

Definition at line 45 of file class.ilOerHarvesterSettings.php.

45 : self
46 {
47 if (!self::$instance instanceof self) {
48 self::$instance = new self();
49 }
50 return self::$instance;
51 }
static ilOerHarvesterSettings $instance

References $instance.

Referenced by ilCronOerHarvester\__construct(), ilOerHarvester\__construct(), ilMDEditorGUI\listQuickEditCopyright(), and ilMDEditorGUI\updateQuickEdit().

+ Here is the caller graph for this function:

◆ getTarget()

ilOerHarvesterSettings::getTarget ( )

Definition at line 71 of file class.ilOerHarvesterSettings.php.

71 : int
72 {
73 return $this->target;
74 }

References $target.

Referenced by save().

+ Here is the caller graph for this function:

◆ isActiveCopyrightTemplate()

ilOerHarvesterSettings::isActiveCopyrightTemplate ( int  $a_id)

Definition at line 92 of file class.ilOerHarvesterSettings.php.

92 : bool
93 {
94 return in_array($a_id, $this->getCopyrightTemplates());
95 }

References getCopyrightTemplates().

+ Here is the call graph for this function:

◆ read()

ilOerHarvesterSettings::read ( )

Definition at line 116 of file class.ilOerHarvesterSettings.php.

116 : void
117 {
118 $this->setTarget((int) $this->storage->get('target', '0'));
119 $this->setCopyrightTemplates(unserialize($this->storage->get('templates', serialize([])), ['allowed_classes' => false]));
120 }
setCopyrightTemplates(array $a_template_ids)

References setCopyrightTemplates(), and setTarget().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilOerHarvesterSettings::save ( )

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

110 : void
111 {
112 $this->storage->set('target', (string) $this->getTarget());
113 $this->storage->set('templates', serialize($this->copyright_templates));
114 }

References getTarget().

+ Here is the call graph for this function:

◆ setCopyrightTemplates()

ilOerHarvesterSettings::setCopyrightTemplates ( array  $a_template_ids)
Parameters
string[]$a_template_ids

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

79 : void
80 {
81 $this->copyright_templates = $a_template_ids;
82 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTarget()

ilOerHarvesterSettings::setTarget ( int  $a_target)

Definition at line 66 of file class.ilOerHarvesterSettings.php.

66 : void
67 {
68 $this->target = $a_target;
69 }

Referenced by read().

+ Here is the caller graph for this function:

◆ supportsHarvesting()

ilOerHarvesterSettings::supportsHarvesting ( string  $a_type)

Definition at line 53 of file class.ilOerHarvesterSettings.php.

53 : bool
54 {
55 return in_array($a_type, self::COLLECTED_TYPES);
56 }

Field Documentation

◆ $copyright_templates

array ilOerHarvesterSettings::$copyright_templates = []
private

Definition at line 31 of file class.ilOerHarvesterSettings.php.

Referenced by getCopyrightTemplates().

◆ $cronjob

ilCronOerHarvester ilOerHarvesterSettings::$cronjob = null
private

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

◆ $instance

ilOerHarvesterSettings ilOerHarvesterSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $settings

ilSetting ilOerHarvesterSettings::$settings
protected

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

◆ $storage

ilSetting ilOerHarvesterSettings::$storage
protected

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

◆ $target

int ilOerHarvesterSettings::$target = 0
private

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

Referenced by getTarget().

◆ COLLECTED_TYPES

const ilOerHarvesterSettings::COLLECTED_TYPES
Initial value:
= [
'file'
]

Definition at line 17 of file class.ilOerHarvesterSettings.php.

Referenced by getHarvestingTypes().

◆ CRON_JOB_IDENTIFIER

const ilOerHarvesterSettings::CRON_JOB_IDENTIFIER = 'meta_oer_harvester'

Definition at line 15 of file class.ilOerHarvesterSettings.php.

◆ STORAGE_IDENTIFIER

const ilOerHarvesterSettings::STORAGE_IDENTIFIER = 'meta_oer'

Definition at line 16 of file class.ilOerHarvesterSettings.php.


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