Okay, so I’m not even sure how to ask this question (much less search for it). But in my system, I have a variable that forms a relationship for nearly every row. The user does not know it and it is set as a session variable each time a user logs in.
I need this variable to be available to Doctrine. It’s not a default or static, so setting it in the class property isn’t an option. Having it as a hidden form poses a security risk. I’m honestly at a loss. I’ve avoided the problem until I can’t avoid it no more…
It’d accept a workaround for the time being. I really need to get this project launched as soon as humanly possible.
Any help would be greatly appreciated. Even help explaining what I’m trying to accomplish would be appreciated!
While this doesn’t resolve my issue entirely, this particular solution may help someone else in a similar predicament…
In order to inject (I use the term loosely) an object into my form data using a form extension and an event listener.
Extension:
Listener:
(Had some help from this site.)
That allows you to do anything to the form or form data to every form. Which is how I injected the object initially. My problem is the embedded forms apparently don’t call
setData()(presumably because the first object already has the other objects).I’ve worked on this all day, so, if my answer is badly worded, complain and I’ll fix it in the morning!