cycle / orm

PHP DataMapper, ORM
https://cycle-orm.dev
MIT License
1.24k stars 72 forks source link

API for a local entities heap isolated in UoW scope #436

Open roxblnfk opened 1 year ago

roxblnfk commented 1 year ago

I think we can review the idea of working with iterators/heaps based on local UoW. Since it's localized it will be much safer to predict collisions. In this particular case, the ID has not been confirmed by the database, so the local index for it does not exist.

One of the options I can suggest - we can build local indexes on a level of UoW/EM itself, which seems much more logical instead of going back to Heap.

By @wolfy-j in https://github.com/cycle/orm/issues/392#issuecomment-1383118207

It would be nice to have a cleaner and more "high level" API for getting an entity from a local UoW.

By @KorDum in https://github.com/cycle/orm/issues/392#issuecomment-1383181491