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

AMD field type date time. More...

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

Public Member Functions

 getType ()
 
 getValueForXML (ilADT $element)
 
 importValueFromXML ($a_cdata)
 
 importFromECS ($a_ecs_type, $a_value, $a_sub_id)
 
 getLuceneSearchString ($a_value)
 
- Public Member Functions inherited from ilAdvancedMDFieldDefinition
 __construct ($a_field_id=null)
 Constructor. More...
 
 getType ()
 Get type. More...
 
 getTypeTitle ()
 Get type title (lang id) More...
 
 getADTDefinition ()
 Get ADT definition instance. More...
 
 getADT ()
 Get ADT instance. More...
 
 getFieldId ()
 Get field_id. More...
 
 setRecordId ($a_id)
 Set record id. More...
 
 getRecordId ()
 Get record id. More...
 
 setImportId ($a_id_string)
 Set import id. More...
 
 getImportId ()
 Get import id. More...
 
 setPosition ($a_pos)
 Set position. More...
 
 getPosition ()
 Get position. More...
 
 setTitle ($a_title)
 Get title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 isSearchSupported ()
 Is search supported at all. More...
 
 isFilterSupported ()
 Is search by filter supported. More...
 
 setSearchable ($a_status)
 Toggle searchable. More...
 
 isSearchable ()
 Is searchable. More...
 
 setRequired ($a_status)
 Toggle required. More...
 
 isRequired ()
 Is required field. More...
 
 getFieldDefinitionForTableGUI ()
 Parse properties for table gui. More...
 
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Add input elements to definition form. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form)
 Import custom post values from definition form. More...
 
 importDefinitionFormPostValues (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Import post values from definition form. More...
 
 importDefinitionFormPostValuesNeedsConfirmation ()
 
 prepareCustomDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 prepareDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 
 generateImportId ($a_field_id)
 Generate unique record id. More...
 
 save ($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 ($a_key, $a_value)
 Import property from XML. More...
 
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export) More...
 
 importValueFromXML ($a_cdata)
 Import value from xml. More...
 
 importFromECS ($a_ecs_type, $a_value, $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)
 Get value for search persistence. More...
 
 setSearchValueSerialized (ilADTSearchBridge $a_adt_search, $a_value)
 Set value from search persistence. More...
 
 searchSubObjects (ilADTSearchBridge $a_adt_search, $a_obj_id, $sub_obj_type)
 
 searchObjects (ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, $a_locate, $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 ($a_new_record_id)
 Clone field definition. More...
 

Protected Member Functions

 initADTDefinition ()
 
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 init ()
 Init properties. More...
 
 initADTDefinition ()
 Init adt instance. More...
 
 setADT (ilADT $a_adt)
 Set ADT instance. More...
 
 setFieldId ($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, $a_disabled=false)
 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 ($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 ($a_field_id, $a_type=null)
 Get definition instance by type. More...
 
static getInstanceByTypeString ($a_type)
 Get instance by type string (used by import) More...
 
static getInstancesByRecordId ($a_record_id, $a_only_searchable=false)
 Get definitions by record id. More...
 
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
 
static getInstanceByImportId ($a_import_id)
 Get definition instance by import id. More...
 
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 ($a_type)
 Is given type valid. More...
 
- 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_EXTERNAL_LINK = 9
 
const TYPE_INTERNAL_LINK = 10
 
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getTypeString ($a_type)
 Get type string. More...
 
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
 $field_id
 
 $record_id
 
 $import_id
 
 $position
 
 $title
 
 $description
 
 $searchable
 
 $required
 
 $adt_def
 
 $adt
 

Detailed Description

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 14 of file class.ilAdvancedMDFieldDefinitionDateTime.php.

Member Function Documentation

◆ getLuceneSearchString()

ilAdvancedMDFieldDefinitionDateTime::getLuceneSearchString (   $a_value)

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

References $end, IL_CAL_DATETIME, and IL_CAL_UNIX.

73  {
74  // see ilADTDateTimeSearchBridgeRange::importFromPost();
75 
76  if ($a_value["tgl"]) {
77  $start = mktime(
78  $a_value["lower"]["time"]["h"],
79  $a_value["lower"]["time"]["m"],
80  1,
81  $a_value["lower"]["date"]["m"],
82  $a_value["lower"]["date"]["d"],
83  $a_value["lower"]["date"]["y"]
84  );
85 
86  $end = mktime(
87  $a_value["upper"]["time"]["h"],
88  $a_value["upper"]["time"]["m"],
89  1,
90  $a_value["upper"]["date"]["m"],
91  $a_value["upper"]["date"]["d"],
92  $a_value["upper"]["date"]["y"]
93  );
94 
95  if ($start && $end && $start > $end) {
96  $tmp = $start;
97  $start = $end;
98  $end = $tmp;
99  }
100 
101  $start = new ilDateTime($start, IL_CAL_UNIX);
103 
104  return "{" . $start->get(IL_CAL_DATETIME) . " TO " . $end->get(IL_CAL_DATETIME) . "}";
105  }
106  }
const IL_CAL_DATETIME
$end
Definition: saml1-acs.php:18
const IL_CAL_UNIX
Date and time handling

◆ getType()

ilAdvancedMDFieldDefinitionDateTime::getType ( )

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

21  {
22  return self::TYPE_DATETIME;
23  }

◆ getValueForXML()

ilAdvancedMDFieldDefinitionDateTime::getValueForXML ( ilADT  $element)

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

References IL_CAL_DATETIME.

41  {
42  return $element->getDate()->get(IL_CAL_DATETIME);
43  }
const IL_CAL_DATETIME

◆ importFromECS()

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

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

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

51  {
52  switch ($a_ecs_type) {
54  if ($a_value instanceof ilECSTimePlace) {
55  $value = new ilDateTime($a_value->{'getUT' . ucfirst($a_sub_id)}(), IL_CAL_UNIX);
56  }
57  break;
58  }
59 
60  if ($value instanceof ilDateTime) {
61  $this->getADT()->setDate($value);
62  return true;
63  }
64  return false;
65  }
Representation of ECS EContent Time Place.
const IL_CAL_UNIX
const TYPE_TIMEPLACE
Date and time handling
+ Here is the call graph for this function:

◆ importValueFromXML()

ilAdvancedMDFieldDefinitionDateTime::importValueFromXML (   $a_cdata)

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

References ilAdvancedMDFieldDefinition\getADT(), and IL_CAL_DATETIME.

46  {
47  $this->getADT()->setDate(new ilDate($a_cdata, IL_CAL_DATETIME));
48  }
const IL_CAL_DATETIME
Class for single dates.
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionDateTime::initADTDefinition ( )
protected

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

References ilADTFactory\getInstance().

31  {
32  return ilADTFactory::getInstance()->getDefinitionInstanceByType("DateTime");
33  }
static getInstance()
Get singleton.
+ Here is the call graph for this function:

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