Reputation: 1203
I have a BlogBundle and I want to add a thread to my posts (using FOSCommentBundle) but following the FOS documentation I have to provide the thread ID. The problem is that all my older posts has the thread property set to NULL, what is the best way to associate a new thread to my older posts ? If possible, I would not have to change the FOSThreadController.
/**
* @var \ACME\CommentBundle\Thread $thread
*
* @ORM\OneToOne(targetEntity="ACME\CommentBundle\Entity\Thread", cascade={"persist", "remove"})
*/
private $thread;
Upvotes: 0
Views: 192
Reputation: 728
You can write command to find all the posts with thread == null and create thread for it.
Upvotes: 1