Bulk data transfer functionality.
This interface declares methods common for handlers that support bulk data transfers.
Description:
There are two handler participating in bulk data transfer: source and destination. Each of the handlers must implement ezcDbSchemaHandlerDataTransfer interface.
The source handler implements transfer() method. This method transfers all the tables in storage one-by-one.
For each of the tables we transfer data of, the source handler calls setTableBeingTransferred() method on the destination handler.
For each row being transferred, the source handler calls saveRow() method on the destination handler.
Besides, when the transfer starts, we call destination handler's openTransferDestination() method, and when the transfer finishes, we call destination handler's closeTransferDestination() method.
Here is a typical implementation of transfer() method:
The destination handler should implement the following methods:
Source for this file: /DatabaseSchema/src/handlers/data_transfer.php
public void |
closeTransferDestination(
)
Tell destination handler that there is no more data to transfer. [destination] |
public void |
openTransferDestination(
$storage
, $storageType
)
Prepare destination handler for transfer [destination]. |
public void |
saveRow(
$row
)
Save given row. [destination] |
public void |
setTableBeingTransferred(
$tableName
, [ $tableFields
= null] )
Start to transfer data of the next table. [destination] |
public void |
transfer(
$storage
, $storageType
, $dstHandler
)
Actually transfer data [source]. |
Tell destination handler that there is no more data to transfer. [destination]
Prepare destination handler for transfer [destination].
Name | Type | Description |
---|---|---|
$storage |
||
$storageType |
Save given row. [destination]
Name | Type | Description |
---|---|---|
$row |
Start to transfer data of the next table. [destination]
Name | Type | Description |
---|---|---|
$tableName |
||
$tableFields |
Actually transfer data [source].
Name | Type | Description |
---|---|---|
$storage |
||
$storageType |
||
$dstHandler |