Class BulkLoader
A base for bulk loaders of content into the SilverStripe database. Bulk loaders give SilverStripe authors the ability to do large-scale uploads into their Sapphire databases.
You can configure column-handling,
- Object
-
ViewableData
implements
IteratorAggregate
-
BulkLoader
Direct known subclasses
Indirect known subclasses
Package: cms\bulkloading
Author: Ingo Schommer, Silverstripe Ltd. (<firstname>@silverstripe.com)
See: http://rfc.net/rfc4180.html
Located at sapphire/dev/BulkLoader.php
Methods summary
public
|
|
public
|
|
public
array
|
|
abstract protected
|
|
abstract protected
|
#
processRecord( array $record, array $columnMap, mixed & $result, boolean $preview = false )
Process a single record from the file. |
public
|
#
getOptionFields( )
Return a FieldSet containing all the options for this form; this doesn't include the actual upload field itself |
public
string
|
|
public
array
|
#
getImportSpec( )
Get a specification of all available columns and relations on the used model. Useful for generation of spec documents for technical end users. |
protected
boolean
|
#
isNullValue( mixed $val, string $fieldName = null )
Determines if a specific field is null. Can be useful for unusual "empty"
flags in the file, e.g. a "(not set)" value. The usual DBField::isNull()
checks apply when writing the |
Methods inherited from ViewableData
ATT_val(),
BaseHref(),
CSSClasses(),
ColumnBreak(),
ColumnCalc(),
ColumnNumber(),
ColumnPad(),
ColumnPos(),
CurrentMember(),
CurrentPage(),
Debug(),
Even(),
EvenOdd(),
First(),
FirstLast(),
HasPerm(),
IsAjax(),
JS_val(),
Last(),
Me(),
Middle(),
MiddleString(),
Modulus(),
MultipleOf(),
Odd(),
Pos(),
RAW_val(),
SQL_val(),
ThemeDir(),
ThemeName(),
Top(),
TotalItems(),
XML_val(),
__get(),
__isset(),
__set(),
buildCastingCache(),
cachedCall(),
castingClass(),
castingHelper(),
castingHelperPair(),
castingObjectCreator(),
castingObjectCreatorPair(),
customise(),
defineMethods(),
escapeTypeForField(),
getField(),
getIterator(),
getSecurityID(),
getXMLValues(),
hasField(),
hasValue(),
i18nLocale(),
iteratorProperties(),
obj(),
renderWith(),
setCustomisedObj(),
setField()
Methods inherited from Object
__call(),
__toString(),
__wakeup(),
addMethodsFrom(),
addStaticVars(),
addWrapperMethod(),
add_extension(),
add_static_var(),
allMethodNames(),
cacheToFile(),
cacheToFileWithArgs(),
clearCache(),
combined_static(),
create(),
createMethod(),
create_from_string(),
exists(),
extInstance(),
extend(),
getCustomClass(),
getExtensionInstance(),
getExtensionInstances(),
get_extensions(),
get_static(),
hasExtension(),
hasMethod(),
has_extension(),
invokeWithExtensions(),
is_a(),
loadCache(),
parentClass(),
parse_class_spec(),
remove_extension(),
sanitiseCachename(),
saveCache(),
set_stat(),
set_static(),
set_uninherited(),
stat(),
strong_create(),
uninherited(),
uninherited_static(),
useCustomClass()
Magic methods summary
Properties summary
public
string
|
$objectClass |
#
Each row in the imported dataset should map to one instance of this class (with optional property translation through {@self::$columnMaps}. |
public static
string
|
$title |
#
Override this on subclasses to give the specific functions names. |
public
array
|
$columnMap |
#
Map columns to DataObject-properties. If not specified, we assume the first row in the file contains the column headers. The order of your array should match the column order. |
public
array
|
$relationCallbacks |
#
Find a has_one relation based on a specific column value. |
public
array
|
$duplicateChecks |
#
Specifies how to determine duplicates based on one or more provided fields in
the imported data, matching to properties on the used |
public
|
$deleteExistingRecords |
#
$clearBeforeImport Delete ALL records before importing. |
Properties inherited from ViewableData
$casting,
$customisedObject,
$default_cast,
$failover,
$iteratorPos,
$iteratorTotalItems