ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilADTTextActiveRecordBridge.php
Go to the documentation of this file.
1 <?php
2 
3 require_once "Services/ADT/classes/Bridges/class.ilADTActiveRecordBridge.php";
4 
6 {
7  protected function isValidADT(ilADT $a_adt)
8  {
9  return ($a_adt instanceof ilADTText);
10  }
11 
12  //
13  // active record
14  //
15 
16  public function getActiveRecordFields()
17  {
18  $def = $this->getADT()->getCopyOfDefinition();
19 
20  $field = new arField();
21  $field->setHasField(true);
22  $field->setNotNull(!$def->isNullAllowed());
23  $field->setFieldType(arField::FIELD_TYPE_TEXT);
24  $field->setName($this->getElementId());
25 
26  $max = $def->getMaxLength();
27  if($max !== null)
28  {
29  $field->setLength($max);
30  }
31 
32  return array($field);
33  }
34 
35  public function getFieldValue($a_field_name)
36  {
37  return $this->getADT()->getText();
38  }
39 
40  public function setFieldValue($a_field_name, $a_field_value)
41  {
42  return $this->getADT()->setText($a_field_value);
43  }
44 }
Class arField.
const FIELD_TYPE_TEXT
ADT base class.
Definition: class.ilADT.php:11
setFieldValue($a_field_name, $a_field_value)
Create styles array
The data for the language used.