Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:58:46+00:00 2026-06-01T21:58:46+00:00

Quite a while ago Ryan Weaver explained to me on Stack how to use

  • 0

Quite a while ago Ryan Weaver explained to me on Stack how to use relations in my forms by embedding one formtype in to another.
To prevent duplication, please take the small bit of time to read my initial problem context here:
Symfony2 form where the data objects doesn't match exactly what needs to be filled in

The form works great when registering a new Machine. The user enters a Monitor serialnumber and things work out great. However, when editing an existing machine by changing the Monitor serialnumber (i.e. the user has replaced his Monitor with another and lets me know by giving me the new serialnumber), something weird happens.

The machine gets linked to the new Monitor correctly, so that’s good. But somehow the previous Monitor find it’s serialnumber value being overwritten with the ‘new serialnumber’. Like if the user was editing the Monitor object, which isn’t the idea.

I suppose this happens when doing ‘$form->bindRequest($this->getRequest());’, where the Machine object afterwards gets flushed. But it should get flushed only with the new Monitor as it’s relation, not do anything to the old one.

Does anyone know what I can do to prevent this, or what I’m probably doing wrong?
The code is an exact replica of what Ryan told me in the linked post.

Cheers and thanks,

Dieter

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:58:50+00:00Added an answer on June 1, 2026 at 9:58 pm

    Basically, you want to call $em->refresh($originalMonitor); when you know you have a new monitor. That will reload the original monitor’s data which, as you surmised, is being modified when bindRequest is being called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was using CodeRush quite while ago and now I'm planning to use it
I have question quite much related to this one I asked a while ago
This question was asked quite some time ago, and while it covers possible solutions
Quite a while ago, someone asked how you can make Visual Studio's debugger play
This was asked quite a while ago in SO but there isn't a definitive
Quite a while ago, I heard about Object databases. Cool concept and all. Now,
I have an app I wrote quite a while ago. It is a database
A while ago I had a query that I ran quite a lot for
A while ago I found a packaging tool for visual studio that allowed quite
I added GDI+ to my Win32 Application for drawing gradients quite a while ago.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.