User Tools

Site Tools


Sidebar

Dokumentation

vortex:api:tablerecord

TableRecord

The TableRecord class describes one record from a Table.

Extends

Implements

Constants

Methods

Code Examples

Connect the 1-side of a Relation to another record

$thisTableRecord = TableRecordFactory::getTableRecord( 'myTable', $idTableRecord1 );
$otherTableRecord = TableRecordFactory::getTableRecord( 'myOtherTable', $idTableRecord2 );
 
$thisTableRecord->set( 'theRelationField', $otherTableRecord->getUUID() );

Connect the 1-side of a multiRelation to another record specifying which relation to set

$thisTableRecord = TableRecordFactory::getTableRecord( 'myTable', $idTableRecord1 );
$otherTableRecord = TableRecordFactory::getTableRecord( 'myOtherTable', $idTableRecord2 );
 
$thisTableRecord->set( 'theRelationField', "relationname;".$otherTableRecord->getUUID() );

alternatively

$thisTableRecord = TableRecordFactory::getTableRecord( 'myTable', $idTableRecord1 );
$otherTableRecord = TableRecordFactory::getTableRecord( 'myOtherTable', $idTableRecord2 );
 
$thisTableRecord->getField( 'theRelationField' )->setActiveRelation( "relationname" );
$thisTableRecord->set( 'theRelationField', $otherTableRecord->getUUID() );

Connect the X-side of a Relation to another record

$thisTableRecord = TableRecordFactory::getTableRecord( 'myTable', $idTableRecord1 );
$otherTableRecord = TableRecordFactory::getTableRecord( 'myOtherTable', $idTableRecord2 );
 
$thisTableRecord->setRelation( 'relationName', $otherTableRecord->getUUID() );

Set a value to a field in the record

$tableRecord->set( 'field', $value );
vortex/api/tablerecord.txt · Last modified: 2019/06/28 07:00 by hubbe