analogueorm / analogue

Analogue ORM : Data Mapper ORM for Laravel/PHP
MIT License
634 stars 51 forks source link

Set has many relationships to empty collection instead of null #258

Closed cappuc closed 6 years ago

cappuc commented 6 years ago

Using eager loading with an empty result and setting if we set the relation to null then it will be converted to a CollectionProxy (as for lazy loading) but it is better to init to an empty collection to prevent double loading (and n+1 problem)