From a5482f0fb48084ac8dda2b798d515d7fc265f5bb Mon Sep 17 00:00:00 2001 From: Wim Velzeboer Date: Fri, 25 Jun 2021 09:56:12 +0100 Subject: [PATCH] Fix criteria documentation for selector --- docs/criteria-based-filter.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/criteria-based-filter.md b/docs/criteria-based-filter.md index cad7adf..8f55aed 100644 --- a/docs/criteria-based-filter.md +++ b/docs/criteria-based-filter.md @@ -23,13 +23,13 @@ The criteria class is the place where all the filter conditions are stored for a ```apex public with sharing class AccountCriteria extends fflib_Criteria { - public AccountCriteria ShippingCountryEquals(String countryName) + public AccountCriteria shippingCountryEquals(String countryName) { equalTo(Schema.Account.ShippingCountry, countryName); return this; } - public AccountCriteria NumberOfEmployeesGreaterThan(Integer numberOfEmployees) + public AccountCriteria numberOfEmployeesGreaterThan(Integer numberOfEmployees) { greaterThan(Schema.Account.NumberOfEmployees, numberOfEmployees); return this; @@ -50,7 +50,7 @@ public with sharing class Accounts { return new Accounts( getRecords( - new AccountCriteria().ShippingCountryEquals(countryName) + new AccountCriteria().shippingCountryEquals(countryName) ) ); } @@ -59,7 +59,7 @@ public with sharing class Accounts { return new Accounts( getRecords( - new AccountCriteria().NumberOfEmployeesGreaterThan(numberOfEmployees) + new AccountCriteria().numberOfEmployeesGreaterThan(numberOfEmployees) ) ); } @@ -69,8 +69,8 @@ public with sharing class Accounts return new Accounts( getRecords( new AccountCriteria() - .ShippingCountryEquals(countryName) - .NumberOfEmployeesGreaterThan(numberOfEmployees) + .shippingCountryEquals(countryName) + .numberOfEmployeesGreaterThan(numberOfEmployees) ) ); } @@ -97,6 +97,8 @@ public with sharing class AccountsSelector new AccountCriteria() .ShippingCountryEquals(country) .NumberOfEmployeesGreaterThan(minimalNumberOfEmployees) + .toSOQL() + ) ); } ...