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.
Loading
Please register or sign in to comment