Events

Several events are triggered during the external import process in order to provide entry points for custom actions, improving the flexibility of the whole tool. Some events are not triggered when running in preview mode.

All events may throw the special exception \Cobweb\ExternalImport\Exception\CriticalFailureException. This will cause their "parent" step to abort. More details in the chapter about critical exceptions. Any other exception will just be logged (depending on your logging configuration).

For usage, see the core documentation about PSR-14 events.

Process connector parameters

class \Cobweb\ExternalImport\Event\ ProcessConnectorParametersEvent

This allows for dynamic manipulation of the parameters array before it is passed to the connector.

getParameters ( )

Returns the connector parameters.

setParameters ( array $parameters)

Sets the (modified) connector parameters.

getExternalConfiguration ( )

Instance of \Cobweb\ExternalImport\Domain\Model\Configuration with the current import configuration.

Substructure Preprocess

class \Cobweb\ExternalImport\Event\ SubstructurePreprocessEvent

This event is triggered whenever a data structure is going to be handled by the substructureFields property. It is fired just before the directives defined in the substructureFields property are applied and makes it possible to change the substructure.

getSubstructureConfiguration ( )

Returns the corresponding substructureFields configuration.

getColumn ( )

Returns the name of the column being handled.

getDataType ( )

Returns the type of data being handled ("array" or "xml").

getStructure ( )

Returns the structure being handled.

setStructure ( mixed $structure)

Sets the (modified) structure. This must be an array for array-type data or a \DomNodeList for XML-type data. Check the incoming type using the getDataType() method.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.

Update Record Preprocess

class \Cobweb\ExternalImport\Event\ UpdateRecordPreprocessEvent

This event is triggered just before a record is registered for update in the database. It is triggered for each record individually.

The event may throw the special exception \Cobweb\ExternalImport\Exception\InvalidRecordException, in which case the record will be removed from the dataset to be saved.

getUid ( )

Returns the primary key of the record (since we are talking about an update operation, the record exists in the database and thus has a valid primary key).

getRecord ( )

Returns the record being handled.

setRecord ( array $record)

Sets the (modified) record.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.

Insert Record Preprocess

class \Cobweb\ExternalImport\Event\ InsertRecordPreprocessEvent

Similar to the "Update Record Preprocess" event above, but for the insert operation. It may also throw \Cobweb\ExternalImport\Exception\InvalidRecordException.

Delete Record Preprocess

class \Cobweb\ExternalImport\Event\ DeleteRecordsPreprocessEvent

This event is triggered just before any record is deleted. It can manipulate the list of primary keys of records that will eventually be deleted.

Note that even if this event throws the \Cobweb\ExternalImport\Exception\CriticalFailureException, the data to update or insert will already have been saved.

getRecords ( )

Returns the list of records to be deleted (primary keys).

setRecords ( array $records)

Sets the (modified) list of records.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.

Datamap Postprocess

class \Cobweb\ExternalImport\Event\ DatamapPostprocessEvent

This event is triggered after all records have been updated or inserted using the TYPO3 Core Engine. It can be used for any follow-up operation. The event has the following API:

Note that even if this event throws the \Cobweb\ExternalImport\Exception\CriticalFailureException, the data to update or insert will already have been saved.

getData ( )

Returns the list of records keyed to their primary keys (including the new primary keys for the inserted records). Each record contains an additional field called tx_externalimport:status with a value of either "insert" or "update" depending on which operation was performed on the record.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.

Cmdmap Postprocess

class \Cobweb\ExternalImport\Event\ CmdmapPostprocessEvent

This event is triggered after all records have been deleted using the TYPO3 Core Engine. The event has the following API:

Note that even if this event throws the \Cobweb\ExternalImport\Exception\CriticalFailureException, the records will already have been deleted.

getData ( )

Returns the list of primary keys of the deleted records.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.

Report

class \Cobweb\ExternalImport\Event\ ReportEvent

This event is triggered in the ReportEvent step. It allows for custom reporting. It also triggers the reporting webhook.

getImporter ( )

Current instance of \Cobweb\ExternalImport\Importer.