ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclFieldTypePlugin Class Reference
+ Inheritance diagram for ilDclFieldTypePlugin:
+ Collaboration diagram for ilDclFieldTypePlugin:

Public Member Functions

 install ()
 
 getStorageLocation ()
 
- Public Member Functions inherited from ilPlugin
 getMessage ()
 
 __construct (\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
 
 getPluginName ()
 
 getId ()
 
 getVersion ()
 Only very little classes seem to care about this: More...
 
 getDirectory ()
 Only very little classes seem to care about this: More...
 
 isActive ()
 Only very little classes seem to care about this: More...
 
 needsUpdate ()
 
 install ()
 
 uninstall ()
 
 activate ()
 This will update (if required) and activate the plugin. More...
 
 deactivate ()
 
 update ()
 
 loadLanguageModule ()
 Load language module for plugin. More...
 
 txt (string $a_var)
 Get Language Variable (prefix will be prepended automatically) More...
 
 getTemplate (string $a_template, bool $a_par1=true, bool $a_par2=true)
 @deprecate ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getStyleSheetLocation (string $a_css_file)
 @deprecate ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 addBlockFile ($a_tpl, $a_var, $a_block, $a_tplname)
 @deprecate ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getGlobalScreenProviderCollection ()
 
 exchangeUIRendererAfterInitialization (\ILIAS\DI\Container $dic)
 This methods allows to replace the UI Renderer (see src/UI) of ILIAS after initialization by returning a closure returning a custom renderer. More...
 
 exchangeUIFactoryAfterInitialization (string $dic_key, \ILIAS\DI\Container $dic)
 This methods allows to replace some factory for UI Components (see src/UI) of ILIAS after initialization by returning a closure returning a custom factory. More...
 

Static Public Member Functions

static getDataType (string $plugin_id)
 
static getPluginId (string $datatype)
 
static isPluginDatatype (string $datatype)
 

Data Fields

const ID_BUFFER = 1000
 
const DB_TYPES = ['text', 'text', 'integer', 'date']
 
const COMPONENT_NAME = "DataCollection"
 
const SLOT_ID = "dclfth"
 
const PLUGIN_SLOT_PREFIX = 'plugin_fth_'
 

Additional Inherited Members

- Protected Member Functions inherited from ilPlugin
 init ()
 Object initialization. More...
 
 getPluginInfo ()
 
 getComponentInfo ()
 
 getPluginSlotInfo ()
 
 afterInstall ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the install method in your subclass instead. More...
 
 beforeUninstall ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 afterUninstall ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 beforeActivation ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterActivation ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterDeactivation ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 updateDatabase ()
 
 beforeUpdate ()
 @deprecate If you cannot get rid of the requirement to use this, adjust the update method in your subclass instead. More...
 
 afterUpdate ()
 
 getLanguageHandler ()
 
 buildLanguageHandler ()
 
- Protected Attributes inherited from ilPlugin
ilDBInterface $db
 
ilComponentRepositoryWrite $component_repository
 
string $id
 
ilPluginLanguage $language_handler = null
 
bool $lang_initialised = false
 
ProviderCollection $provider_collection
 
string $message = ''
 

Detailed Description

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

Member Function Documentation

◆ getDataType()

static ilDclFieldTypePlugin::getDataType ( string  $plugin_id)
static

Definition at line 65 of file class.ilDclFieldTypePlugin.php.

65 : string
66 {
67 return self::PLUGIN_SLOT_PREFIX . $plugin_id;
68 }

Referenced by ilDataCollectionDBUpdateSteps9\step_16().

+ Here is the caller graph for this function:

◆ getPluginId()

static ilDclFieldTypePlugin::getPluginId ( string  $datatype)
static

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

70 : string
71 {
72 if (self::isPluginDatatype($datatype)) {
73 return substr($datatype, strlen(self::PLUGIN_SLOT_PREFIX));
74 }
75 throw new ilPluginException('Invalid datatype prefix for FieldTypHook-plugin');
76 }

Referenced by ilDclDatatype\getAllDatatype(), ilDclFieldFactory\getClassPathByInstance(), ilDclFieldFactory\getFieldTypeByInstance(), ilDclPluginFieldModel\getPresentationDescription(), and ilDclPluginFieldModel\getPresentationTitle().

+ Here is the caller graph for this function:

◆ getStorageLocation()

ilDclFieldTypePlugin::getStorageLocation ( )

Definition at line 60 of file class.ilDclFieldTypePlugin.php.

60 : int
61 {
62 return 1;
63 }

Referenced by install().

+ Here is the caller graph for this function:

◆ install()

ilDclFieldTypePlugin::install ( )

Reimplemented from ilPlugin.

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

30 : void
31 {
32 $field_type_name = ilDclFieldTypePlugin::PLUGIN_SLOT_PREFIX . $this->getId();
33 $datatypes = ilDclDatatype::getAllDatatype(true);
34 foreach ($datatypes as $datatype) {
35 if ($datatype->getTitle() === $field_type_name) {
36 parent::install();
37 return;
38 }
39 }
40
41 $field_model_class = 'il' . $this->getPluginName() . 'FieldModel';
42 $type = (new $field_model_class())->getStorageLocationOverride() ?? $this->getStorageLocation();
43 $this->db->manipulateF(
44 'INSERT INTO il_dcl_datatype (id, title, storage_location, sort) SELECT GREATEST(MAX(id), %s) + 1, %s, %s, GREATEST(MAX(sort), %s * 10) + 10 FROM il_dcl_datatype;',
45 [
50 ],
51 [
52 self::ID_BUFFER,
53 $field_type_name,
54 $type,
55 self::ID_BUFFER
56 ]
57 );
58 }
static getAllDatatype(bool $force=false)
Get all possible Datatypes.

References ilDclDatatype\getAllDatatype(), ilPlugin\getId(), ilPlugin\getPluginName(), getStorageLocation(), PLUGIN_SLOT_PREFIX, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

◆ isPluginDatatype()

static ilDclFieldTypePlugin::isPluginDatatype ( string  $datatype)
static

Definition at line 78 of file class.ilDclFieldTypePlugin.php.

78 : bool
79 {
80 return substr($datatype, 0, strlen(self::PLUGIN_SLOT_PREFIX)) === self::PLUGIN_SLOT_PREFIX;
81 }

References PLUGIN_SLOT_PREFIX.

Referenced by ilDclDatatype\getAllDatatype(), ilDclFieldFactory\getClassPathByInstance(), and ilDclFieldFactory\getFieldTypeByInstance().

+ Here is the caller graph for this function:

Field Documentation

◆ COMPONENT_NAME

const ilDclFieldTypePlugin::COMPONENT_NAME = "DataCollection"

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

◆ DB_TYPES

const ilDclFieldTypePlugin::DB_TYPES = ['text', 'text', 'integer', 'date']

◆ ID_BUFFER

const ilDclFieldTypePlugin::ID_BUFFER = 1000

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

Referenced by ilDclCache\getDatatype().

◆ PLUGIN_SLOT_PREFIX

const ilDclFieldTypePlugin::PLUGIN_SLOT_PREFIX = 'plugin_fth_'

Definition at line 28 of file class.ilDclFieldTypePlugin.php.

Referenced by install(), and isPluginDatatype().

◆ SLOT_ID

const ilDclFieldTypePlugin::SLOT_ID = "dclfth"

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