Skip to content

Commit b15f407

Browse files
committed
refactoring
Signed-off-by: Piotr PG Gajek <[email protected]>
1 parent 3f82f67 commit b15f407

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

force-app/main/default/classes/main/cached-soql/SOQLCache.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
6161
mock.setMock(mockId, new List<SObject>{ record });
6262
}
6363

64-
public static void invalidateRecords(List<SObject> records) {
64+
public static void refreshRecords(List<SObject> records) {
6565
if (records.isEmpty()) {
6666
return;
6767
}

website/docs/api/cached-soql/soql-cache.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The following are methods for using `SOQLCache`:
2929
[**CACHE EXPIRATION**](#cache-expiration)
3030

3131
- [`maxHoursWithoutRefresh()`](#maxhourswithoutrefresh)
32-
- [`invalidateRecords(List<SObject> records)`](#invalidaterecords)
32+
- [`refreshRecords(List<SObject> records)`](#refreshrecords)
3333

3434
[**INITIAL QUERY**](#initial-query)
3535

@@ -183,21 +183,21 @@ SOQLCache.of(Profile.SObjectType)
183183
.toObject();
184184
```
185185

186-
### invalidateRecords
186+
### refreshRecords
187187

188-
The `invalidateRecords` method allows clearing records from the cache, triggering an automatic refresh the next time the query is executed.
188+
The `refreshRecords` method allows clearing records from the cache, triggering an automatic refresh the next time the query is executed.
189189

190190
**Signature**
191191

192192
```apex
193-
Cacheable invalidateRecords(List<SObject> records)
193+
Cacheable refreshRecords(List<SObject> records)
194194
```
195195

196196
**Example**
197197

198198
```apex
199199
trigger SomeObjectTrigger on SomeObject (after update, after delete) {
200-
SOQLCache.invalidateRecords(Trigger.old);
200+
SOQLCache.refreshRecords(Trigger.new);
201201
}
202202
```
203203

0 commit comments

Comments
 (0)