1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/manual/docs/Working with objects - Dealing with relations - Creating related records.php
2007-04-13 21:49:11 +00:00

17 lines
379 B
PHP

When accessing related records and if those records do not exists Doctrine automatically creates new records.
<code type="php">
// NOTE: related record have always the first letter in uppercase
$email = $user->Email;
$email->address = 'jackdaniels@drinkmore.info';
$user->save();
// alternative:
$user->Email->address = 'jackdaniels@drinkmore.info';
$user->save();
</code>