You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently using hasOne() and hasMany() you can define related models. That's cool, but sometimes you want to add a custom relation.
Basically when calling $m->ref('AuditLog'); it would respond with a related model. Technically you could create a method $m->getAuditLog(); but we want to keep all relations separate in case we want to iterate through them (for example by visualising in UI or exploring relations).
Here is invocation:
$m->addRelation('AuditLog', function($m) {
return (new Model_Audit($big_data_db))->addCondition('user_id', $m->id);
});
Currently using hasOne() and hasMany() you can define related models. That's cool, but sometimes you want to add a custom relation.
Basically when calling $m->ref('AuditLog'); it would respond with a related model. Technically you could create a method $m->getAuditLog(); but we want to keep all relations separate in case we want to iterate through them (for example by visualising in UI or exploring relations).
Here is invocation:
And usage after:
or in UI framework:
The text was updated successfully, but these errors were encountered: