1
0
mirror of synced 2024-12-15 07:36:03 +03:00
doctrine2/manual/docs/Working with objects - Dealing with relations - Creating related records.php

17 lines
379 B
PHP
Raw Normal View History

2007-04-14 01:49:11 +04:00
When accessing related records and if those records do not exists Doctrine automatically creates new records.
2007-04-14 01:49:11 +04:00
<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>