User Tools

Site Tools


Sidebar

Dokumentation

vortex:apidoc:relationfield

RelationField

RelationField

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

Description

Field containing a relation

Fields

Methods

changeField( $record )

Definition : public function changeField( $record )

Returns :

Description
Overloaded method. Make changes to the database structure regarding to 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
Overloaded method, clear out the references to related tablerecords

Parameters

connect( $value )

Definition : public function connect( $value = false )

Returns :

Description
Connect this relationfield to the opposing sides relation

Parameters

$value

Type : String
Default value : false

Description
UUID of the record to connect, defaults to false which uses the current fields value

disconnect()

Definition : public function disconnect()

Returns : boolean false on error, otherwise true

Description
Disconnect this relationfield

Parameters

getActiveRelation()

Definition : public function &getActiveRelation()

Returns : Relation - the currently active relation

Description
Get a reference to the active relation for this field

Parameters

getDOM( &$xmlDocument, $isRelation )

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

Returns : DOMElement - XML representation of this field

Description
Get a DOMElement representation of this field

Parameters

$isRelation

Type : boolean
Default value : false

Description
Whether this field is a relation or not

&$xmlDocument

Type : DOMDocument
Default value :

Description
Reference to the domdocument of which this element should be a part

getHead()

Definition : public function getHead()

Returns : String or false on error

Description
Overloaded getHead method returning additional header information

Parameters

getPlaintext( $save )

Definition : public function getPlaintext( $save = false )

Returns : String

Description
Get the plaintext representation for the related tablerecords descriptor

Parameters

$save

Type : boolean
Default value : false

Description
Whether this method is called during the save process

getRelatedTable()

Definition : public function &getRelatedTable()

Returns : Table

Description
Get a reference to the table on the other side of this relation

Parameters

getRelation()

Definition : public function &getRelation()

Returns : TableRecord

Description
Get the TableRecord that this relation relates to

Parameters

getRelations()

Definition : public function &getRelations()

Returns : Array

Description
Get all the relations that relates to this field

Parameters

getValue( $save )

Definition : public function getValue( $save = false )

Returns : String

Description
Get the value of this field as [idrelation];[value]

Parameters

$save

Type : boolean
Default value : false

Description
Whether this method is called during the save process

setActiveRelation( $identifier )

Definition : public function setActiveRelation( $identifier )

Returns :

Description
Set the active relation for this field

Parameters

$identifier

Type : String
Default value :

Description
The identifier to set the active relation to, either an ID of a relation or the name of the relation

setDOM( $xml )

Definition : public function setDOM( $xml )

Returns :

Description
Overloaded method, sets the contents of this field from the given DOMElement. Sets the active relation.

Parameters

$xml

Type : DOMElement
Default value :

Description
The DOMElement describing the new value for this field

setSystemValue( $activeRelation )

Definition : public function setSystemValue( $activeRelation )

Returns :

Description
Set the active relation for this relationfield. Makes the setSystemValue set the active relation.

Parameters

$activeRelation

Type : String
Default value :

Description
The id or name of the relation to set

setValue( $value, $init, $depth )

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

Returns : int - the value after setting

Description
Set the value of this relation. The value to set is the ID field of the related TableRecord. When set the relationdata is voided so it is reloaded on the next reference. Will change the value of the related record if there is a 1-side relation on that side.

Parameters

$depth

Type : int
Default value : 0

Description
How deeply nested this call is. Used to avoid infinite loops while changing values for 1-1 relations.

$init

Type : boolean
Default value : false

Description
Whether this method is called during the initialization process

$value

Type : UUID
Default value :

Description
The UUID of the record to connect

vortex/apidoc/relationfield.txt · Last modified: 2019/06/28 07:09 by hubbe