-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add support for refreshing a single record in a table's IdentityMap #95
Conversation
A couple of questions that popped into my brain during this:
But I wasn't entirely sure what the right way to go about that sub-grouping, or if that extra work would even be valuable. Thoughts? |
@conlanpatrek Some other considerations, raised in reference to the 3.x series but perhaps applicable here: atlasphp/Atlas.Mapper#1 |
That's a good question; I say yes, it should. |
At the table level, there are arrays-of-Rows, but no collections per se.
Cf. the AbstractTable::fetchRows() method for some possible hints in that direction. |
Ben Bankes notes that Propel uses the word "reload" instead of "refresh." https://twitter.com/benbankes/status/1038781768088932352 Do we feel one is better than the other? |
I don't know that I have a particular dog in that race, though it seems like 'refetch' keeps the method name in the same vernacular as the rest of atlas |
Updated based on feedback so far.
|
@pokmot Would this approach for the 2.x branch, or something similar, satisfy your needs on atlasphp/Atlas.Mapper#1 ? |
@pmjones Anything I can do to help this PR along? I don't recall if this is waiting on me for anything. |
Opening this up for discussion / inclusion.
Essentially the issue I'm seeing is that if something non Atlas changes a row in the db (separate process, or same process, but arbitrarily executed SQL), there appears to be no way to signal to Atlas to force a refetch of the affected rows. The next time you attempt to read the row, the stale version from the identity map will be returned.
Added a single method to the AbstractTable to allow for manually resetting the in memory row instance to the representation in the database.