Working with objects - Dealing with relations - Updating related records.php 424 Bytes
Newer Older
hansbrix's avatar
hansbrix committed
1 2 3 4 5 6 7 8 9 10 11 12
You can update the related records by calling save for each related object / collection individually or by calling
save on the object that owns the other objects. You can also call Doctrine_Connection::flush which saves all pending objects.

<code type="php">
$user->Email['address'] = 'koskenkorva@drinkmore.info';

$user->Phonenumber[0]->phonenumber = '123123';

$user->save();

// saves the email and phonenumber
</code>