Property | Type | Description | |
---|---|---|---|
$sideloadedRecords | array | Stores the current $sideloaded_records config |
Method | Description | |
---|---|---|
__construct ( ) | Construct and set current config | |
formatName ( string $name ) : string | Format a SilverStripe ClassName or Field name to be used by the client API | |
serialize ( DataObject | DataList $data ) : string | Convert raw data (DataObject or DataList) to JSON ready to be consumed by the client API |
Method | Description | |
---|---|---|
getSideloadData ( DataObject | DataList $dataSource ) : array | Fetches and return all the data that need to be sideloaded for a specific source DataObject or DataList. | |
hasSideloadedRecords ( string $classname ) : boolean | Check if a specific class requires data to be sideloaded. | |
insertSideloadData ( stdClass $root, DataObject | DataList $dataSource ) : stdClass | Take a root object ready to be converted into JSON and an original data source (DataObject OR DataList) and insorts into the root object all relation records that should be sideloaded. | |
serializeColumnName ( string $name ) : string | Format a DB Column name or Field name to be used by the client API |
public formatName ( string $name ) : string | ||
$name | string | ClassName of DBField name |
return | string | Formatted name |
protected getSideloadData ( DataObject | DataList $dataSource ) : array | ||
$dataSource | DataObject | DataList | The source data to fetch sideloaded records for |
return | array | A map of relation names with their data |
protected hasSideloadedRecords ( string $classname ) : boolean | ||
$classname | string | Requested data classname |
return | boolean | True if some relations should be sideloaded |
protected insertSideloadData ( stdClass $root, DataObject | DataList $dataSource ) : stdClass | ||
$root | stdClass | Root object ready to become JSON |
$dataSource | DataObject | DataList | The original data set from the root object |
return | stdClass | The updated root object sith the sideloaded data attached |
protected serializeColumnName ( string $name ) : string | ||
$name | string | Field name |
return | string | Formatted name |
protected array $sideloadedRecords | ||
return | array |