Skip to content

Commit

Permalink
Update TableRegistry calls in SqlProvisioner (CFM-74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Feb 28, 2024
1 parent 789de68 commit 4c5cb8a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ protected function syncEntity(
'connection' => ConnectionManager::get($dataSource)
];

$SpTable = TableRegistry::get(alias: $mconfig['name'], options: $options);
$SpTable = TableRegistry::getTableLocator()->get(alias: $mconfig['name'], options: $options);

try {
$curEntity = $SpTable->get($data->id);
Expand Down Expand Up @@ -578,13 +578,13 @@ public function syncReferenceData(int $id, string $dataSource='targetdb') {
'connection' => ConnectionManager::get($dataSource)
];

$SpTable = TableRegistry::get(alias: $m['name'], options: $options);
$SpTable = TableRegistry::getTableLocator()->get(alias: $m['name'], options: $options);

// Next get the source table model

// XXX don't we need to use the "plugin" datasource here and elsewhere?
// (test with job shell - maybe this is an RFE for Reprovision All)
$SrcTable = TableRegistry::get($m['source']);
$SrcTable = TableRegistry::getTableLocator()->get($m['source']);

// Pull the source records and then sync them to the target table.
// We expect reference data to be no larger than O(100) or maybe
Expand Down Expand Up @@ -670,7 +670,7 @@ protected function syncRelatedEntities(
'connection' => ConnectionManager::get($dataSource)
];

$SpTable = TableRegistry::get(alias: $mconfig['name'], options: $options);
$SpTable = TableRegistry::getTableLocator()->get(alias: $mconfig['name'], options: $options);

// We have the source values, but we need to convert them to arrays
// for patchEntities
Expand Down Expand Up @@ -754,7 +754,7 @@ protected function syncRelatedEntities(
'connection' => ConnectionManager::get($dataSource)
];

$SubTable = TableRegistry::get(alias: $subconfig['name'], options: $options);
$SubTable = TableRegistry::getTableLocator()->get(alias: $subconfig['name'], options: $options);

foreach($toDelete as $d) {
// We shouldn't get here if either $parentKey or $d->id is null...
Expand Down

0 comments on commit 4c5cb8a

Please sign in to comment.