void ADODB_Active_Record::classHasMany( string $parentTable, string $childTable, optional string $foreignKey = '', optional string $foreignClass = 'ADODB_Active_Record' )
Globally defines a one-to-many relationship. Once defined, the relationship persists for the life of the script.
The parent table in the relationship
The child table in the relationship
If, due to database design constraints, the key field in the child table is not named the same as that of the parent table, specify it here.
If the class name for the child table differs from that of the parent, for example there has been some extension of methods, specify it here
————————-
class person extends ADOdb_Active_Record{} ADODB_Active_Record::ClassHasMany('person', 'children','person_id'); $person = new person(); $person->Load("id=1"); foreach($person->children as $c) { echo " $c->name_first "; $c->name_first .= ' K.'; $c->Save(); ## each child record must be saved individually }