ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
arField Class Reference

Class arField. More...

+ Inheritance diagram for arField:
+ Collaboration diagram for arField:

Public Member Functions

 loadFromArray ($name, array $array)
 
 loadFromStdClass ($name, stdClass $stdClass)
 
 getAttributesForConnector ()
 
 getAttributesForDescription ()
 
 isDateField ()
 
 setFieldType ($field_type)
 
 getFieldType ()
 
 setHasField ($has_field)
 
 getHasField ()
 
 setLength ($length)
 
 getLength ()
 
 setName ($name)
 
 getName ()
 
 setNotNull ($not_null)
 
 getNotNull ()
 
 setPrimary ($primary)
 
 getPrimary ()
 
 setUnique ($unique)
 
 getUnique ()
 
 setSequence ($sequence)
 
 getSequence ()
 
 setIndex ($index)
 
 getIndex ()
 

Static Public Member Functions

static isAllowedAttribute ($type, $field_name)
 
static isDateFieldType ($field_type)
 

Data Fields

const FIELD_TYPE_TEXT = 'text'
 
const FIELD_TYPE_INTEGER = 'integer'
 
const FIELD_TYPE_FLOAT = 'float'
 
const FIELD_TYPE_DATE = 'date'
 
const FIELD_TYPE_TIME = 'time'
 
const FIELD_TYPE_TIMESTAMP = 'timestamp'
 
const FIELD_TYPE_CLOB = 'clob'
 

Protected Attributes

 $fieldtype
 
 $length = NULL
 
 $is_primary = false
 
 $name = ''
 
 $not_null = false
 
 $unique = false
 
 $has_field = false
 
 $sequence = false
 
 $index = false
 

Static Protected Attributes

static $allowed_attributes
 
static $date_fields
 

Detailed Description

Class arField.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
2.0.7

Definition at line 10 of file class.arField.php.

Member Function Documentation

◆ getAttributesForConnector()

arField::getAttributesForConnector ( )
Returns
array

Definition at line 97 of file class.arField.php.

References array, arFieldList\getAllowedConnectorFields(), getFieldType(), and arFieldList\mapKey().

97  {
98  $return = array();
99  foreach (arFieldList::getAllowedConnectorFields() as $field_name) {
100  if (isset($this->{$field_name}) && $this->{$field_name} AND self::isAllowedAttribute($this->getFieldType(), $field_name)) {
101  $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
102  }
103  }
104 
105  return $return;
106  }
static mapKey($key)
static getAllowedConnectorFields()
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getAttributesForDescription()

arField::getAttributesForDescription ( )
Returns
array

Definition at line 112 of file class.arField.php.

References array, arFieldList\getAllowedDescriptionFields(), getFieldType(), and arFieldList\mapKey().

112  {
113  $return = array();
114  foreach (arFieldList::getAllowedDescriptionFields() as $field_name) {
115  if ($this->{$field_name} AND self::isAllowedAttribute($this->getFieldType(), $field_name)) {
116  $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
117  }
118  }
119 
120  return $return;
121  }
static mapKey($key)
Create styles array
The data for the language used.
static getAllowedDescriptionFields()
+ Here is the call graph for this function:

◆ getFieldType()

arField::getFieldType ( )
Returns
mixed

Definition at line 181 of file class.arField.php.

References $fieldtype.

Referenced by arIndexTableGUI\addFilterField(), arEditGUI\addFormField(), getAttributesForConnector(), getAttributesForDescription(), isDateField(), arDisplayGUI\setArFieldData(), and arIndexTableGUI\setArFieldData().

181  {
182  return $this->fieldtype;
183  }
+ Here is the caller graph for this function:

◆ getHasField()

arField::getHasField ( )
Returns
boolean

Definition at line 197 of file class.arField.php.

References $has_field.

197  {
198  return $this->has_field;
199  }

◆ getIndex()

arField::getIndex ( )
Returns
boolean

Definition at line 309 of file class.arField.php.

References $index.

309  {
310  return $this->index;
311  }

◆ getLength()

arField::getLength ( )
Returns
int

Definition at line 213 of file class.arField.php.

References $length.

213  {
214  return $this->length;
215  }

◆ getName()

◆ getNotNull()

arField::getNotNull ( )
Returns
boolean

Definition at line 245 of file class.arField.php.

References $not_null.

Referenced by arEditGUI\addFormField().

245  {
246  return $this->not_null;
247  }
+ Here is the caller graph for this function:

◆ getPrimary()

arField::getPrimary ( )
Returns
boolean

Definition at line 261 of file class.arField.php.

References $is_primary.

Referenced by arEditGUI\afterValidation().

261  {
262  return $this->is_primary;
263  }
+ Here is the caller graph for this function:

◆ getSequence()

arField::getSequence ( )
Returns
boolean

Definition at line 293 of file class.arField.php.

References $sequence.

293  {
294  return $this->sequence;
295  }

◆ getUnique()

arField::getUnique ( )
Returns
boolean

Definition at line 277 of file class.arField.php.

References $unique.

277  {
278  return $this->unique;
279  }

◆ isAllowedAttribute()

static arField::isAllowedAttribute (   $type,
  $field_name 
)
static
Parameters
$type
$field_name
Returns
bool

Definition at line 320 of file class.arField.php.

References arFieldList\FIELDTYPE, and arFieldList\HAS_FIELD.

320  {
321  if ($field_name == arFieldList::FIELDTYPE OR $field_name == arFieldList::HAS_FIELD) {
322  return true;
323  }
324 
325  return in_array($field_name, self::$allowed_attributes[$type]);
326  }

◆ isDateField()

arField::isDateField ( )
Returns
bool

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

References getFieldType().

127  {
128  return self::isDateFieldType($this->getFieldType());
129  }
+ Here is the call graph for this function:

◆ isDateFieldType()

static arField::isDateFieldType (   $field_type)
static
Parameters
$field_type
Returns
bool

Definition at line 334 of file class.arField.php.

334  {
335  return in_array($field_type, self::$date_fields);
336  }

◆ loadFromArray()

arField::loadFromArray (   $name,
array  $array 
)
Parameters
$name
array$array

Definition at line 66 of file class.arField.php.

References $name, and setName().

Referenced by loadFromStdClass().

66  {
67  $this->setName($name);
68  foreach ($array as $key => $value) {
69  switch ($value) {
70  case 'true':
71  $this->{$key} = true;
72  break;
73  case 'false':
74  $this->{$key} = false;
75  break;
76  default:
77  $this->{$key} = $value;
78  break;
79  }
80  }
81  }
setName($name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromStdClass()

arField::loadFromStdClass (   $name,
stdClass  $stdClass 
)
Parameters
$name
stdClass$stdClass

Definition at line 88 of file class.arField.php.

References $name, array, and loadFromArray().

88  {
89  $array = (array)$stdClass;
90  $this->loadFromArray($name, $array);
91  }
loadFromArray($name, array $array)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ setFieldType()

arField::setFieldType (   $field_type)
Parameters
mixed$field_type

Definition at line 173 of file class.arField.php.

173  {
174  $this->fieldtype = $field_type;
175  }

◆ setHasField()

arField::setHasField (   $has_field)
Parameters
boolean$has_field

Definition at line 189 of file class.arField.php.

References $has_field.

189  {
190  $this->has_field = $has_field;
191  }

◆ setIndex()

arField::setIndex (   $index)
Parameters
boolean$index

Definition at line 301 of file class.arField.php.

References $index.

301  {
302  $this->index = $index;
303  }

◆ setLength()

arField::setLength (   $length)
Parameters
int$length

Definition at line 205 of file class.arField.php.

References $length.

205  {
206  $this->length = $length;
207  }

◆ setName()

arField::setName (   $name)
Parameters
string$name

Definition at line 221 of file class.arField.php.

References $name.

Referenced by loadFromArray().

221  {
222  $this->name = $name;
223  }
+ Here is the caller graph for this function:

◆ setNotNull()

arField::setNotNull (   $not_null)
Parameters
boolean$not_null

Definition at line 237 of file class.arField.php.

References $not_null.

237  {
238  $this->not_null = $not_null;
239  }

◆ setPrimary()

arField::setPrimary (   $primary)
Parameters
boolean$primary

Definition at line 253 of file class.arField.php.

253  {
254  $this->is_primary = $primary;
255  }

◆ setSequence()

arField::setSequence (   $sequence)
Parameters
boolean$sequence

Definition at line 285 of file class.arField.php.

References $sequence.

285  {
286  $this->sequence = $sequence;
287  }

◆ setUnique()

arField::setUnique (   $unique)
Parameters
boolean$unique

Definition at line 269 of file class.arField.php.

References $unique.

269  {
270  $this->unique = $unique;
271  }

Field Documentation

◆ $allowed_attributes

arField::$allowed_attributes
staticprotected
Initial value:

Definition at line 22 of file class.arField.php.

Referenced by arViewField\setAllowedAttributes().

◆ $date_fields

arField::$date_fields
staticprotected
Initial value:
self::FIELD_TYPE_DATE,
self::FIELD_TYPE_TIME,
self::FIELD_TYPE_TIMESTAMP
)

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

◆ $fieldtype

arField::$fieldtype
protected

Definition at line 135 of file class.arField.php.

Referenced by getFieldType().

◆ $has_field

arField::$has_field = false
protected

Definition at line 159 of file class.arField.php.

Referenced by getHasField(), and setHasField().

◆ $index

arField::$index = false
protected

Definition at line 167 of file class.arField.php.

Referenced by getIndex(), and setIndex().

◆ $is_primary

arField::$is_primary = false
protected

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

Referenced by getPrimary().

◆ $length

arField::$length = NULL
protected

Definition at line 139 of file class.arField.php.

Referenced by getLength(), and setLength().

◆ $name

◆ $not_null

arField::$not_null = false
protected

Definition at line 151 of file class.arField.php.

Referenced by getNotNull(), and setNotNull().

◆ $sequence

arField::$sequence = false
protected

Definition at line 163 of file class.arField.php.

Referenced by getSequence(), and setSequence().

◆ $unique

arField::$unique = false
protected

Definition at line 155 of file class.arField.php.

Referenced by getUnique(), and setUnique().

◆ FIELD_TYPE_CLOB

const arField::FIELD_TYPE_CLOB = 'clob'

Definition at line 18 of file class.arField.php.

◆ FIELD_TYPE_DATE

const arField::FIELD_TYPE_DATE = 'date'

◆ FIELD_TYPE_FLOAT

const arField::FIELD_TYPE_FLOAT = 'float'

◆ FIELD_TYPE_INTEGER

const arField::FIELD_TYPE_INTEGER = 'integer'

◆ FIELD_TYPE_TEXT

const arField::FIELD_TYPE_TEXT = 'text'

◆ FIELD_TYPE_TIME

const arField::FIELD_TYPE_TIME = 'time'

Definition at line 16 of file class.arField.php.

◆ FIELD_TYPE_TIMESTAMP

const arField::FIELD_TYPE_TIMESTAMP = 'timestamp'

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