ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTTextActiveRecordBridge.php
Go to the documentation of this file.
1<?php
2
3require_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}
An exception for terminatinating execution or to throw for unit testing.
Class arField.
const FIELD_TYPE_TEXT
getActiveRecordFields()
Convert ADT to active record fields.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
getFieldValue($a_field_name)
Get field value.
setFieldValue($a_field_name, $a_field_value)
Set field value.
ADT base class.
Definition: class.ilADT.php:12
$def
Definition: croninfo.php:21