Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a PersistentCollection?

Tags:

I have a One-To-Many relationship in my database. The editing, deleting and adding of elements used to work just fine. However, after a few changes (I can't track them all back), it doesn't work anymore.
Now, when I fetch the object with the One-To-Many relationship, I get a Persistent Collection to represent my collection of the Many-side. I suppose that wasn't the case before. In my constructor, I create a new Array Collection and not a Persistent Collection.

I have looked up the doctrine documentation to find that:

A PersistentCollection represents a collection of elements that have persistent state.

I do not understand what that means.

Could you please tell me:

  1. Is it normal to have Persistent Collections with a simple One-To-Many?
  2. How do those collections may appear? (rather than the usual ArrayCollection)
  3. Finally, what exactly is the use of a Persistent Collection?