ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 99 of file class.arField.php.

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

100  {
101  $return = array();
102  foreach (arFieldList::getAllowedConnectorFields() as $field_name) {
103  if (isset($this->{$field_name}) && $this->{$field_name} and self::isAllowedAttribute($this->getFieldType(), $field_name)) {
104  $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
105  }
106  }
107 
108  return $return;
109  }
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 115 of file class.arField.php.

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

116  {
117  $return = array();
118  foreach (arFieldList::getAllowedDescriptionFields() as $field_name) {
119  if ($this->{$field_name} and self::isAllowedAttribute($this->getFieldType(), $field_name)) {
120  $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
121  }
122  }
123 
124  return $return;
125  }
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 187 of file class.arField.php.

References $fieldtype.

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

188  {
189  return $this->fieldtype;
190  }
+ Here is the caller graph for this function:

◆ getHasField()

arField::getHasField ( )
Returns
boolean

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

References $has_field.

206  {
207  return $this->has_field;
208  }

◆ getIndex()

arField::getIndex ( )
Returns
boolean

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

References $index.

332  {
333  return $this->index;
334  }

◆ getLength()

arField::getLength ( )
Returns
int

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

References $length.

224  {
225  return $this->length;
226  }

◆ getName()

◆ getNotNull()

arField::getNotNull ( )
Returns
boolean

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

References $not_null.

Referenced by arEditGUI\addFormField().

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

◆ getPrimary()

arField::getPrimary ( )
Returns
boolean

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

References $is_primary.

Referenced by arEditGUI\afterValidation().

278  {
279  return $this->is_primary;
280  }
+ Here is the caller graph for this function:

◆ getSequence()

arField::getSequence ( )
Returns
boolean

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

References $sequence.

314  {
315  return $this->sequence;
316  }

◆ getUnique()

arField::getUnique ( )
Returns
boolean

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

References $unique.

296  {
297  return $this->unique;
298  }

◆ isAllowedAttribute()

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

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

References $type, arFieldList\FIELDTYPE, and arFieldList\HAS_FIELD.

344  {
345  if ($field_name == arFieldList::FIELDTYPE or $field_name == arFieldList::HAS_FIELD) {
346  return true;
347  }
348 
349  return in_array($field_name, self::$allowed_attributes[$type]);
350  }
$type

◆ isDateField()

arField::isDateField ( )
Returns
bool

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

References getFieldType().

132  {
133  return self::isDateFieldType($this->getFieldType());
134  }
+ Here is the call graph for this function:

◆ isDateFieldType()

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

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

359  {
360  return in_array($field_type, self::$date_fields);
361  }

◆ loadFromArray()

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

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

References $key, $name, and setName().

Referenced by loadFromStdClass().

67  {
68  $this->setName($name);
69  foreach ($array as $key => $value) {
70  switch ($value) {
71  case 'true':
72  $this->{$key} = true;
73  break;
74  case 'false':
75  $this->{$key} = false;
76  break;
77  default:
78  $this->{$key} = $value;
79  break;
80  }
81  }
82  }
setName($name)
$key
Definition: croninfo.php:18
+ 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 89 of file class.arField.php.

References $name, array, and loadFromArray().

90  {
91  $array = (array) $stdClass;
92  $this->loadFromArray($name, $array);
93  }
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 178 of file class.arField.php.

179  {
180  $this->fieldtype = $field_type;
181  }

◆ setHasField()

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

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

References $has_field.

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

◆ setIndex()

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

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

References $index.

323  {
324  $this->index = $index;
325  }

◆ setLength()

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

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

References $length.

215  {
216  $this->length = $length;
217  }

◆ setName()

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

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

References $name.

Referenced by loadFromArray().

233  {
234  $this->name = $name;
235  }
+ Here is the caller graph for this function:

◆ setNotNull()

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

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

References $not_null.

251  {
252  $this->not_null = $not_null;
253  }

◆ setPrimary()

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

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

269  {
270  $this->is_primary = $primary;
271  }

◆ setSequence()

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

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

References $sequence.

305  {
306  $this->sequence = $sequence;
307  }

◆ setUnique()

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

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

References $unique.

287  {
288  $this->unique = $unique;
289  }

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 140 of file class.arField.php.

Referenced by getFieldType().

◆ $has_field

arField::$has_field = false
protected

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

Referenced by getHasField(), and setHasField().

◆ $index

arField::$index = false
protected

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

Referenced by getIndex(), and setIndex().

◆ $is_primary

arField::$is_primary = false
protected

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

Referenced by getPrimary().

◆ $length

arField::$length = null
protected

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

Referenced by getLength(), and setLength().

◆ $name

◆ $not_null

arField::$not_null = false
protected

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

Referenced by getNotNull(), and setNotNull().

◆ $sequence

arField::$sequence = false
protected

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

Referenced by getSequence(), and setSequence().

◆ $unique

arField::$unique = false
protected

Definition at line 160 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: