Please Help me out I am using data mapper v1.8.2.1
my ledger table is having child staff table
$l = new Ledger();
$l->where('id', $id)->get();
$l->name = 'john';
$s = new Staff();
$s->first_name = 'john';
$s->last_name = 'doe';
$l->save($l);
nothing is save by this code
i tried
$s->save($l);
also nothing is saved
At first try:
If this will not work, check relationship setup between the models. They should be set in both models:
In your database, table staffs should have column ledger_id, which has to be set as a foreign key to field id in ledgers (note that table names are plural).