Closed harikt closed 10 years ago
Relationships are currently not handled at all on save. You have to manually save any related objects.
I should at least make a note of this in the docs, so thank you for bringing that to my attention.
There was a long discussion about this in Spot v1 and even code in a new branch implementing a save with nested arrays, but it ultimately never got merged into master. I am willing to consider adding this for Spot v2 - it's just a question of nailing down all the details and syntax so the save behavior is not surprising or unexpected.
I just added a section with the heading "Saving Relations" at the bottom of the CRUD page.
ok. Thanks.
This is the only thing stopping me from using your ORM. I think it is a must, especially for adoption from inexperienced developers.
I have used such feature in Jam (Kohana-dependant ActiveRecord) and Harp (PHP 5.4+ DataMapper in development).
I think an issue should be opened for this so interface and implementation could be discussed. What do you think?
Not a showstopper but I agree it would save writing several lines of code. Harp looks interesting btw.
Hi,
I was looking the CRUD docs http://phpdatamapper.com/docs/crud/ .
I wonder how you handle relationships on save.
Better example of handling relationship on save may help.