-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Feedback please (v3) #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I just pushed a first change to the develop brach; from now on, if you want to use the "hybrid relations" between mongodb and mysql, you no longer have to extend a special class, but you can use a |
Because this will probably be a new (breaking) major version. I decided to move the Model class to |
It seems that the event based approach might not work out of the box. Observers are registered to all instances of a certain model class, not one instance in particular. Either I modify the model class to allow for instance observers, or I search for a different solution. |
Hi Jens, few words about embedded relations and objects : First, embed objects in MongoDB is one of the key features for a lot of web application. The ability of easily saving complex and changing data structures is probably the main reason for us for using MongoDB. Second, you are right, there are few improvements that could be done in this part of the package. Someones are listed in the issues #310 or #387 for example but there are also some ambiguous things like when you do Third, I have not take time to look at your first try but I know that working with events can be really tricky in Laravel (even if it seems to be improved in L5). Why not create an I would have liked to have more time to contribute but, at least, I can be in the corner next days to take a look at what will be done. |
I don't think a specific trait for embedded models would be the way to go. For example, you could have objects embed each other; eg. a user embedding another user as parent/brother. I completely started embedded models from scratch in the current develop branch. But operations on embedded models are not working yet. There's still a lot of work to be done :) |
i would like to monitor the progress over here. as i started using the embedMany, but it gives me weird results. Like, a separate "table" in the database. so i dropped the idea and went for dot-notation :/ and now i'm fixing dot-Dates in attributesToArray and dot-enabled syncOriginalValue (as it doesn't work with ->increments(something.sometingelse)). am i doing something not in a correct way? is there an example to embedOne, that embedMany? also i'm interested in GeoJSON, but this is for later |
I'm having a few issues with the current implementation of embedded models. In the beginning, it seemed like a really cool idea to add it to this library, but because of this, a lot of custom code had to be added to allow users work with these embedded models in a flexible way.
Currently I'm considering a complete rewrite of the embedded models using model observers/events. These event listeners will then trigger the save method of all parent models, instead of trying to intercept it in the model class. I have no idea if it will work eventually, but it seems like a more practical implementation that is less prone to bugs. I will be trying out a prototype today, if anyone has some additional ideas, please reply below :)
The text was updated successfully, but these errors were encountered: