ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

arField::getAttributesForConnector ( )
Returns
array

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

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

{
$return = array();
foreach (arFieldList::getAllowedConnectorFields() as $field_name) {
if (isset($this->{$field_name}) && $this->{$field_name} AND self::isAllowedAttribute($this->getFieldType(), $field_name)) {
$return[arFieldList::mapKey($field_name)] = $this->{$field_name};
}
}
return $return;
}

+ Here is the call graph for this function:

arField::getAttributesForDescription ( )
Returns
array

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

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

{
$return = array();
foreach (arFieldList::getAllowedDescriptionFields() as $field_name) {
if ($this->{$field_name} AND self::isAllowedAttribute($this->getFieldType(), $field_name)) {
$return[arFieldList::mapKey($field_name)] = $this->{$field_name};
}
}
return $return;
}

+ Here is the call graph for this function:

arField::getFieldType ( )
arField::getHasField ( )
Returns
boolean

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

References $has_field.

{
}
arField::getIndex ( )
Returns
boolean

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

References $index.

{
return $this->index;
}
arField::getLength ( )
Returns
int

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

References $length.

{
return $this->length;
}
arField::getNotNull ( )
Returns
boolean

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

References $not_null.

Referenced by arEditGUI\addFormField().

{
}

+ Here is the caller graph for this function:

arField::getPrimary ( )
Returns
boolean

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

References $is_primary.

{
}
arField::getSequence ( )
Returns
boolean

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

References $sequence.

{
}
arField::getUnique ( )
Returns
boolean

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

References $unique.

{
return $this->unique;
}
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.

Referenced by getAttributesForConnector(), and getAttributesForDescription().

{
if ($field_name == arFieldList::FIELDTYPE OR $field_name == arFieldList::HAS_FIELD) {
return true;
}
return in_array($field_name, self::$allowed_attributes[$type]);
}

+ Here is the caller graph for this function:

arField::isDateField ( )
Returns
bool

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

References getFieldType(), and isDateFieldType().

{
}

+ Here is the call graph for this function:

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

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

Referenced by isDateField().

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

+ Here is the caller graph for this function:

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

{
$this->setName($name);
foreach ($array as $key => $value) {
switch ($value) {
case 'true':
$this->{$key} = true;
break;
case 'false':
$this->{$key} = false;
break;
default:
$this->{$key} = $value;
break;
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References $name, and loadFromArray().

{
$array = (array)$stdClass;
$this->loadFromArray($name, $array);
}

+ Here is the call graph for this function:

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

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

{
$this->fieldtype = $field_type;
}
arField::setHasField (   $has_field)
Parameters
boolean$has_field

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

References $has_field.

{
$this->has_field = $has_field;
}
arField::setIndex (   $index)
Parameters
boolean$index

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

References $index.

{
$this->index = $index;
}
arField::setLength (   $length)
Parameters
int$length

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

References $length.

{
$this->length = $length;
}
arField::setName (   $name)
Parameters
string$name

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

References $name.

Referenced by loadFromArray().

{
$this->name = $name;
}

+ Here is the caller graph for this function:

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

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

References $not_null.

{
$this->not_null = $not_null;
}
arField::setPrimary (   $primary)
Parameters
boolean$primary

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

{
$this->is_primary = $primary;
}
arField::setSequence (   $sequence)
Parameters
boolean$sequence

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

References $sequence.

{
$this->sequence = $sequence;
}
arField::setUnique (   $unique)
Parameters
boolean$unique

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

References $unique.

{
$this->unique = $unique;
}

Field Documentation

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(
),
)

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

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

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.

arField::$fieldtype
protected

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

Referenced by getFieldType().

arField::$has_field = false
protected

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

Referenced by getHasField(), and setHasField().

arField::$index = false
protected

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

Referenced by getIndex(), and setIndex().

arField::$is_primary = false
protected

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

Referenced by getPrimary().

arField::$length = NULL
protected

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

Referenced by getLength(), and setLength().

arField::$not_null = false
protected

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

Referenced by getNotNull(), and setNotNull().

arField::$sequence = false
protected

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

Referenced by getSequence(), and setSequence().

arField::$unique = false
protected

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

Referenced by getUnique(), and setUnique().

const arField::FIELD_TYPE_CLOB = 'clob'

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

const arField::FIELD_TYPE_DATE = 'date'
const arField::FIELD_TYPE_FLOAT = 'float'
const arField::FIELD_TYPE_INTEGER = 'integer'
const arField::FIELD_TYPE_TEXT = 'text'

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

Referenced by ilADTTextActiveRecordBridge\getActiveRecordFields().

const arField::FIELD_TYPE_TIME = 'time'

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

const arField::FIELD_TYPE_TIMESTAMP = 'timestamp'

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