what is the correct way of persisting associated objects?
example
class User{
/** @OneToOne(targetEntity="Profile", cascade={"persist", "remove"}) */
private $profile;
}
if i change a property in the profile object like this $user->profile->setText(‘text’);
and then do
$em->persist($user) nothing happens. i tried persisting also the profile, setting the changed profile back to the user object, persisting both, but the profile record never gets updated.
how is this done?
thanks
Do like this: