ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilStudyProgrammeType Class Reference

Class ilStudyProgrammeType. More...

+ Inheritance diagram for ilStudyProgrammeType:
+ Collaboration diagram for ilStudyProgrammeType:

Public Member Functions

 __construct ($primary_key=0)
 
 getTitle ($a_lang_code='')
 Get the title of an StudyProgramme type. More...
 
 setTitle ($a_title, $a_lang_code='')
 Set title of StudyProgramme type. More...
 
 getDescription ($a_lang_code='')
 Get the description of an StudyProgramme type. More...
 
 setDescription ($a_description, $a_lang_code='')
 Set description of StudyProgramme type. More...
 
 getAssignedStudyProgrammes ($include_deleted=true)
 Get an array of ilObjStudyProgramme objects using this type. More...
 
 getAssignedStudyProgrammeIds ()
 
 updateAssignedStudyProgrammesIcons ()
 Update the Icons of assigned objects. More...
 
 getAssignedAdvancedMDRecords ($a_only_active=false)
 Get assigned AdvancedMDRecord objects. More...
 
 processAndStoreIconFile (array $file_data)
 Resize and store an icon file for this object. More...
 
 removeIconFile ()
 Remove the icon file on disk. More...
 
 setTranslations ($translations)
 Getters & Setters. More...
 
 getTranslations ()
 Returns the loaded translation objects. More...
 
 setOwner ($owner)
 
 getOwner ()
 
 setLastUpdate ($last_update)
 
 getLastUpdate ()
 
 getId ()
 
 setIcon ($icon)
 Set new Icon filename. More...
 
 getIcon ()
 
 getIconPath ($append_filename=false)
 Return the path to the icon. More...
 
 getDefaultLang ()
 
 setCreateDate ($create_date)
 
 getCreateDate ()
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
static getAllTypes ()
 Public. More...
 
static getAllTypesArray ($add_empty_on_begin=true)
 
static getAvailableAdvancedMDRecords ()
 Get all available AdvancedMDRecord objects for StudyProgrammes/Types. More...
 
static getIconPathByStudyProgrammObjId ($obj_id)
 Return the path to the icon by studyprogramme obj id. More...
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $capitalise_first_char=false)
 

Data Fields

const WEB_DATA_FOLDER = 'prg_data'
 Folder in ILIAS webdir to store the icons. More...
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Member Functions

 getTranslation ($a_member, $a_lang_code)
 Protected. More...
 
 loadTranslation ($a_lang_code)
 Helper function to load a translation. More...
 
 updateable ()
 Helper function to check if this type can be updated. More...
 
- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 

Protected Attributes

 $id = 0
 
 $default_lang = ''
 
 $owner
 
 $create_date
 
 $last_update
 
 $icon
 
 $amd_records_assigned
 
 $log
 
 $user
 
 $pluginAdmin
 
 $active_plugins
 
 $lng
 
 $translations
 
 $changed_translations = array()
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Static Protected Attributes

static $amd_records_available
 

Additional Inherited Members

- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeType::__construct (   $primary_key = 0)
Parameters
int$a_id
Exceptions
ilStudyProgrammeTypeException

Definition at line 141 of file class.ilStudyProgrammeType.php.

References $DIC, $ilDB, $ilLog, $ilUser, $lng, and user().

142  {
143  global $DIC;
144  $ilDB = $DIC['ilDB'];
145  $ilLog = $DIC['ilLog'];
146  $ilUser = $DIC['ilUser'];
147  $ilPluginAdmin = $DIC['ilPluginAdmin'];
148  $lng = $DIC['lng'];
149 
150  $this->webdir = $DIC->filesystem()->web();
151  $this->db = $ilDB;
152  $this->log = $ilLog;
153  $this->user = $ilUser;
154  $this->pluginAdmin = $ilPluginAdmin;
155  $this->lng = $lng;
156 
157  parent::__construct($primary_key);
158  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
$ilUser
Definition: imgupload.php:18
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ getAllTypes()

static ilStudyProgrammeType::getAllTypes ( )
static

Public.

Get array of all instances of ilStudyProgrammeType objects

Returns
array

Definition at line 169 of file class.ilStudyProgrammeType.php.

Referenced by ilStudyProgrammeTypeTableGUI\initColumns().

170  {
171  return self::get();
172  }
+ Here is the caller graph for this function:

◆ getAllTypesArray()

static ilStudyProgrammeType::getAllTypesArray (   $add_empty_on_begin = true)
static

Definition at line 174 of file class.ilStudyProgrammeType.php.

References $container, $default_lang, $key, $lang, $out, $records, $title, $type, array, ActiveRecord\count(), ActiveRecord\create(), ilStudyProgrammeTypeTranslation\deleteAllTranslations(), getDefaultLang(), getIconPath(), getId(), getTranslation(), IL_CAL_UNIX, setCreateDate(), setLastUpdate(), setOwner(), time, League\Flysystem\Adapter\Polyfill\update(), ActiveRecord\update(), user(), and ActiveRecord\where().

Referenced by ilObjStudyProgrammeSettingsGUI\buildForm().

175  {
176  $out = array();
177 
178  foreach (self::getAllTypes() as $type) {
179  $out[$type->getId()] = $type->getTitle();
180  }
181 
182  if ($add_empty_on_begin) {
183  $out = array('-'=>'-') + $out;
184  }
185 
186  return $out;
187  }
$type
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignedAdvancedMDRecords()

ilStudyProgrammeType::getAssignedAdvancedMDRecords (   $a_only_active = false)

Get assigned AdvancedMDRecord objects.

Parameters
bool$a_only_activeTrue if only active AMDRecords are returned
Returns
array

Definition at line 430 of file class.ilStudyProgrammeType.php.

References $sets, array, getId(), and ActiveRecord\where().

431  {
432  $active = ($a_only_active) ? 1 : 0; // Cache key
433  if (is_array($this->amd_records_assigned[$active])) {
434  return $this->amd_records_assigned[$active];
435  }
436  $this->amd_records_assigned[$active] = array();
437  $sets = ilStudyProgrammeAdvancedMetadataRecord::where(array('type_id'=>$this->getId()))->get();
438 
439  foreach ($sets as $set) {
440  $amd_record = new ilAdvancedMDRecord($set->getRecId());
441  if ($a_only_active) {
442  if ($amd_record->isActive()) {
443  $this->amd_records_assigned[1][] = $amd_record;
444  }
445  } else {
446  $this->amd_records_assigned[0][] = $amd_record;
447  }
448  }
449 
450  return $this->amd_records_assigned[$active];
451  }
static where($where, $operator=null)
Create styles array
The data for the language used.
$sets
Definition: fetch.php:11
+ Here is the call graph for this function:

◆ getAssignedStudyProgrammeIds()

ilStudyProgrammeType::getAssignedStudyProgrammeIds ( )

Definition at line 395 of file class.ilStudyProgrammeType.php.

References $out, array, and getAssignedStudyProgrammes().

Referenced by getAvailableAdvancedMDRecords(), and updateAssignedStudyProgrammesIcons().

396  {
397  $study_programmes = $this->getAssignedStudyProgrammes();
398 
399  $out = array();
400  foreach ($study_programmes as $study_program) {
401  $out[] = $study_program->getObjId();
402  }
403 
404  return $out;
405  }
getAssignedStudyProgrammes($include_deleted=true)
Get an array of ilObjStudyProgramme objects using this type.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAssignedStudyProgrammes()

ilStudyProgrammeType::getAssignedStudyProgrammes (   $include_deleted = true)

Get an array of ilObjStudyProgramme objects using this type.

Parameters
bool$include_deletedTrue if also deleted StudyProgrammes are returned
Returns
array

Definition at line 390 of file class.ilStudyProgrammeType.php.

References array, getId(), and ActiveRecord\where().

Referenced by getAssignedStudyProgrammeIds().

391  {
392  return ilStudyProgramme::where(array('subtype_id'=>$this->getId()))->get();
393  }
static where($where, $operator=null)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableAdvancedMDRecords()

static ilStudyProgrammeType::getAvailableAdvancedMDRecords ( )
static

Get all available AdvancedMDRecord objects for StudyProgrammes/Types.

Returns
array

Definition at line 478 of file class.ilStudyProgrammeType.php.

References $key, $records, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), array, ActiveRecord\count(), getAssignedStudyProgrammeIds(), getId(), ilAdvancedMDRecord\saveObjRecSelection(), and ActiveRecord\where().

Referenced by ilStudyProgrammeTypeAdvancedMetaDataFormGUI\saveObject().

479  {
480  if (is_array(self::$amd_records_available)) {
481  return self::$amd_records_available;
482  }
483  self::$amd_records_available = ilAdvancedMDRecord::_getActivatedRecordsByObjectType('prg', 'prg_type');
484 
485  return self::$amd_records_available;
486  }
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreateDate()

ilStudyProgrammeType::getCreateDate ( )
Returns
string

Definition at line 1029 of file class.ilStudyProgrammeType.php.

References $create_date.

1030  {
1031  return $this->create_date;
1032  }

◆ getDefaultLang()

ilStudyProgrammeType::getDefaultLang ( )
Returns
string

Definition at line 1011 of file class.ilStudyProgrammeType.php.

References $default_lang.

Referenced by getAllTypesArray(), getTranslation(), setDescription(), and setTitle().

1012  {
1013  return $this->default_lang;
1014  }
+ Here is the caller graph for this function:

◆ getDescription()

ilStudyProgrammeType::getDescription (   $a_lang_code = '')

Get the description of an StudyProgramme type.

If no language code is given, a translation in the user-language is returned. If no such translation exists, the description of the default language is substituted. If a language code is provided, returns description for the given language or null.

Parameters
string$a_lang_code
Returns
null|string

Definition at line 364 of file class.ilStudyProgrammeType.php.

References getTranslation().

365  {
366  return $this->getTranslation('description', $a_lang_code);
367  }
getTranslation($a_member, $a_lang_code)
Protected.
+ Here is the call graph for this function:

◆ getIcon()

ilStudyProgrammeType::getIcon ( )
Returns
string

Definition at line 918 of file class.ilStudyProgrammeType.php.

References $icon.

Referenced by getIconPath(), processAndStoreIconFile(), and removeIconFile().

919  {
920  return $this->icon;
921  }
+ Here is the caller graph for this function:

◆ getIconPath()

ilStudyProgrammeType::getIconPath (   $append_filename = false)

Return the path to the icon.

Parameters
bool$append_filenameIf true, append filename of icon
Returns
string

Definition at line 931 of file class.ilStudyProgrammeType.php.

References $path, getIcon(), and getId().

Referenced by getAllTypesArray(), processAndStoreIconFile(), and removeIconFile().

932  {
933  $path = self::WEB_DATA_FOLDER . '/' . 'type_' . $this->getId() . '/';
934  if ($append_filename) {
935  $path .= $this->getIcon();
936  }
937 
938  return $path;
939  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIconPathByStudyProgrammObjId()

static ilStudyProgrammeType::getIconPathByStudyProgrammObjId (   $obj_id)
static

Return the path to the icon by studyprogramme obj id.

Parameters
int$obj_idstudy prgramm obj id
Returns
string icon path

Definition at line 948 of file class.ilStudyProgrammeType.php.

References $default_lang, $DIC, $ilDB, $path, $res, $row, array, and ActiveRecord\count().

949  {
950  global $DIC;
951  $ilDB = $DIC['ilDB'];
952 
953  $sql = "SELECT prgt.id, prgt.icon\n"
954  . " FROM prg_type prgt\n"
955  . " JOIN prg_settings prgs\n"
956  . " ON prgt.id = prgs.subtype_id\n"
957  . " WHERE prgs.obj_id = " . $ilDB->quote($obj_id, "integer") . "\n";
958 
959  $res = $ilDB->query($sql);
960 
961  if ($ilDB->numRows($res) == 1) {
962  $row = $ilDB->fetchAssoc($res);
963 
964  if ($row["icon"]) {
965  $path = self::WEB_DATA_FOLDER . '/' . 'type_' . $row["id"] . '/';
966  $path .= $row["icon"];
967 
968  return $path;
969  }
970 
971  return null;
972  }
973 
974  return null;
975  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB
+ Here is the call graph for this function:

◆ getId()

ilStudyProgrammeType::getId ( )

◆ getLastUpdate()

ilStudyProgrammeType::getLastUpdate ( )
Returns
string

Definition at line 879 of file class.ilStudyProgrammeType.php.

References $last_update.

880  {
881  return $this->last_update;
882  }

◆ getOwner()

ilStudyProgrammeType::getOwner ( )
Returns
int

Definition at line 861 of file class.ilStudyProgrammeType.php.

References $owner.

862  {
863  return $this->owner;
864  }

◆ getTitle()

ilStudyProgrammeType::getTitle (   $a_lang_code = '')

Get the title of an StudyProgramme type.

If no language code is given, a translation in the user-language is returned. If no such translation exists, the translation of the default language is substituted. If a language code is provided, returns title for the given language or null.

Parameters
string$a_lang_code
Returns
null|string

Definition at line 335 of file class.ilStudyProgrammeType.php.

References getTranslation().

336  {
337  return $this->getTranslation('title', $a_lang_code);
338  }
getTranslation($a_member, $a_lang_code)
Protected.
+ Here is the call graph for this function:

◆ getTranslation()

ilStudyProgrammeType::getTranslation (   $a_member,
  $a_lang_code 
)
protected

Protected.

Helper method to return a translation for a given member and language

Parameters
$a_member
$a_lang_code
Returns
null|string

Definition at line 657 of file class.ilStudyProgrammeType.php.

References $active_plugins, $lang, array, ActiveRecord\count(), getDefaultLang(), getId(), IL_COMP_MODULE, loadTranslation(), user(), and ActiveRecord\where().

Referenced by getAllTypesArray(), getDescription(), and getTitle().

658  {
659  $lang = ($a_lang_code) ? $a_lang_code : $this->user->getLanguage();
660 
661  $trans_obj = $this->loadTranslation($lang);
662  if (!is_null($trans_obj)) {
663  $translation = $trans_obj[$a_member];
664  // If the translation does exist but is an empty string and there was no lang code given,
665  // substitute default language anyway because an empty string provides no information
666  if (!$a_lang_code && !$translation) {
667  $trans_obj = $this->loadTranslation($this->getDefaultLang());
668 
669  return $trans_obj[$a_member];
670  }
671 
672  return $translation;
673  } else {
674  // If no lang code was given and there was no translation found, return string in default language
675  if (!$a_lang_code) {
676  $trans_obj = $this->loadTranslation($this->getDefaultLang());
677 
678  return $trans_obj[$a_member];
679  }
680 
681  return null;
682  }
683  }
user()
Definition: user.php:4
loadTranslation($a_lang_code)
Helper function to load a translation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslations()

ilStudyProgrammeType::getTranslations ( )

Returns the loaded translation objects.

Returns
array

Definition at line 826 of file class.ilStudyProgrammeType.php.

References $translations, array, getId(), and ActiveRecord\where().

+ Here is the call graph for this function:

◆ loadTranslation()

ilStudyProgrammeType::loadTranslation (   $a_lang_code)
protected

Helper function to load a translation.

Returns translation object from cache or null, if no translation exists for the given code.

Parameters
string$a_lang_codeA language code
Returns
ActiveRecordList|null

Definition at line 775 of file class.ilStudyProgrammeType.php.

References array, ActiveRecord\count(), getId(), and ActiveRecord\where().

Referenced by getTranslation().

776  {
777  if (isset($this->translations[$a_lang_code])) {
778  return $this->translations[$a_lang_code];
779  } else {
780  $trans_array = ilStudyProgrammeTypeTranslation::where(array('prg_type_id'=>$this->getId(), 'lang'=>$a_lang_code))->getArray('member', 'value');
781  if (count($trans_array)) {
782  $this->translations[$a_lang_code] = $trans_array;
783 
784  return $trans_array;
785  }
786  }
787 
788  return null;
789  }
static where($where, $operator=null)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processAndStoreIconFile()

ilStudyProgrammeType::processAndStoreIconFile ( array  $file_data)

Resize and store an icon file for this object.

Parameters
array$file_dataThe array containing file information from the icon from PHPs $_FILES array
Returns
bool

Definition at line 604 of file class.ilStudyProgrammeType.php.

References $filename, GuzzleHttp\Psr7\$stream, ActiveRecord\count(), getIcon(), getIconPath(), ILIAS\Filesystem\Stream\Streams\ofResource(), and updateable().

605  {
606  if (!$this->updateable()) {
607  return false;
608  }
609  if (!count($file_data) || !$file_data['name']) {
610  return false;
611  }
612  if (!$this->webdir->hasDir($this->getIconPath())) {
613  $this->webdir->createDir($this->getIconPath());
614  }
615 
616  $filename = $this->getIcon() ? $this->getIcon() : $file_data['name'];
617 
618  if ($this->webdir->has($this->getIconPath(true))) {
619  $this->webdir->delete($this->getIconPath(true));
620  }
621 
622  $stream = ILIAS\Filesystem\Stream\Streams::ofResource(fopen($file_data["tmp_name"], "r"));
623  $this->webdir->writeStream($this->getIconPath(true), $stream);
624 
625  return true;
626  }
updateable()
Helper function to check if this type can be updated.
$stream
PHP stream implementation.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Definition: Streams.php:51
getIconPath($append_filename=false)
Return the path to the icon.
+ Here is the call graph for this function:

◆ removeIconFile()

ilStudyProgrammeType::removeIconFile ( )

Remove the icon file on disk.

Definition at line 632 of file class.ilStudyProgrammeType.php.

References getIcon(), getIconPath(), setIcon(), and updateable().

633  {
634  if (!$this->updateable()) {
635  return;
636  }
637 
638  if ($this->getIcon() !== "" && $this->getIcon() !== null) {
639  $this->webdir->delete($this->getIconPath(true));
640  $this->setIcon('');
641  }
642  }
updateable()
Helper function to check if this type can be updated.
setIcon($icon)
Set new Icon filename.
getIconPath($append_filename=false)
Return the path to the icon.
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilStudyProgrammeType::returnDbTableName ( )
static
Returns
string Return the Name of your Database Table
Deprecated:

Definition at line 131 of file class.ilStudyProgrammeType.php.

132  {
133  return 'prg_type';
134  }

◆ setCreateDate()

ilStudyProgrammeType::setCreateDate (   $create_date)
Parameters
string$create_date

Definition at line 1020 of file class.ilStudyProgrammeType.php.

References $create_date.

Referenced by getAllTypesArray().

1021  {
1022  $this->create_date = $create_date;
1023  }
+ Here is the caller graph for this function:

◆ setDescription()

ilStudyProgrammeType::setDescription (   $a_description,
  $a_lang_code = '' 
)

Set description of StudyProgramme type.

If no lang code is given, sets description for default language.

Parameters
$a_description
string$a_lang_code

Definition at line 377 of file class.ilStudyProgrammeType.php.

References $lang, and getDefaultLang().

378  {
379  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
380  $this->setTranslation('description', $a_description, $lang);
381  }
+ Here is the call graph for this function:

◆ setIcon()

ilStudyProgrammeType::setIcon (   $icon)

Set new Icon filename.

Note that if you did also send a new icon image file with a form, make sure to call ilStudyProgrammeType::processAndStoreIconFile() to store the file additionally on disk.

If you want to delete the icon, set call ilStudyProgrammeType::removeIconFile() first and set an empty string here.

Parameters
string$icon
Exceptions
ilStudyProgrammeTypeException

Definition at line 906 of file class.ilStudyProgrammeType.php.

References $icon.

Referenced by removeIconFile().

907  {
908  if ($icon and !preg_match('/\.(svg)$/', $icon)) {
909  throw new ilStudyProgrammeTypeException('Icon must be set with file extension svg');
910  }
911  $this->icon = $icon;
912  }
Exception is thrown when errors occurs relating the subtype implementation.
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilStudyProgrammeType::setLastUpdate (   $last_update)
Parameters
string$last_update

Definition at line 870 of file class.ilStudyProgrammeType.php.

References $last_update.

Referenced by getAllTypesArray().

871  {
872  $this->last_update = $last_update;
873  }
+ Here is the caller graph for this function:

◆ setOwner()

ilStudyProgrammeType::setOwner (   $owner)
Parameters
int$owner

Definition at line 852 of file class.ilStudyProgrammeType.php.

References $owner.

Referenced by getAllTypesArray().

853  {
854  $this->owner = $owner;
855  }
+ Here is the caller graph for this function:

◆ setTitle()

ilStudyProgrammeType::setTitle (   $a_title,
  $a_lang_code = '' 
)

Set title of StudyProgramme type.

If no lang code is given, sets title for default language.

Parameters
$a_title
string$a_lang_code

Definition at line 348 of file class.ilStudyProgrammeType.php.

References $lang, and getDefaultLang().

349  {
350  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
351  $this->setTranslation('title', $a_title, $lang);
352  }
+ Here is the call graph for this function:

◆ setTranslations()

ilStudyProgrammeType::setTranslations (   $translations)

Getters & Setters.

Parameters
array$translations

Definition at line 815 of file class.ilStudyProgrammeType.php.

References $translations.

816  {
817  $this->translations = $translations;
818  }

◆ updateable()

ilStudyProgrammeType::updateable ( )
protected

Helper function to check if this type can be updated.

Returns
bool

Definition at line 796 of file class.ilStudyProgrammeType.php.

Referenced by processAndStoreIconFile(), and removeIconFile().

797  {
798  foreach ($this->getActivePlugins() as $plugin) {
799  if (!$plugin->allowUpdate($this->getId())) {
800  return false;
801  }
802  }
803 
804  return true;
805  }
+ Here is the caller graph for this function:

◆ updateAssignedStudyProgrammesIcons()

ilStudyProgrammeType::updateAssignedStudyProgrammesIcons ( )

Update the Icons of assigned objects.

Returns
void

Definition at line 412 of file class.ilStudyProgrammeType.php.

References $id, ilObject\_getAllReferences(), getAssignedStudyProgrammeIds(), and ilObjStudyProgramme\getInstanceByRefId().

413  {
414  $obj_ids = $this->getAssignedStudyProgrammeIds();
415 
416  foreach ($obj_ids as $id) {
417  $ref_id = ilObject::_getAllReferences($id);
418  $osp = ilObjStudyProgramme::getInstanceByRefId(array_pop($ref_id));
419  $osp->updateCustomIcon();
420  }
421  }
static _getAllReferences($a_id)
get all reference ids of object
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
+ Here is the call graph for this function:

Field Documentation

◆ $active_plugins

ilStudyProgrammeType::$active_plugins
protected

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

Referenced by getTranslation().

◆ $amd_records_assigned

ilStudyProgrammeType::$amd_records_assigned
protected

Definition at line 85 of file class.ilStudyProgrammeType.php.

◆ $amd_records_available

ilStudyProgrammeType::$amd_records_available
staticprotected

Definition at line 90 of file class.ilStudyProgrammeType.php.

◆ $changed_translations

ilStudyProgrammeType::$changed_translations = array()
protected

Definition at line 124 of file class.ilStudyProgrammeType.php.

◆ $create_date

ilStudyProgrammeType::$create_date
protected

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

Referenced by getCreateDate(), and setCreateDate().

◆ $default_lang

ilStudyProgrammeType::$default_lang = ''
protected

◆ $icon

ilStudyProgrammeType::$icon
protected

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

Referenced by getIcon(), and setIcon().

◆ $id

ilStudyProgrammeType::$id = 0
protected

Definition at line 34 of file class.ilStudyProgrammeType.php.

Referenced by getId(), and updateAssignedStudyProgrammesIcons().

◆ $last_update

ilStudyProgrammeType::$last_update
protected

Definition at line 70 of file class.ilStudyProgrammeType.php.

Referenced by getLastUpdate(), and setLastUpdate().

◆ $lng

ilStudyProgrammeType::$lng
protected

Definition at line 115 of file class.ilStudyProgrammeType.php.

Referenced by __construct().

◆ $log

ilStudyProgrammeType::$log
protected

Definition at line 95 of file class.ilStudyProgrammeType.php.

◆ $owner

ilStudyProgrammeType::$owner
protected

Definition at line 52 of file class.ilStudyProgrammeType.php.

Referenced by getOwner(), and setOwner().

◆ $pluginAdmin

ilStudyProgrammeType::$pluginAdmin
protected

Definition at line 105 of file class.ilStudyProgrammeType.php.

◆ $translations

ilStudyProgrammeType::$translations
protected

Definition at line 120 of file class.ilStudyProgrammeType.php.

Referenced by getTranslations(), and setTranslations().

◆ $user

ilStudyProgrammeType::$user
protected

Definition at line 100 of file class.ilStudyProgrammeType.php.

◆ WEB_DATA_FOLDER

const ilStudyProgrammeType::WEB_DATA_FOLDER = 'prg_data'

Folder in ILIAS webdir to store the icons.

Definition at line 22 of file class.ilStudyProgrammeType.php.


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