ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

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()
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 112 of file class.arField.php.

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

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

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

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

References $has_field.

◆ getIndex()

arField::getIndex ( )
Returns
boolean

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

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

References $index.

◆ getLength()

arField::getLength ( )
Returns
int

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

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

References $length.

◆ getName()

◆ getNotNull()

arField::getNotNull ( )
Returns
boolean

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

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

References $not_null.

Referenced by arEditGUI\addFormField().

+ Here is the caller graph for this function:

◆ getPrimary()

arField::getPrimary ( )
Returns
boolean

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

261 {
262 return $this->is_primary;
263 }

References $is_primary.

◆ getSequence()

arField::getSequence ( )
Returns
boolean

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

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

References $sequence.

◆ getUnique()

arField::getUnique ( )
Returns
boolean

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

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

References $unique.

◆ isAllowedAttribute()

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

Definition at line 320 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 }

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

127 {
128 return self::isDateFieldType($this->getFieldType());
129 }
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.

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

Referenced by isDateField().

+ Here is the caller graph for this function:

◆ loadFromArray()

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

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

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)

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

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

References $has_field.

◆ setIndex()

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

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

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

References $index.

◆ setLength()

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

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

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

References $length.

◆ setName()

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

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

221 {
222 $this->name = $name;
223 }

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

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

References $not_null.

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

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

References $sequence.

◆ setUnique()

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

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

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

References $unique.

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