Hello,
I want to do quick import between databases, i've created service in DI for database im reading from. Before executing code below im doing TRUNCATE on local SQL table.
$entity->setReadConnectionService( 'service_for_reading' );
$cursor = $entity->find();
foreach ($cursor as $row) {
$row->create();
}
And im getting "Record cannot be created because it already exists".
Doing this doesn't help either:
foreach ($cursor as $row) {
$newEntity = new \EntityClass();
$newEntity->create( $row->toArray() );
}
ORM should recognise that read and write connections are diffrent before checking if record already exists, or there should be way to switch this checking off.