DbObject: allow to statically clearPrefetchCache
This commit is contained in:
parent
1158409eeb
commit
6708df8a61
|
@ -1062,6 +1062,18 @@ abstract class DbObject
|
|||
return self::$prefetched[$class];
|
||||
}
|
||||
|
||||
public static function clearPrefetchCache()
|
||||
{
|
||||
$class = get_called_class();
|
||||
if (! array_key_exists($class, self::$prefetched)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unset(self::$prefetched[$class]);
|
||||
unset(self::$prefetchedNames[$class]);
|
||||
unset(self::$prefetchStats[$class]);
|
||||
}
|
||||
|
||||
public static function exists($id, DbConnection $connection)
|
||||
{
|
||||
if (static::getPrefetched($id)) {
|
||||
|
|
Loading…
Reference in New Issue