Comments: on this page. Click to read or post your own.
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,
Located in /sapphire/dev/BulkLoader.php (line 17)
Object | --ViewableData | --BulkLoader
| Class | Description |
|---|---|
| CsvBulkLoader | Uses the fgetcsv() function to process CSV input. |
Override this on subclasses to give the specific functions names.
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.
The column count should match the count of array elements, fill with NULL values if you want to skip certain columns.
You can also combine $hasHeaderRow = true and $columnMap and omit the NULL values in your map.
Supports one-level chaining of has_one relations and properties with dot notation (e.g. Team.Title). The first part has to match a has_one relation name (not necessarily the classname of the used relation).
Specifies how to determine duplicates based on one or more provided fields in the imported data, matching to properties on the used DataObject class.
Alternatively the array values can contain a callback method (see example for implementation details). If multiple checks are specified, the first one "wins".
Each row in the imported dataset should map to one instance of this class (with optional property translation through {@self::$columnMaps}.
Find a has_one relation based on a specific column value.
Inherited from ViewableData
ViewableData::$casting
ViewableData::$castingHelperPair_cache
ViewableData::$customisedObj
ViewableData::$failover
ViewableData::$iteratorPos
ViewableData::$iteratorTotalItems
ViewableData::$namedAs
ViewableData::$parent
ViewableData::$_natural_cache
ViewableData::$_object_cache
ViewableData::$_xml_cache
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Get a specification of all available columns and relations on the used model.
Useful for generation of spec documents for technical end users.
Return Format: <example> array( 'fields' => array('myFieldName'=>'myDescription'), 'relations' => array('myRelationName'=>'myDescription'), ) </example>
Return a FieldSet containing all the options for this form; this
doesn't include the actual upload field itself
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 DataObject, so this is mainly a customization method.
Preview a file import (don't write anything to the database).
Useful to analyze the input and give the users a chance to influence it through a UI.
Process every record in the file
Process a single record from the file.
Return a human-readable name for this object.
It defaults to the class name can be overridden by setting the static variable $title
Inherited From ViewableData
ViewableData::ATT_val()
ViewableData::BaseHref()
ViewableData::buildCastingHelperCache()
ViewableData::cachedCall()
ViewableData::castingHelper()
ViewableData::castingHelperPair()
ViewableData::castingObjectCreator()
ViewableData::castingObjectCreatorPair()
ViewableData::CSSClasses()
ViewableData::CurrentMember()
ViewableData::CurrentPage()
ViewableData::customise()
ViewableData::Debug()
ViewableData::defineMethods()
ViewableData::escapeTypeForField()
ViewableData::Even()
ViewableData::EvenOdd()
ViewableData::First()
ViewableData::FirstLast()
ViewableData::getField()
ViewableData::getIterator()
ViewableData::getXMLValues()
ViewableData::hasField()
ViewableData::HasPerm()
ViewableData::hasValue()
ViewableData::i18nLocale()
ViewableData::IsAjax()
ViewableData::iteratorProperties()
ViewableData::JS_val()
ViewableData::Last()
ViewableData::Me()
ViewableData::Middle()
ViewableData::MiddleString()
ViewableData::obj()
ViewableData::Odd()
ViewableData::Pos()
ViewableData::RAW_val()
ViewableData::renderWith()
ViewableData::SecurityID()
ViewableData::setCustomisedObj()
ViewableData::setField()
ViewableData::SQL_val()
ViewableData::ThemeDir()
ViewableData::Top()
ViewableData::TotalItems()
ViewableData::val()
ViewableData::XML_val()
ViewableData::__get()
ViewableData::__isset()
ViewableData::__set()
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Sun, 19 Oct 2008 06:38:31 +1300 by phpDocumentor 1.3.2