spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

Update Model.php to allow reload of relationships #90

Closed ralfonso-directnic closed 11 years ago

ralfonso-directnic commented 11 years ago

Currently If you create and save a new model, the relationships are not loaded on save even with reload=true. What you get is empty related models. With this change after you save, if you specify $reload=TRUE the model has its key values saved to a temp variable, the model is reset then key values are re-applied and then the load method is called as before. This forces relationships to be loaded.