\BetterBulkLoader
Synopsis
class BetterBulkLoader
extends BulkLoader
{
- // members
- public array $mappableFields = ;
- public array $transforms = ;
- public Closure $recordCallback;
- protected BulkLoaderSource $source;
- protected boolean $addNewRecords = true;
- protected boolean $relationLinkDefault = true;
- protected boolean $relationCreateDefault = true;
- protected boolean $publishPages = false;
- protected $mappableFields_cache;
- // methods
- public void setSource()
- public BulkLoaderSource getSource()
- public BulkLoader setRelationLinkDefault()
- public BulkLoader setRelationCreateDefault()
- public void setPublishPages()
- public void load()
- public void deleteExistingRecords()
- public DataList getDataList()
- public void preview()
- protected BulkLoader_Result processAll()
- protected void processRecord()
- protected array columnMapRecord()
- protected boolean hasRequiredData()
- protected void transformField()
- protected boolean isRelation()
- protected string getRelationName()
- public mixed findExistingObject()
- public array getMappableColumns()
- public array scaffoldMappableFields()
- protected array getMappableFieldsForClass()
- protected void formatMappingFieldLabel()
Hierarchy
Extends
- SilverStripe\Dev\BulkLoader
Members
protected
- $addNewRecords
—
boolean
Add new records while importing - $mappableFields_cache
—
array
Cache the result of getMappableColumns - $publishPages
—
boolean
Determines whether pages should be published during loading - $relationCreateDefault
—
boolean
The default behaviour creating relations - $relationLinkDefault
—
boolean
The default behaviour for linking relations - $source
—
BulkLoaderSource
Bulk loading source
public
-
$mappableFields
Fields and corresponding labels that can be mapped to. - $recordCallback
—
Closure
Specify a colsure to be run on every imported record. - $transforms
—
array
Transformation and relation handling
Methods
protected
- columnMapRecord() — Convert the record's keys to appropriate columnMap keys.
- formatMappingFieldLabel() — Format mapping field laabel
- getMappableFieldsForClass() — Get the fields and labels for a given class
- getRelationName() — Given a record field name, find out if this is a relation name and return the name.
- hasRequiredData() — Check if the given mapped record has the required data.
- isRelation() — Detect if a given record field is a relation field.
- processAll() — Import all records from the source.
- processRecord() — Import the given record
- transformField() — Perform field transformation or setting of data on placeholder.
public
- deleteExistingRecords() — Delete all existing records
- findExistingObject() — Find an existing objects based on one or more uniqueness columns specified via {@link self::$duplicateChecks}.
- getDataList() — Get the DataList of objects this loader applies to.
- getMappableColumns() — Get the field-label mapping of fields that data can be mapped into.
- getSource() — Get the BulkLoaderSource for this BulkLoader
- load()
- preview()
- scaffoldMappableFields() — Generate a field-label list of fields that data can be mapped into.
- setPublishPages()
- setRelationCreateDefault() — Set the default behaviour for creating new relation objects.
- setRelationLinkDefault() — Set the default behaviour for linking existing relation objects.
- setSource() — Set the BulkLoaderSource for this BulkLoader.