Remove Objects

The interface structure was incompatible so had to remove it and replace it again with fflib_Objects
This commit is contained in:
Wim Velzeboer
2021-06-25 09:53:06 +01:00
parent c669623273
commit 694f7a84a2
13 changed files with 160 additions and 125 deletions
+84
View File
@@ -0,0 +1,84 @@
# fflib-apex-extensions
## Primitive Domain - SObject
This class should be used to extend Domain classes.
```apex
public class Accounts extends SObjects implements IAccounts
{
...
}
```
### Method reference
Public methods
- [getSObjectById](#getSObjectById)
- [getRecords](#getRecords)
Protected methods
- [addError](#adderror)
- [clearField / clearFields](#clearField)
- [getDateFieldValues](#getDateFieldValues)
- [getDateTimeFieldValues](#getDateTimeFieldValues)
- [getDecimalFieldValues](#getDecimalFieldValues)
#### getSObjectById
Returns the contents of the Domain by their primary Key ('Id' field)
`public Map<Id, SObject> getSObjectById()`
<br/><br/>
#### getRecords
Returns only the SObjects from the domain matching the given Ids.
`public List<SObject> getRecords(Ids ids)`<br/>
`public List<SObject> getRecords(Set<Id> ids)`<br/>
<br/>
Return the SObject records contained in the domain matching the criteria
- `public List<SObject> getRecords(fflib_Criteria criteria)`<br/>
<br/><br/>
#### addError
Adds an error message to the records in the domain
`protected void addError(String message)`<br/>
`protected void addError(Schema.SObjectField sObjectField, String message)`
<br/><br/>
#### clearField
Clear the field value on all the records of the domain
`protected void clearField(Schema.SObjectField sObjectField)`<br/>
`protected void clearFields(Set<Schema.SObjectField> sObjectFields)`
<br/><br/>
#### getDateFieldValues
Get the Date values from the given SObjectField, null values will be omitted.
If a criteria is provided, only the value of the records matches the criteria will be returned.
`protected Dates getDateFieldValues(Schema.SObjectField sObjectField)`<br/>
`protected Dates getDateFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)`
<br/><br/>
#### getDateTimeFieldValues
Get the Datetime values from the given SObjectField, null values will be omitted.
If a criteria is provided, only the value of the records matches the criteria will be returned.
`protected DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField)`<br/>
`protected DateTimes getDateTimeFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)`
<br/><br/>
#### getDecimalFieldValues
Get the Decimal values from the given SObjectField, null values will be omitted.
If a criteria is provided, only the value of the records matches the criteria will be returned.
`protected Decimals getDecimalFieldValues(Schema.SObjectField sObjectField)`<br/>
`protected Decimals getDecimalFieldValues(Schema.SObjectField sObjectField, fflib_Criteria criteria)`
+10
View File
@@ -19,4 +19,14 @@ One other benefit is that you can encapsulate more logic as Lists. You can see t
Take a look at the SObjects primitive domain, it is the new source for extending domain classes.
### Available Primitive Domains
- Dates
- DateTimes
- Decimals
- Doubles
- Ids
- Integers
- Longs
- [SObjects](domains/sobject.md)
- Strings