Skip to content

Commit 5c2df04

Browse files
committed
Allow pass-through of printing for bind variables from RepoFactory
1 parent e9e2eca commit 5c2df04

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

force-app/factory/RepoFactory.cls

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
public virtual class RepoFactory {
22
private static final Map<Schema.SObjectType, IHistoryRepository> CACHED_REPOS = new Map<Schema.SObjectType, IHistoryRepository>();
3+
private Boolean shouldPrintBindVars = false;
34

45
public Facade facade {
56
get {
@@ -11,6 +12,11 @@ public virtual class RepoFactory {
1112
protected set;
1213
}
1314

15+
public RepoFactory setShouldPrintBindVars(Boolean shouldPrintBindVars) {
16+
this.shouldPrintBindVars = shouldPrintBindVars;
17+
return this;
18+
}
19+
1420
public IHistoryRepository getProfileRepo() {
1521
return this.facade.getRepo(Profile.SObjectType, new List<Schema.SObjectField>{ Profile.Name }, this);
1622
}
@@ -45,6 +51,7 @@ public virtual class RepoFactory {
4551
} else {
4652
System.debug(System.LoggingLevel.FINER, 'Using cached repository of type: ' + repoType);
4753
}
54+
potentiallyCachedInstance.setShouldPrintBindVars(repoFactory.shouldPrintBindVars);
4855
return potentiallyCachedInstance;
4956
}
5057
}

0 commit comments

Comments
 (0)