NobrainerWeb\Bilinfo\Tasks\GetApiDataTask
Synopsis
class GetApiDataTask
extends BuildTask
{
- // members
- protected string $title = 'Bilinfo - Get data from the API';
- protected array $errors = ;
- private static array $unique_field_identifiers = ;
- // methods
- public void run()
- protected array fetchData()
- protected void reportErrors()
- protected void cleanUp()
- public SS_List writeListings()
- protected Listing bindListingDealer()
- protected Listing bindListingMake()
- protected Listing bindListingImages()
- protected Listing bindListingEquipment()
- protected SS_List writeItems()
- protected DataObject writeItem()
- protected DataObject|null handleExistingItem()
- protected DataObject updateItem()
- protected string|null getUniqueIdentifier()
- protected void log()
Hierarchy
Extends
- SilverStripe\Dev\BuildTask
Members
private
-
$unique_field_identifiers
Specify for each model which field is checked, for an already existing item For example on Listings, ExternalID field is used to determine if we write a new record, or simply update the existing one with corresponding ExternalID On other models such as Make, it would simply be the Title field that is used to check, if a Make with that title already exists
protected
- $errors
—
array
List of errors (strings) that might have occured - $title
Methods
protected
- bindListingDealer()
- bindListingEquipment()
- bindListingImages()
- bindListingMake()
- cleanUp() — cleanup existing data as it will be replaced ( has no external id so we cannot simply update it )
- fetchData()
- getUniqueIdentifier()
- handleExistingItem()
- log()
- reportErrors()
- updateItem()
- writeItem()
- writeItems() — Write list of items to DB,