ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
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.

References ILIAS\GlobalScreen\get().

Referenced by ilStudyProgrammeTypeTableGUI\initColumns().

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

◆ getAllTypesArray()

static ilStudyProgrammeType::getAllTypesArray ( )
static

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

References $container, $default_lang, $key, $lang, $out, $records, $title, $type, ActiveRecord\count(), ActiveRecord\create(), ilStudyProgrammeTypeTranslation\deleteAllTranslations(), getDefaultLang(), getIconPath(), getId(), getTranslation(), IL_CAL_UNIX, setCreateDate(), setLastUpdate(), setOwner(), 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  return $out;
183  }
$type
+ 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 426 of file class.ilStudyProgrammeType.php.

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

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

◆ getAssignedStudyProgrammeIds()

ilStudyProgrammeType::getAssignedStudyProgrammeIds ( )

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

References $out, and getAssignedStudyProgrammes().

Referenced by getAvailableAdvancedMDRecords(), and updateAssignedStudyProgrammesIcons().

392  {
393  $study_programmes = $this->getAssignedStudyProgrammes();
394 
395  $out = array();
396  foreach ($study_programmes as $study_program) {
397  $out[] = $study_program->getObjId();
398  }
399 
400  return $out;
401  }
getAssignedStudyProgrammes($include_deleted=true)
Get an array of ilObjStudyProgramme objects using this type.
+ 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 386 of file class.ilStudyProgrammeType.php.

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

Referenced by getAssignedStudyProgrammeIds().

387  {
388  return ilStudyProgramme::where(array('subtype_id' => $this->getId()))->get();
389  }
static where($where, $operator=null)
+ 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 474 of file class.ilStudyProgrammeType.php.

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

Referenced by ilStudyProgrammeTypeAdvancedMetaDataFormGUI\saveObject().

475  {
476  if (is_array(self::$amd_records_available)) {
477  return self::$amd_records_available;
478  }
479  self::$amd_records_available = ilAdvancedMDRecord::_getActivatedRecordsByObjectType('prg', 'prg_type');
480 
481  return self::$amd_records_available;
482  }
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 1028 of file class.ilStudyProgrammeType.php.

References $create_date.

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

◆ getDefaultLang()

ilStudyProgrammeType::getDefaultLang ( )
Returns
string

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

References $default_lang.

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

1011  {
1012  return $this->default_lang;
1013  }
+ 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 360 of file class.ilStudyProgrammeType.php.

References getTranslation().

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

◆ getIcon()

ilStudyProgrammeType::getIcon ( )
Returns
string

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

References $icon.

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

918  {
919  return $this->icon;
920  }
+ 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 930 of file class.ilStudyProgrammeType.php.

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

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

931  {
932  $path = self::WEB_DATA_FOLDER . '/' . 'type_' . $this->getId() . '/';
933  if ($append_filename) {
934  $path .= $this->getIcon();
935  }
936 
937  return $path;
938  }
$path
Definition: aliased.php:25
+ 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 947 of file class.ilStudyProgrammeType.php.

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

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

◆ getId()

ilStudyProgrammeType::getId ( )

◆ getLastUpdate()

ilStudyProgrammeType::getLastUpdate ( )
Returns
string

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

References $last_update.

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

◆ getOwner()

ilStudyProgrammeType::getOwner ( )
Returns
int

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

References $owner.

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

◆ 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 331 of file class.ilStudyProgrammeType.php.

References getTranslation().

332  {
333  return $this->getTranslation('title', $a_lang_code);
334  }
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 656 of file class.ilStudyProgrammeType.php.

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

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

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

References $translations, 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 774 of file class.ilStudyProgrammeType.php.

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

Referenced by getTranslation().

775  {
776  if (isset($this->translations[$a_lang_code])) {
777  return $this->translations[$a_lang_code];
778  } else {
779  $trans_array = ilStudyProgrammeTypeTranslation::where(array('prg_type_id' => $this->getId(), 'lang' => $a_lang_code))->getArray('member', 'value');
780  if (count($trans_array)) {
781  $this->translations[$a_lang_code] = $trans_array;
782 
783  return $trans_array;
784  }
785  }
786 
787  return null;
788  }
static where($where, $operator=null)
+ 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 600 of file class.ilStudyProgrammeType.php.

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

601  {
602  if (!$this->updateable()) {
603  return false;
604  }
605  if (!count($file_data) || !$file_data['name']) {
606  return false;
607  }
608  if (!$this->webdir->hasDir($this->getIconPath())) {
609  $this->webdir->createDir($this->getIconPath());
610  }
611 
612  $filename = $this->getIcon() ? $this->getIcon() : $file_data['name'];
613 
614  if ($this->webdir->has($this->getIconPath(true))) {
615  $this->webdir->delete($this->getIconPath(true));
616  }
617 
618  $stream = ILIAS\Filesystem\Stream\Streams::ofResource(fopen($file_data["tmp_name"], "r"));
619  $this->webdir->writeStream($this->getIconPath(true), $stream);
620 
621  return true;
622  }
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:52
getIconPath($append_filename=false)
Return the path to the icon.
$filename
Definition: buildRTE.php:89
+ Here is the call graph for this function:

◆ removeIconFile()

ilStudyProgrammeType::removeIconFile ( )

Remove the icon file on disk.

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

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

629  {
630  if (!$this->updateable()) {
631  return;
632  }
633 
634  if (
635  !is_null($this->getIcon()) &&
636  $this->getIcon() !== ""
637  ) {
638  $this->webdir->delete($this->getIconPath(true));
639  $this->setIcon('');
640  }
641  }
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 1019 of file class.ilStudyProgrammeType.php.

References $create_date.

Referenced by getAllTypesArray().

1020  {
1021  $this->create_date = $create_date;
1022  }
+ 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 373 of file class.ilStudyProgrammeType.php.

References $lang, and getDefaultLang().

374  {
375  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
376  $this->setTranslation('description', $a_description, $lang);
377  }
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
+ 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 905 of file class.ilStudyProgrammeType.php.

References $icon.

Referenced by removeIconFile().

906  {
907  if ($icon and !preg_match('/\.(svg)$/', $icon)) {
908  throw new ilStudyProgrammeTypeException('Icon must be set with file extension svg');
909  }
910  $this->icon = $icon;
911  }
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 869 of file class.ilStudyProgrammeType.php.

References $last_update.

Referenced by getAllTypesArray().

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

◆ setOwner()

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

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

References $owner.

Referenced by getAllTypesArray().

852  {
853  $this->owner = $owner;
854  }
+ 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 344 of file class.ilStudyProgrammeType.php.

References $lang, and getDefaultLang().

345  {
346  $lang = ($a_lang_code) ? $a_lang_code : $this->getDefaultLang();
347  $this->setTranslation('title', $a_title, $lang);
348  }
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
+ Here is the call graph for this function:

◆ setTranslations()

ilStudyProgrammeType::setTranslations (   $translations)

Getters & Setters.

Parameters
array$translations

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

References $translations.

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

◆ updateable()

ilStudyProgrammeType::updateable ( )
protected

Helper function to check if this type can be updated.

Returns
bool

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

Referenced by processAndStoreIconFile(), and removeIconFile().

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

◆ updateAssignedStudyProgrammesIcons()

ilStudyProgrammeType::updateAssignedStudyProgrammesIcons ( )

Update the Icons of assigned objects.

Returns
void

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

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

409  {
410  $obj_ids = $this->getAssignedStudyProgrammeIds();
411 
412  foreach ($obj_ids as $id) {
413  $ref_id = ilObject::_getAllReferences($id);
414  $osp = ilObjStudyProgramme::getInstanceByRefId(array_pop($ref_id));
415  $osp->updateCustomIcon();
416  }
417  }
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: