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

AMD field type integer. More...

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

Public Member Functions

 getType ()
 
 isFilterSupported ()
 
 setMin ($a_value)
 Set min. More...
 
 getMin ()
 Get min. More...
 
 setMax ($a_value)
 Set max. More...
 
 getMax ()
 Get max. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 getFieldDefinitionForTableGUI ()
 
 addCustomFieldToDefinitionForm (ilPropertyFormGUI $a_form, $a_disabled=false)
 Add input elements to definition form. More...
 
 importCustomDefinitionFormPostValues (ilPropertyFormGUI $a_form)
 Import custom post values from definition form. More...
 
 importXMLProperty ($a_key, $a_value)
 
 getValueForXML (ilADT $element)
 
 importValueFromXML ($a_cdata)
 
- 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 ()
 
 importFieldDefinition (array $a_def)
 
 getFieldDefinition ()
 
 addPropertiesToXML (ilXmlWriter $a_writer)
 
- 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...
 

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

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

◆ addCustomFieldToDefinitionForm()

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

Add input elements to definition form.

Parameters
ilPropertyFormGUI$a_form
bool$a_disabled

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

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

171  {
172  global $lng;
173 
174  $min = new ilNumberInputGUI($lng->txt("md_adv_number_min"), "min");
175  $min->setValue($this->getMin());
176  $min->setSize(10);
177  $a_form->addItem($min);
178 
179  $max = new ilNumberInputGUI($lng->txt("md_adv_number_max"), "max");
180  $max->setValue($this->getMax());
181  $max->setSize(10);
182  $a_form->addItem($max);
183 
184  $suffix = new ilTextInputGUI($lng->txt("md_adv_number_suffix"), "suffix");
185  $suffix->setValue($this->getSuffix());
186  $suffix->setSize(10);
187  $a_form->addItem($suffix);
188 
189  if ($a_disabled) {
190  $min->setDisabled(true);
191  $max->setDisabled(true);
192  $suffix->setDisabled(true);
193  }
194  }
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a number property in a property form.
This class represents a text property in a property form.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ addPropertiesToXML()

ilAdvancedMDFieldDefinitionInteger::addPropertiesToXML ( ilXmlWriter  $a_writer)
protected

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

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

219  {
220  $a_writer->xmlElement('FieldValue', array("id"=>"min"), $this->getMin());
221  $a_writer->xmlElement('FieldValue', array("id"=>"max"), $this->getMax());
222  $a_writer->xmlElement('FieldValue', array("id"=>"suffix"), $this->getSuffix());
223  }
Create styles array
The data for the language used.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ getFieldDefinition()

ilAdvancedMDFieldDefinitionInteger::getFieldDefinition ( )
protected

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

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

137  {
138  return array(
139  "min" => $this->getMin(),
140  "max" => $this->getMax(),
141  "suffix" => $this->getSuffix()
142  );
143  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getFieldDefinitionForTableGUI()

ilAdvancedMDFieldDefinitionInteger::getFieldDefinitionForTableGUI ( )

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

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

146  {
147  global $lng;
148 
149  $res = array();
150 
151  if ($this->getMin() !== null) {
152  $res[$lng->txt("md_adv_number_min")] = $this->getMin();
153  }
154  if ($this->getMax() !== null) {
155  $res[$lng->txt("md_adv_number_max")] = $this->getMax();
156  }
157  if ($this->getSuffix()) {
158  $res[$lng->txt("md_adv_number_suffix")] = $this->getSuffix();
159  }
160 
161  return $res;
162  }
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ getMax()

ilAdvancedMDFieldDefinitionInteger::getMax ( )

◆ getMin()

ilAdvancedMDFieldDefinitionInteger::getMin ( )

◆ getSuffix()

ilAdvancedMDFieldDefinitionInteger::getSuffix ( )

◆ getType()

ilAdvancedMDFieldDefinitionInteger::getType ( )

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

25  {
26  return self::TYPE_INTEGER;
27  }

◆ getValueForXML()

ilAdvancedMDFieldDefinitionInteger::getValueForXML ( ilADT  $element)

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

239  {
240  return $element->getNumber();
241  }

◆ importCustomDefinitionFormPostValues()

ilAdvancedMDFieldDefinitionInteger::importCustomDefinitionFormPostValues ( ilPropertyFormGUI  $a_form)

Import custom post values from definition form.

Parameters
ilPropertyFormGUI$a_form

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

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

202  {
203  $min = $a_form->getInput("min");
204  $this->setMin(($min !== "") ? $min : null);
205 
206  $max = $a_form->getInput("max");
207  $this->setMax(($max !== "") ? $max : null);
208 
209  $suffix = $a_form->getInput("suffix");
210  $this->setSuffix(($suffix !== "") ? $suffix : null);
211  }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ importFieldDefinition()

ilAdvancedMDFieldDefinitionInteger::importFieldDefinition ( array  $a_def)
protected

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

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

130  {
131  $this->setMin($a_def["min"]);
132  $this->setMax($a_def["max"]);
133  $this->setSuffix($a_def["suffix"]);
134  }
+ Here is the call graph for this function:

◆ importValueFromXML()

ilAdvancedMDFieldDefinitionInteger::importValueFromXML (   $a_cdata)

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

References ilAdvancedMDFieldDefinition\getADT().

244  {
245  $this->getADT()->setNumber($a_cdata);
246  }
+ Here is the call graph for this function:

◆ importXMLProperty()

ilAdvancedMDFieldDefinitionInteger::importXMLProperty (   $a_key,
  $a_value 
)

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

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

226  {
227  if ($a_key == "min") {
228  $this->setMin($a_value != "" ? $a_value : null);
229  }
230  if ($a_key == "max") {
231  $this->setMax($a_value != "" ? $a_value : null);
232  }
233  if ($a_key == "suffix") {
234  $this->setSuffix($a_value != "" ? $a_value : null);
235  }
236  }
+ Here is the call graph for this function:

◆ initADTDefinition()

ilAdvancedMDFieldDefinitionInteger::initADTDefinition ( )
protected

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

References $def, ilADTFactory\getInstance(), getMax(), getMin(), and getSuffix().

40  {
41  $def = ilADTFactory::getInstance()->getDefinitionInstanceByType("Integer");
42 
43  $def->setMin($this->getMin());
44  $def->setMax($this->getMax());
45  $def->setSuffix($this->getSuffix());
46 
47  return $def;
48  }
static getInstance()
Get singleton.
$def
Definition: croninfo.php:21
+ Here is the call graph for this function:

◆ isFilterSupported()

ilAdvancedMDFieldDefinitionInteger::isFilterSupported ( )

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

30  {
31  return false;
32  }

◆ setMax()

ilAdvancedMDFieldDefinitionInteger::setMax (   $a_value)

Set max.

Parameters
int$a_value

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

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

84  {
85  if ($a_value !== null) {
86  $a_value = (int) $a_value;
87  }
88  $this->max = $a_value;
89  }
+ Here is the caller graph for this function:

◆ setMin()

ilAdvancedMDFieldDefinitionInteger::setMin (   $a_value)

Set min.

Parameters
int$a_value

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

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

61  {
62  if ($a_value !== null) {
63  $a_value = (int) $a_value;
64  }
65  $this->min = $a_value;
66  }
+ Here is the caller graph for this function:

◆ setSuffix()

ilAdvancedMDFieldDefinitionInteger::setSuffix (   $a_value)

Set suffix.

Parameters
string$a_value

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

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

107  {
108  if ($a_value !== null) {
109  $a_value = trim($a_value);
110  }
111  $this->suffix = $a_value;
112  }
+ Here is the caller graph for this function:

Field Documentation

◆ $max

ilAdvancedMDFieldDefinitionInteger::$max
protected

◆ $min

ilAdvancedMDFieldDefinitionInteger::$min
protected

◆ $suffix

ilAdvancedMDFieldDefinitionInteger::$suffix
protected

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