v5:activerecord:tablekeybelongsto
This is an old revision of the document!
tableKeyBelongsTo
Syntax
void ADODB_Active_Record::tableKeyBelongsTo( string $childTable, string $childKey, string $relationName, string $foreignKey, string $parentPrimaryKey = 'id', string $parentClass = 'ADODB_Active_Record' )
Description
f the child table differs from the convention that the child table name is the plural of the child class name or the primary key is not 'id', use this function: ADODB_Active_Record::TableKeyBelongsTo()
Usage
ADODB_Active_Record::TableKeyBelongsTo('children','ch_id', 'person','person_id','id');
v5/activerecord/tablekeybelongsto.1449325099.txt.gz · Last modified: 2017/04/21 11:20 (external edit)