I have a problem with the SonataAdminBunle in combination with symfony 2.2.
I have a Project entity and a ProjectImage entity and specified a One-to-Many relationship betwee
public function prePersist($societate)
{
$this->preUpdate($societate);
}
public function preUpdate($societate)
{
$conturi = $societate->getConturi();
if (count($conturi) > 0) {
foreach ($conturi as $cont) {
$cont->setSocietate($societate);
}
}
}