1
0
mirror of synced 2025-01-18 22:41:43 +03:00
doctrine2/manual/docs/Working with objects - Dealing with relations - Creating related records.php

17 lines
394 B
PHP
Raw Normal View History

2006-07-23 21:08:06 +00:00
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>