For example, Comment table has foreign key at Author table. How do I create a new author record when I save a new comment? e.g.: Comment: id = 1, author_id = [newly generated id associated with author table], content = "this is a new comment". Author: id = 1, author_name = [newly generated author name].
Symfony: How to save record with undefined foreign key record
574 Views Asked by whamsicore At
1
There are 1 best solutions below
Related Questions in SYMFONY1
- PHP - How to change machine's DateTime only during selenium testing
- PHP Fatal error: Class 'sfContext' not found
- Are there any code migration method(s) if I want to change from symfony 1.4 to 3.0?
- isvalid() function in symfony always give false
- How to save embedded forms in symfony 1?
- SQL EXISTS condition in Symfony 1.4
- php pagination hide previous and next button using symfony framework
- symfony1 swift mailer gmail - connection refused
- Check if slug exists add plus one to the end of the string. using symfony framework
- Unrecognized table getting created when Doctrine builds the database
- Symfony: REST web-service for bots and humans - open questions
- Symfony project on CPanel account
- Symfony : how to pass a variable between executeNew() and executeCreate()?
- how can I send json instead of form-data to my symfony controller
- Symfony build all, but don't delete records
Related Questions in SYMFONY-1.4
- Absolute path in Symfony1.4
- Deploying Symfony1 project to a Linode with Ubuntu 14.04 shows blank screen
- Symfony1.4 : Clearing cache across applications with internal URI
- Accessing array values created in foreach loops
- Server Concurrency with High CPU Load
- Django-cms page view restrictions
- Are there any code migration method(s) if I want to change from symfony 1.4 to 3.0?
- Need to install a existing project on symfony 1.4 using command line
- isvalid() function in symfony always give false
- Symfony doctrine set database name in migration
- symfony 1.4 not picking up subdirectory in routing?
- symfony 1.4 - all routing values being deleted when one is set in factories.yml
- Generate FORM from Model
- Can I use angular when I have a Symfony 1.4 framework?
- Query count and count fetchArray not same in Doctrine and Symfony 1.4
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This has nothing to do with Symfony. I assume you're using Doctrine, am I right? Well, all you have to do is to create
CommentandAuthorobjects:Doctrine should recognize that you're using two brand new objects that aren't persisted in database and thus both object will be inserted.