DbObject: allow to statically clearPrefetchCache

This commit is contained in:
Thomas Gelf 2016-05-02 10:24:32 +02:00
parent 1158409eeb
commit 6708df8a61
1 changed files with 12 additions and 0 deletions

View File

@ -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)) {