ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  $field->setLength($max);
29  }
30 
31  return array($field);
32  }
33 
34  public function getFieldValue($a_field_name)
35  {
36  return $this->getADT()->getText();
37  }
38 
39  public function setFieldValue($a_field_name, $a_field_value)
40  {
41  return $this->getADT()->setText($a_field_value);
42  }
43 }
Class arField.
const FIELD_TYPE_TEXT
ADT base class.
Definition: class.ilADT.php:11
setFieldValue($a_field_name, $a_field_value)
$def
Definition: croninfo.php:21