Hi all
Bit of a newbie question, I'm sure, but I just can't find a solution to this problem. I suspect it's something I'm doing wrong but...
OK, I have a parent class with a has_many relationship with a child class. SilverStripe/Sapphire creates the tables correctly but I'm not able to insert any child objects into the database using SS. The steps I'm expecting to work for me are...
1. create new Parent object
2. get Children component set
3. create Child objects and use add() to add them to Children
4. call write() on Parent to write Parent and Children to database
I'm not getting any error messages that I can find but nor am I getting any Child objects inserted into the database. I've done my best to find useful example code, read the documentation, etc. but I'm just stuck.
Could someone please point me at a complete example of achieving the above or highlight where I'm going wrong?
Thanks in advance
Simon