Skip to content
Snippets Groups Projects
Commit 6c71e3ac authored by Jared Hancock's avatar Jared Hancock
Browse files

orm: Implement object caching

Ensure that for a model class name and primary key, there is only one object
floating around in PHP runtime. In doing so, ensure that models loaded from
the database are not duplicated in memory. Instead, check the cache when
creating objects to see if the object has already been loaded. If so, use
the loaded model rather than a new instance. This ensures that updates to a
model object are reflected consistently.

Also, short circuit lookups so that the cached version is retrieved without
consulting the database.
parent 1a5cb613
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment