ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMDFieldDefinitionDate Class Reference

AMD field type date. More...

+ Inheritance diagram for ilAdvancedMDFieldDefinitionDate:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionDate:

Public Member Functions

 getType ()
 Get type.
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export)
 importValueFromXML ($a_cdata)
 Import value from xml.
 importFromECS ($a_ecs_type, $a_value, $a_sub_id)
 Import meta data from ECS.
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 Prepare editor form elements.
 getLuceneSearchString ($a_value)
 Get search string in lucene syntax.
 prepareElementForSearch (ilADTSearchBridge $a_bridge)
 Prepare search form elements.
- Public Member Functions inherited from ilAdvancedMDFieldDefinition
 __construct ($a_field_id=null)
 Constructor.
 getTypeTitle ()
 Get type title (lang id)
 getADTDefinition ()
 Get ADT definition instance.
 getADT ()
 Get ADT instance.
 getFieldId ()
 Get field_id.
 setRecordId ($a_id)
 Set record id.
 getRecordId ()
 Get record id.
 setImportId ($a_id_string)
 Set import id.
 getImportId ()
 Get import id.
 setPosition ($a_pos)
 Set position.
 getPosition ()
 Get position.
 setTitle ($a_title)
 Get title.
 getTitle ()
 Get title.
 setDescription ($a_desc)
 Set description.
 getDescription ()
 Get description.
 setSearchable ($a_status)
 Toggle searchable.
 isSearchable ()
 Is searchable.
 setRequired ($a_status)
 Toggle required.
 isRequired ()
 Is required field.
 getFieldDefinitionForTableGUI ()
 Parse properties for table gui.
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Add input elements to definition form.
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form)
 Import custom post values from definition form.
 importDefinitionFormPostValues (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Import post values from definition form.
 importDefinitionFormPostValuesNeedsConfirmation ()
 prepareCustomDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 prepareDefinitionFormConfirmation (ilPropertyFormGUI $a_form)
 save ()
 Create new field entry.
 update ()
 Update field entry.
 delete ()
 Delete field entry.
 toXML (ilXmlWriter $a_writer)
 To Xml.
 importXMLProperty ($a_key, $a_value)
 Import property from XML.
 getSearchQueryParserValue (ilADTSearchBridge $a_adt_search)
 Get value for search query parser.
 getSearchValueSerialized (ilADTSearchBridge $a_adt_search)
 Get value for search persistence.
 setSearchValueSerialized (ilADTSearchBridge $a_adt_search, $a_value)
 Set value from search persistence.
 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.

Protected Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilAdvancedMDFieldDefinition
static getInstance ($a_field_id, $a_type=null)
 Get definition instance by type.
static getInstanceByTypeString ($a_type)
 Get instance by type string (used by import)
static getInstancesByRecordId ($a_record_id, $a_only_searchable=false)
 Get definitions by record id.
static getInstancesByObjType ($a_obj_type, $a_active_only=true)
static getInstanceByImportId ($a_import_id)
 Get definition instance by import id.
static getSearchableDefinitionIds ()
 Get searchable definition ids (performance is key)
static getADTGroupForDefinitions (array $a_defs)
 Init ADTGroup for definitions.
static getValidTypes ()
 Get all valid types.
static isValidType ($a_type)
 Is given type valid.
- 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
- Static Protected Member Functions inherited from ilAdvancedMDFieldDefinition
static getTypeString ($a_type)
 Get type string.
- 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.

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.ilAdvancedMDFieldDefinitionDate.php.

Member Function Documentation

ilAdvancedMDFieldDefinitionDate::getLuceneSearchString (   $a_value)

Get search string in lucene syntax.

Parameters
mixed$a_value
Returns
string

Reimplemented from ilAdvancedMDFieldDefinition.

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

References IL_CAL_DATE, and IL_CAL_UNIX.

{
// see ilADTDateSearchBridgeRange::importFromPost();
if($a_value["tgl"])
{
$start = $end = null;
if($a_value["lower"]["date"])
{
$start = mktime(12, 0, 0,
$a_value["lower"]["date"]["m"],
$a_value["lower"]["date"]["d"],
$a_value["lower"]["date"]["y"]);
}
if($a_value["upper"]["date"])
{
$end = mktime(12, 0, 0,
$a_value["upper"]["date"]["m"],
$a_value["upper"]["date"]["d"],
$a_value["upper"]["date"]["y"]);
}
if($start && $end && $start > $end)
{
$tmp = $start;
$start = $end;
$end = $tmp;
}
$start = new ilDate($start, IL_CAL_UNIX);
$end = new ilDate($end, IL_CAL_UNIX);
return "{".$start->get(IL_CAL_DATE)." TO ".$end->get(IL_CAL_DATE)."}";
}
}
ilAdvancedMDFieldDefinitionDate::getType ( )

Get type.

Returns
int

Reimplemented from ilAdvancedMDFieldDefinition.

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

References ilAdvancedMDFieldDefinition\TYPE_DATE.

{
}
ilAdvancedMDFieldDefinitionDate::getValueForXML ( ilADT  $element)

Parse ADT value for xml (export)

Parameters
ilADT$element
Returns
string

Reimplemented from ilAdvancedMDFieldDefinition.

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

References IL_CAL_DATE.

{
return $element->getDate()->get(IL_CAL_DATE);
}
ilAdvancedMDFieldDefinitionDate::importFromECS (   $a_ecs_type,
  $a_value,
  $a_sub_id 
)

Import meta data from ECS.

Parameters
int$a_ecs_type
mixed$a_value
string$a_sub_id
Returns
bool

Reimplemented from ilAdvancedMDFieldDefinition.

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

References IL_CAL_UNIX, and ilECSUtils\TYPE_TIMEPLACE.

{
switch($a_ecs_type)
{
if($a_value instanceof ilECSTimePlace)
{
$value = new ilDate($a_value->{'getUT'.ucfirst($a_sub_id)}(), IL_CAL_UNIX);
}
break;
}
if($value instanceof ilDate)
{
$this->getADT()->setDate($value);
return true;
}
return false;
}
ilAdvancedMDFieldDefinitionDate::importValueFromXML (   $a_cdata)

Import value from xml.

Parameters
string$a_cdata

Reimplemented from ilAdvancedMDFieldDefinition.

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

References ilAdvancedMDFieldDefinition\getADT(), and IL_CAL_DATE.

{
$this->getADT()->setDate(new ilDate($a_cdata, IL_CAL_DATE));
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionDate::initADTDefinition ( )
protected

Init adt instance.

Returns
ilADTDefinition

Reimplemented from ilAdvancedMDFieldDefinition.

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

References ilAdvancedMDFieldDefinition\getInstance().

{
return ilADTFactory::getInstance()->getDefinitionInstanceByType("Date");
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionDate::prepareElementForEditor ( ilADTFormBridge  $a_bridge)

Prepare editor form elements.

Parameters
ilADTFormBridge$a_bridge

Reimplemented from ilAdvancedMDFieldDefinition.

Definition at line 75 of file class.ilAdvancedMDFieldDefinitionDate.php.

{
$a_bridge->setTextInputMode(true);
}
ilAdvancedMDFieldDefinitionDate::prepareElementForSearch ( ilADTSearchBridge  $a_bridge)

Prepare search form elements.

Parameters
ilADTSearchBridge$a_bridge

Reimplemented from ilAdvancedMDFieldDefinition.

Definition at line 122 of file class.ilAdvancedMDFieldDefinitionDate.php.

{
$a_bridge->setTextInputMode(true);
}

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