mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix caching in DataObject::get_one()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47748 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9ab3d5e646
commit
4dd628c9d0
@ -1505,7 +1505,7 @@ class DataObject extends Controller implements DataObjectInterface {
|
||||
* @return DataObject The first item matching the query
|
||||
*/
|
||||
public static function get_one($callerClass, $filter = "", $cache = true, $orderby = "") {
|
||||
if(!$cache || !isset(DataObject::$cache_get_one[$callerClass][$filter]) || isset(DataObject::$cache_get_one[$callerClass][$filter]->destroyed)) {
|
||||
if(!$cache || !isset(DataObject::$cache_get_one[$callerClass][$filter]) || DataObject::$cache_get_one[$callerClass][$filter]->destroyed) {
|
||||
$item = singleton($callerClass)->instance_get_one($filter, $orderby);
|
||||
if($cache) {
|
||||
DataObject::$cache_get_one[$callerClass][$filter] = $item;
|
||||
|
Loading…
Reference in New Issue
Block a user