Skip to content
  • Jared Hancock's avatar
    6c71e3ac
    orm: Implement object caching · 6c71e3ac
    Jared Hancock authored
    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.
    6c71e3ac
    orm: Implement object caching
    Jared Hancock authored
    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