ILIAS  release_8 Revision v8.23
ilAdvancedMDFieldDefinitionDateTime Class Reference

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

+ Inheritance diagram for ilAdvancedMDFieldDefinitionDateTime:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionDateTime:

Public Member Functions

 getType ()
 
 getValueForXML (ilADT $element)
 
 importValueFromXML (string $a_cdata)
 
 importFromECS (string $a_ecs_type, $a_value, string $a_sub_id)
 
 getLuceneSearchString ($a_value)
 
- Public Member Functions inherited from ilAdvancedMDFieldDefinition
 __construct (?int $a_field_id=null, string $language='')
 
 getType ()
 Get type. More...
 
 useDefaultLanguageMode (string $language)
 Check if default language mode has to be used: no language given or language equals default language. More...
 
 getTypeTitle ()
 
 getADTDefinition ()
 Get ADT definition instance. More...
 
 getADT ()
 
 getFieldId ()
 Get field_id. More...
 
 setRecordId (int $a_id)
 Set record id. More...
 
 getRecordId ()
 Get record id. More...
 
 setImportId (string $a_id_string)
 Set import id. More...
 
 getImportId ()
 Get import id. More...
 
 setPosition (int $a_pos)
 Set position. More...
 
 getPosition ()
 Get position. More...
 
 setTitle (string $a_title)
 Get title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription (string $a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 isSearchSupported ()
 Is search supported at all. More...
 
 isFilterSupported ()
 Is search by filter supported. More...
 
 setSearchable (bool $a_status)
 Toggle searchable. More...
 
 isSearchable ()
 Is searchable. More...
 
 setRequired (bool $a_status)
 Toggle required. More...
 
 isRequired ()
 Is required field. More...
 
 getFieldDefinitionForTableGUI (string $content_language)
 Parse properties for table gui. More...
 
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions, string $language='')
 Add input elements to definition form. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form, string $language='')
 Import custom post values from definition form. More...
 
 importDefinitionFormPostValues (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions, string $active_language)
 Import post values from definition form. More...
 
 importDefinitionFormPostValuesNeedsConfirmation ()
 
 prepareCustomDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 prepareDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 generateImportId (int $a_field_id)
 Generate unique record id. More...
 
 save (bool $a_keep_pos=false)
 Create new field entry. More...
 
 update ()
 Update field entry. More...
 
 delete ()
 Delete field entry. More...
 
 toXML (ilXmlWriter $a_writer)
 To Xml. More...
 
 importXMLProperty (string $a_key, string $a_value)
 Import property from XML. More...
 
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export) More...
 
 importValueFromXML (string $a_cdata)
 Import value from xml. More...
 
 importFromECS (string $a_ecs_type, $a_value, string $a_sub_id)
 Import meta data from ECS. More...
 
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 Prepare editor form elements. More...
 
 getSearchQueryParserValue (ilADTSearchBridge $a_adt_search)
 Get value for search query parser. More...
 
 getSearchValueSerialized (ilADTSearchBridge $a_adt_search)
 
 setSearchValueSerialized (ilADTSearchBridge $a_adt_search, $a_value)
 Set value from search persistence. More...
 
 searchSubObjects (ilADTSearchBridge $a_adt_search, int $a_obj_id, string $sub_obj_type)
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, string $a_locate, string $a_search_type)
 Search objects. More...
 
 getLuceneSearchString ($a_value)
 Get search string in lucene syntax. More...
 
 prepareElementForSearch (ilADTSearchBridge $a_bridge)
 Prepare search form elements. More...
 
 _clone (int $a_new_record_id)
 Clone field definition. More...
 
 hasComplexOptions ()
 
 getComplexOptionsOverview (object $a_parent_gui, string $parent_cmd)
 

Protected Member Functions

 initADTDefinition ()
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 init ()
 
 initADTDefinition ()
 Init adt instance. More...
 
 setADT (ilADT $a_adt)
 Set ADT instance. More...
 
 setFieldId (int $a_id)
 Set field_id. More...
 
 importFieldDefinition (array $a_def)
 Import (type-specific) field definition from DB. More...
 
 getFieldDefinition ()
 Get (type-specific) field definition. More...
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, bool $a_disabled=false, string $language='')
 Add custom input elements to definition form. More...
 
 getLastPosition ()
 Get last position of record. More...
 
 getDBProperties ()
 Get all definition properties for DB. More...
 
 import (array $a_data)
 Import from DB. More...
 
 read (?int $a_field_id)
 Read field definition. More...
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 Add (type-specific) properties to xml export. More...
 
 parseSearchObjects (array $a_records, array $a_object_types)
 Add object-data needed for global search to AMD search results. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstance (?int $a_field_id, ?int $a_type=null, string $language='')
 
static exists (int $a_field_id)
 
static getInstanceByTypeString (string $a_type)
 Get instance by type string (used by import) More...
 
static getInstancesByRecordId ( $a_record_id, $a_only_searchable=false, string $language='')
 Get definitions by record id. More...
 
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
 
static getInstanceByImportId (string $a_import_id)
 
static getSearchableDefinitionIds ()
 Get searchable definition ids (performance is key) More...
 
static getADTGroupForDefinitions (array $a_defs)
 Init ADTGroup for definitions. More...
 
static getValidTypes ()
 Get all valid types. More...
 
static isValidType (int $a_type)
 
- Data Fields inherited from ilAdvancedMDFieldDefinition
const TYPE_SELECT = 1
 
const TYPE_TEXT = 2
 
const TYPE_DATE = 3
 
const TYPE_DATETIME = 4
 
const TYPE_INTEGER = 5
 
const TYPE_FLOAT = 6
 
const TYPE_LOCATION = 7
 
const TYPE_SELECT_MULTI = 8
 
const TYPE_ADDRESS = 99
 
const TYPE_EXTERNAL_LINK = 9
 
const TYPE_INTERNAL_LINK = 10
 
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getTypeString (int $a_type)
 Get type as string. More...
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
int $field_id = null
 
int $record_id = 0
 
string $import_id = ''
 
int $position = 0
 
string $title = ''
 
string $description = ''
 
bool $searchable = false
 
bool $required = false
 
ilADTDefinition $adt_def = null
 
ilADT $adt = null
 
string $language = ''
 
ilDBInterface $db
 
ilLanguage $lng
 
ilLogger $logger
 
GlobalHttpState $http
 
RefineryFactory $refinery
 

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 AMD field type date time

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Member Function Documentation

◆ getLuceneSearchString()

ilAdvancedMDFieldDefinitionDateTime::getLuceneSearchString (   $a_value)

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

References IL_CAL_DATETIME, IL_CAL_FKT_DATE, ilCalendarUtil\parseIncomingDate(), and ilTimeZone\UTC.

85  : string
86  {
87  $start = new ilDateTime('1970-01-01 00:00:01', IL_CAL_DATETIME, ilTimeZone::UTC);
88  $end = new ilDateTime('2038-01-19 00:00:01', IL_CAL_DATETIME, ilTimeZone::UTC);
89 
90  if (!($a_value['lower'] ?? false) || !($a_value['upper'])) {
91  return '';
92  }
93  if ($a_value['lower'] ?? false) {
94  $start = ilCalendarUtil::parseIncomingDate($a_value['lower'], true);
95  }
96  if ($a_value['upper'] ?? false) {
97  $end = ilCalendarUtil::parseIncomingDate($a_value['upper'], true);
98  }
99  return '[' . $start->get(IL_CAL_FKT_DATE, 'Y-m-d\Th:m') . ' TO ' . $end->get(IL_CAL_FKT_DATE, 'Y-m-d\Th:m') . ']';
100  }
const IL_CAL_DATETIME
const IL_CAL_FKT_DATE
static parseIncomingDate($a_value, bool $a_add_time=false)
Try to parse incoming value to date object.
+ Here is the call graph for this function:

◆ getType()

ilAdvancedMDFieldDefinitionDateTime::getType ( )

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

34  : int
35  {
36  return self::TYPE_DATETIME;
37  }

◆ getValueForXML()

ilAdvancedMDFieldDefinitionDateTime::getValueForXML ( ilADT  $element)

Definition at line 54 of file class.ilAdvancedMDFieldDefinitionDateTime.php.

References IL_CAL_DATETIME.

54  : string
55  {
56  return $element->getDate()->get(IL_CAL_DATETIME);
57  }
const IL_CAL_DATETIME

◆ importFromECS()

ilAdvancedMDFieldDefinitionDateTime::importFromECS ( string  $a_ecs_type,
  $a_value,
string  $a_sub_id 
)

Definition at line 64 of file class.ilAdvancedMDFieldDefinitionDateTime.php.

References ilAdvancedMDFieldDefinition\getADT(), IL_CAL_UNIX, and ilECSUtils\TYPE_TIMEPLACE.

64  : bool
65  {
66  $value = '';
67  switch ($a_ecs_type) {
69  if ($a_value instanceof ilECSTimePlace) {
70  $value = new ilDateTime($a_value->{'getUT' . ucfirst($a_sub_id)}(), IL_CAL_UNIX);
71  }
72  break;
73  }
74 
75  if ($value instanceof ilDateTime) {
76  $this->getADT()->setDate($value);
77  return true;
78  }
79  return false;
80  }
Representation of ECS EContent Time Place.
const IL_CAL_UNIX
const TYPE_TIMEPLACE
+ Here is the call graph for this function:

◆ importValueFromXML()

ilAdvancedMDFieldDefinitionDateTime::importValueFromXML ( string  $a_cdata)

Definition at line 59 of file class.ilAdvancedMDFieldDefinitionDateTime.php.

References ilAdvancedMDFieldDefinition\getADT(), and IL_CAL_DATETIME.

59  : void
60  {
61  $this->getADT()->setDate(new ilDate($a_cdata, IL_CAL_DATETIME));
62  }
const IL_CAL_DATETIME
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionDateTime::initADTDefinition ( )
protected

Definition at line 44 of file class.ilAdvancedMDFieldDefinitionDateTime.php.

References ilADTFactory\getInstance().

45  {
46  return ilADTFactory::getInstance()->getDefinitionInstanceByType("DateTime");
47  }
ADT definition base class.
+ Here is the call graph for this function:

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