Fix criteria documentation for selector

This commit is contained in:
Wim Velzeboer
2021-06-25 09:56:12 +01:00
parent 694f7a84a2
commit a5482f0fb4
+8 -6
View File
@@ -23,13 +23,13 @@ The criteria class is the place where all the filter conditions are stored for a
```apex ```apex
public with sharing class AccountCriteria extends fflib_Criteria public with sharing class AccountCriteria extends fflib_Criteria
{ {
public AccountCriteria ShippingCountryEquals(String countryName) public AccountCriteria shippingCountryEquals(String countryName)
{ {
equalTo(Schema.Account.ShippingCountry, countryName); equalTo(Schema.Account.ShippingCountry, countryName);
return this; return this;
} }
public AccountCriteria NumberOfEmployeesGreaterThan(Integer numberOfEmployees) public AccountCriteria numberOfEmployeesGreaterThan(Integer numberOfEmployees)
{ {
greaterThan(Schema.Account.NumberOfEmployees, numberOfEmployees); greaterThan(Schema.Account.NumberOfEmployees, numberOfEmployees);
return this; return this;
@@ -50,7 +50,7 @@ public with sharing class Accounts
{ {
return new Accounts( return new Accounts(
getRecords( getRecords(
new AccountCriteria().ShippingCountryEquals(countryName) new AccountCriteria().shippingCountryEquals(countryName)
) )
); );
} }
@@ -59,7 +59,7 @@ public with sharing class Accounts
{ {
return new Accounts( return new Accounts(
getRecords( getRecords(
new AccountCriteria().NumberOfEmployeesGreaterThan(numberOfEmployees) new AccountCriteria().numberOfEmployeesGreaterThan(numberOfEmployees)
) )
); );
} }
@@ -69,8 +69,8 @@ public with sharing class Accounts
return new Accounts( return new Accounts(
getRecords( getRecords(
new AccountCriteria() new AccountCriteria()
.ShippingCountryEquals(countryName) .shippingCountryEquals(countryName)
.NumberOfEmployeesGreaterThan(numberOfEmployees) .numberOfEmployeesGreaterThan(numberOfEmployees)
) )
); );
} }
@@ -97,6 +97,8 @@ public with sharing class AccountsSelector
new AccountCriteria() new AccountCriteria()
.ShippingCountryEquals(country) .ShippingCountryEquals(country)
.NumberOfEmployeesGreaterThan(minimalNumberOfEmployees) .NumberOfEmployeesGreaterThan(minimalNumberOfEmployees)
.toSOQL()
)
); );
} }
... ...