You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Devin Smith edited this page Feb 3, 2016
·
2 revisions
Factory provides an in memory cache of objects with a type, key, value store system. This is enabled by default for Resource.
Use with Resource
When objects are loaded from the database using the load method they are automatically added to the factory cache.
$user = User::o(1);
$user->name = 'new name';
$user = User::o(1); // load the item from memory instead of another database callecho$user->name; // prints "new name"
Standalone usage
The factory method gets or sets an object by classname, or passed object