/** * "Success" form handler * * @param Address $entity */ protected function onSuccess(Address $entity) { if (null === $entity->getOrganization()) { $entity->setOrganization($this->organization); } $this->manager->persist($entity); $this->manager->flush(); }