User Tools

Site Tools


Sidebar

Dokumentation

vortex:apidoc:datafield

DataField

DataField

Filename : /classes/table/fields/datafield.php
Extends : Field

Description

Base type DataField, extended to all the Fieldtypes in the Vortex

Fields

PERMISSION_FULL

Definition : const PERMISSION_FULL = -43;
Description
Constant for full permissions

PERMISSION_READ_ONLY

Definition : const PERMISSION_READ_ONLY = -45;
Description
Constant for permission to read

PERMISSION_WRITE_NEW

Definition : const PERMISSION_WRITE_NEW = -44;
Description
Constant for permission to write on new items

Methods

changeField( &$record )

Definition : public static function changeField( &$record )

Returns :

Description
Make changes to the database regarding changes to this Field

Parameters

$record

Type : Object
Default value :

Description
Record describing the new Field, with a reference to the old fieldtype

clear()

Definition : public function clear()

Returns :

Description
Clear this field for garbage collection

Parameters

getDefaultValue()

Definition : public function getDefaultValue()

Returns : String - The default value for this Field

Description
Get the default value specified in the Vortex for this Field

Parameters

getDOM( &$xmlDocument, $isrelation )

Definition : public function getDOM(&$xmlDocument, $isrelation = false )

Returns : DOMElement

Description
Returns a DOMElement representing this field

Parameters

$isRelation

Type : boolean
Default value : false

Description
Flags whether this DOM describes a relation or not

$xmlDocument

Type : DOMDocument
Default value :

Description
A reference to the DOMDocument to create the DOMElement in

getHead()

Definition : public function getHead()

Returns : Array

Description
Return an array describing the head information for this field
The array contains the keys field, name, data with the name of the field, the descriptive of the field translated according to the current locale and an empty data value.

Parameters

getOriginalValue()

Definition : public function getOriginalValue()

Returns : String - the value stored in the database for this field

Description
Returns the unchanged value for this field, ie the value the field had on $init = true

Parameters

getPermission( $type )

Definition : public function getPermission( $type = null )

Returns : boolean

Description
Check whether the currently logged in user has permission to perform the given action on this Field

Parameters

$type

Type : int
Default value : null

Description
One of the constants RuleSet::READ, RuleSet::WRITE, RuleSet::CREATE, RuleSet::DELETE describing what action to check permission for

getPlaintext( $save )

Definition : public function getPlaintext( $save = false )

Returns : String - plaintext representation of the current value

Description
Get the plaintext translation of the current value of this DataField. Default is the same result as getValue

Parameters

$save

Type : boolean
Default value : false

Description
Whether this method is called during a save cycle or not. If true dose some extra processing.

getTableRecord()

Definition : public function &getTableRecord()

Returns : TableRecord

Description
Get the associated TableRecord of this DataField

Parameters

getValue( $save )

Definition : public function getValue( $save = false )

Returns : String - the current value of this DataField

Description
Get the current value of this DataField

Parameters

$save

Type : boolean
Default value : false

Description
Whether this method is called during a save cycle or not. If true dose some extra processing.

setDom( $xml )

Definition : public function setDOM( $xml )

Returns :

Description
Sets the value to this Field from the DOMElement supplied

Parameters

$xml

Type : DOMElement
Default value :

Description
A DOMElement to get the value to set to this Field from

setPlaintext( $value, $init )

Definition : public function setPlaintext( $value, $init = false )

Returns :

Description
Calls setValue. Overridden for some fieldtypes to translate plaintext into ID.

Parameters

$init

Type : boolean
Default value : false

Description
Whether this setValue is called during the initialization of the Vortex, if true it will skip certain checks and scripts

$value

Type : String
Default value :

Description
The value to assign to this DataField

setSystemValue( $value )

Definition : public function setSystemValue( $value )

Returns :

Description
Does nothing for the default DataField.

Parameters

$value

Type : String
Default value : The value to set

Description

setTableRecord( &$tablerecord )

Definition : public function setTableRecord( &$tablerecord )

Returns :

Description
Assigns the tablerecord owning this field

Parameters

$tabelrecord

Type : TableRecord
Default value :

Description
Tablerecord supposed to contain this Field

setValue( $value, $init )

Definition : public function setValue( $value, $init = false )

Returns : boolean - true on success, otherwise false

Description
Set the value of this DataField. Also calls before- and afterUpdate scripts and acts accordingly to cancel flag.
Also does a sanity check on the new value, applying all rules for the Field such as regexp, unique and forced.

Parameters

$init

Type : boolean
Default value : false

Description
Whether this setValue is called during the initialization of the Vortex, if true it will skip certain checks and scripts

$value

Type : String
Default value :

Description
The value to assign to this DataField

setWarnings()

Definition : public function setWarnings()

Returns :

Description
Assign warnings to be displayed for this DataField if it breaks any rules defined for the Field

Parameters

toArray()

Definition : public function toArray()

Returns : String

Description
Return the current value of this DataField

Parameters

vortex/apidoc/datafield.txt · Last modified: 2019/06/28 07:05 by hubbe