ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 
 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
 
 $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.

98 {
99 $return = array();
100 foreach (arFieldList::getAllowedConnectorFields() as $field_name) {
101 if (isset($this->{$field_name}) && $this->{$field_name} and self::isAllowedAttribute($this->getFieldType(), $field_name)) {
102 $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
103 }
104 }
105
106 return $return;
107 }
static mapKey($key)
static getAllowedConnectorFields()
static isAllowedAttribute($type, $field_name)

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

+ Here is the call graph for this function:

◆ getAttributesForDescription()

arField::getAttributesForDescription ( )
Returns
array

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

114 {
115 $return = array();
116 foreach (arFieldList::getAllowedDescriptionFields() as $field_name) {
117 if ($this->{$field_name} and self::isAllowedAttribute($this->getFieldType(), $field_name)) {
118 $return[arFieldList::mapKey($field_name)] = $this->{$field_name};
119 }
120 }
121
122 return $return;
123 }
static getAllowedDescriptionFields()

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

+ Here is the call graph for this function:

◆ getFieldType()

arField::getFieldType ( )
Returns
mixed

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

182 {
183 return $this->fieldtype;
184 }

References $fieldtype.

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

+ Here is the caller graph for this function:

◆ getHasField()

arField::getHasField ( )
Returns
boolean

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

200 {
201 return $this->has_field;
202 }

References $has_field.

◆ getIndex()

arField::getIndex ( )
Returns
boolean

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

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

References $index.

◆ getLength()

arField::getLength ( )
Returns
int

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

218 {
219 return $this->length;
220 }

References $length.

◆ getName()

◆ getNotNull()

arField::getNotNull ( )
Returns
boolean

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

254 {
255 return $this->not_null;
256 }

References $not_null.

Referenced by arEditGUI\addFormField().

+ Here is the caller graph for this function:

◆ getPrimary()

arField::getPrimary ( )
Returns
boolean

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

272 {
273 return $this->is_primary;
274 }

References $is_primary.

◆ getSequence()

arField::getSequence ( )
Returns
boolean

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

290 {
291 return $this->sequence;
292 }

References $sequence.

◆ isAllowedAttribute()

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

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

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 }
$type

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

Referenced by getAttributesForConnector(), and getAttributesForDescription().

+ Here is the caller graph for this function:

◆ isDateField()

arField::isDateField ( )
Returns
bool

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

130 {
131 return self::isDateFieldType($this->getFieldType());
132 }
static isDateFieldType($field_type)

References getFieldType(), and isDateFieldType().

+ 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.

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

Referenced by isDateField().

+ Here is the caller graph for this function:

◆ loadFromArray()

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

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

65 {
66 $this->setName($name);
67 foreach ($array as $key => $value) {
68 switch ($value) {
69 case 'true':
70 $this->{$key} = true;
71 break;
72 case 'false':
73 $this->{$key} = false;
74 break;
75 default:
76 $this->{$key} = $value;
77 break;
78 }
79 }
80 }
setName($name)

References $name, and setName().

Referenced by loadFromStdClass().

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

88 {
89 $array = (array) $stdClass;
90 $this->loadFromArray($name, $array);
91 }
loadFromArray($name, array $array)

References $name, and loadFromArray().

+ Here is the call graph for this function:

◆ setFieldType()

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

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

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

◆ setHasField()

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

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

191 {
192 $this->has_field = $has_field;
193 }

References $has_field.

◆ setIndex()

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

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

299 {
300 $this->index = $index;
301 }

References $index.

◆ setLength()

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

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

209 {
210 $this->length = $length;
211 }

References $length.

◆ setName()

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

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

227 {
228 $this->name = $name;
229 }

References $name.

Referenced by loadFromArray().

+ Here is the caller graph for this function:

◆ setNotNull()

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

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

245 {
246 $this->not_null = $not_null;
247 }

References $not_null.

◆ setPrimary()

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

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

263 {
264 $this->is_primary = $primary;
265 }

◆ setSequence()

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

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

281 {
282 $this->sequence = $sequence;
283 }

References $sequence.

Field Documentation

◆ $allowed_attributes

arField::$allowed_attributes
staticprotected
Initial value:
= array(
),
self::FIELD_TYPE_INTEGER => array(
),
self::FIELD_TYPE_FLOAT => array(
),
self::FIELD_TYPE_DATE => array(
),
self::FIELD_TYPE_TIME => array(
),
self::FIELD_TYPE_TIMESTAMP => array(
),
self::FIELD_TYPE_CLOB => array(
),
)
const FIELD_TYPE_TEXT

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

Referenced by arViewField\getAllowedAttributes(), and arViewField\setAllowedAttributes().

◆ $date_fields

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

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

◆ $fieldtype

arField::$fieldtype
protected

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

Referenced by getFieldType().

◆ $has_field

arField::$has_field = false
protected

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

Referenced by getHasField(), and setHasField().

◆ $index

arField::$index = false
protected

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

Referenced by getIndex(), and setIndex().

◆ $is_primary

arField::$is_primary = false
protected

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

Referenced by getPrimary().

◆ $length

arField::$length = null
protected

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

Referenced by getLength(), and setLength().

◆ $name

◆ $not_null

arField::$not_null = false
protected

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

Referenced by getNotNull(), and setNotNull().

◆ $sequence

arField::$sequence = false
protected

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

Referenced by getSequence(), and setSequence().

◆ 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: