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

AMD field type integer. More...

+ Inheritance diagram for ilAdvancedMDFieldDefinitionInteger:
+ Collaboration diagram for ilAdvancedMDFieldDefinitionInteger:

Public Member Functions

 getType ()
 Get type.
 setMin ($a_value)
 Set min.
 getMin ()
 Get min.
 setMax ($a_value)
 Set max.
 getMax ()
 Get max.
 setSuffix ($a_value)
 Set suffix.
 getSuffix ()
 Get suffix.
 getFieldDefinitionForTableGUI ()
 Parse properties for table gui.
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, $a_disabled=false)
 Add input elements to definition form.
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form)
 Import custom post values from definition form.
 importXMLProperty ($a_key, $a_value)
 Import property from XML.
 getValueForXML (ilADT $element)
 Parse ADT value for xml (export)
 importValueFromXML ($a_cdata)
 Import value from xml.
- 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.
 addToFieldDefinitionForm (ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
 Add input elements to 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.
 importFromECS ($a_ecs_type, $a_value, $a_sub_id)
 Import meta data from ECS.
 prepareElementForEditor (ilADTFormBridge $a_bridge)
 Prepare editor form elements.
 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.
 getLuceneSearchString ($a_value)
 Get search string in lucene syntax.
 prepareElementForSearch (ilADTSearchBridge $a_bridge)
 Prepare search form elements.

Protected Member Functions

 initADTDefinition ()
 Init adt instance.
 importFieldDefinition (array $a_def)
 Import (type-specific) field definition from DB.
 getFieldDefinition ()
 Get (type-specific) field definition.
 addPropertiesToXML (ilXmlWriter $a_writer)
 Add (type-specific) properties to xml export.
- Protected Member Functions inherited from ilAdvancedMDFieldDefinition
 init ()
 Init properties.
 setADT (ilADT $a_adt)
 Set ADT instance.
 setFieldId ($a_id)
 Set field_id.
 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.
 parseSearchObjects (array $a_records, array $a_object_types)
 Add object-data needed for global search to AMD search results.

Protected Attributes

 $min
 $max
 $suffix
- Protected Attributes inherited from ilAdvancedMDFieldDefinition
 $field_id
 $record_id
 $import_id
 $position
 $title
 $description
 $searchable
 $required
 $adt_def
 $adt

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.

Detailed Description

AMD field type integer.

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

Member Function Documentation

ilAdvancedMDFieldDefinitionInteger::addCustomFieldToDefinitionForm ( ilPropertyFormGUI  $a_form,
  $a_disabled = false 
)

Add input elements to definition form.

Parameters
ilPropertyFormGUI$a_form
bool$a_disabled

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 171 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References $lng, $max, $min, $suffix, ilPropertyFormGUI\addItem(), getMax(), getMin(), and getSuffix().

{
global $lng;
$min = new ilNumberInputGUI($lng->txt("md_adv_number_min"), "min");
$min->setValue($this->getMin());
$min->setSize(10);
$a_form->addItem($min);
$max = new ilNumberInputGUI($lng->txt("md_adv_number_max"), "max");
$max->setValue($this->getMax());
$max->setSize(10);
$a_form->addItem($max);
$suffix = new ilTextInputGUI($lng->txt("md_adv_number_suffix"), "suffix");
$suffix->setValue($this->getSuffix());
$suffix->setSize(10);
$a_form->addItem($suffix);
if($a_disabled)
{
$min->setDisabled(true);
$max->setDisabled(true);
$suffix->setDisabled(true);
}
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

Add (type-specific) properties to xml export.

Parameters
ilXmlWriter$a_writer

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 220 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References getMax(), getMin(), getSuffix(), and ilXmlWriter\xmlElement().

{
$a_writer->xmlElement('FieldValue',array("id"=>"min"),$this->getMin());
$a_writer->xmlElement('FieldValue',array("id"=>"max"),$this->getMax());
$a_writer->xmlElement('FieldValue',array("id"=>"suffix"),$this->getSuffix());
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::getFieldDefinition ( )
protected

Get (type-specific) field definition.

Returns
array

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 134 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References getMax(), getMin(), and getSuffix().

{
return array(
"min" => $this->getMin(),
"max" => $this->getMax(),
"suffix" => $this->getSuffix()
);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::getFieldDefinitionForTableGUI ( )

Parse properties for table gui.

Returns
array

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 143 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References $lng, $res, getMax(), getMin(), and getSuffix().

{
global $lng;
$res = array();
if($this->getMin() !== null)
{
$res[$lng->txt("md_adv_number_min")] = $this->getMin();
}
if($this->getMax() !== null)
{
$res[$lng->txt("md_adv_number_max")] = $this->getMax();
}
if($this->getSuffix())
{
$res[$lng->txt("md_adv_number_suffix")] = $this->getSuffix();
}
return $res;
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::getMax ( )
ilAdvancedMDFieldDefinitionInteger::getMin ( )
ilAdvancedMDFieldDefinitionInteger::getSuffix ( )
ilAdvancedMDFieldDefinitionInteger::getType ( )

Get type.

Returns
int

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 24 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References ilAdvancedMDFieldDefinition\TYPE_INTEGER.

{
}
ilAdvancedMDFieldDefinitionInteger::getValueForXML ( ilADT  $element)

Parse ADT value for xml (export)

Parameters
ilADT$element
Returns
string

Reimplemented from ilAdvancedMDFieldDefinition.

Definition at line 243 of file class.ilAdvancedMDFieldDefinitionInteger.php.

{
return $element->getNumber();
}
ilAdvancedMDFieldDefinitionInteger::importCustomDefinitionFormPostValues ( ilPropertyFormGUI  $a_form)

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 203 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References $max, $min, $suffix, ilPropertyFormGUI\getInput(), setMax(), setMin(), and setSuffix().

{
$min = $a_form->getInput("min");
$this->setMin(($min !== "") ? $min : null);
$max = $a_form->getInput("max");
$this->setMax(($max !== "") ? $max : null);
$suffix = $a_form->getInput("suffix");
$this->setSuffix(($suffix !== "") ? $suffix : null);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::importFieldDefinition ( array  $a_def)
protected

Import (type-specific) field definition from DB.

Parameters
array$a_def

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 127 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References setMax(), setMin(), and setSuffix().

{
$this->setMin($a_def["min"]);
$this->setMax($a_def["max"]);
$this->setSuffix($a_def["suffix"]);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::importValueFromXML (   $a_cdata)

Import value from xml.

Parameters
string$a_cdata

Reimplemented from ilAdvancedMDFieldDefinition.

Definition at line 248 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References ilAdvancedMDFieldDefinition\getADT().

{
$this->getADT()->setNumber($a_cdata);
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::importXMLProperty (   $a_key,
  $a_value 
)

Import property from XML.

Parameters
string$a_key
string$a_value

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

Definition at line 227 of file class.ilAdvancedMDFieldDefinitionInteger.php.

References setMax(), setMin(), and setSuffix().

{
if($a_key == "min")
{
$this->setMin($a_value != "" ? $a_value : null);
}
if($a_key == "max")
{
$this->setMax($a_value != "" ? $a_value : null);
}
if($a_key == "suffix")
{
$this->setSuffix($a_value != "" ? $a_value : null);
}
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::initADTDefinition ( )
protected

Init adt instance.

Returns
ilADTDefinition

Reimplemented from ilAdvancedMDFieldDefinition.

Reimplemented in ilAdvancedMDFieldDefinitionFloat.

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

References ilAdvancedMDFieldDefinition\getInstance(), getMax(), getMin(), and getSuffix().

{
$def = ilADTFactory::getInstance()->getDefinitionInstanceByType("Integer");
$def->setMin($this->getMin());
$def->setMax($this->getMax());
$def->setSuffix($this->getSuffix());
return $def;
}

+ Here is the call graph for this function:

ilAdvancedMDFieldDefinitionInteger::setMax (   $a_value)

Set max.

Parameters
int$a_value

Definition at line 79 of file class.ilAdvancedMDFieldDefinitionInteger.php.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

{
if($a_value !== null)
{
$a_value = (int)$a_value;
}
$this->max = $a_value;
}

+ Here is the caller graph for this function:

ilAdvancedMDFieldDefinitionInteger::setMin (   $a_value)

Set min.

Parameters
int$a_value

Definition at line 55 of file class.ilAdvancedMDFieldDefinitionInteger.php.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

{
if($a_value !== null)
{
$a_value = (int)$a_value;
}
$this->min = $a_value;
}

+ Here is the caller graph for this function:

ilAdvancedMDFieldDefinitionInteger::setSuffix (   $a_value)

Set suffix.

Parameters
string$a_value

Definition at line 103 of file class.ilAdvancedMDFieldDefinitionInteger.php.

Referenced by importCustomDefinitionFormPostValues(), importFieldDefinition(), and importXMLProperty().

{
if($a_value !== null)
{
$a_value = trim($a_value);
}
$this->suffix = $a_value;
}

+ Here is the caller graph for this function:

Field Documentation

ilAdvancedMDFieldDefinitionInteger::$max
protected
ilAdvancedMDFieldDefinitionInteger::$min
protected
ilAdvancedMDFieldDefinitionInteger::$suffix
protected

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