Skip to content

Commit

Permalink
Merge pull request #30 from loannis/CO-2265_Fix_Tablelocator_get_error
Browse files Browse the repository at this point in the history
CO-2265_Fix_Tablelocator_get_error
  • Loading branch information
arlen authored Nov 8, 2021
2 parents 009a476 + 388cead commit 92f38bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/Lib/Identifier/Sequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Sequence extends ReferenceIdService {
*/

public function generate(\App\Model\Entity\Matchgrid $mgConfig, \ADOConnection $dbc) {
$MatchgridSettings = Cake\Datasource\FactoryLocator::get('MatchgridSettings');
$MatchgridSettings = Cake\Datasource\FactoryLocator::get('Table')->get('MatchgridSettings');

// We'll use the matchgrid ID rather than name in the sequence name to avoid
// issues if the matchgrid is renamed for some reason.
Expand Down
2 changes: 1 addition & 1 deletion app/src/Lib/Match/MatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function attachReferenceId(string $sor, string $sorid, AttributeManager $
*/

protected function generateReferenceId() {
$MatchgridSettings = FactoryLocator::get('MatchgridSettings');
$MatchgridSettings = FactoryLocator::get('Table')->get('MatchgridSettings');

if($MatchgridSettings->getReferenceIdMethod($this->mgConfig->id) == ReferenceIdEnum::Sequence) {
$IdService = new \App\Lib\Identifier\Sequence;
Expand Down
4 changes: 2 additions & 2 deletions app/src/Lib/Traits/MatchgridLinkTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function calculateMatchgridId(int $id) {
// Look up $linkAttr to get its Matchgrid. We currently assume only
// one level of nesting.

$linkTable = FactoryLocator::get($this->getPrimaryLinkTableName());
$linkTable = FactoryLocator::get('Table')->get($this->getPrimaryLinkTableName());

return $linkTable->calculateMatchgridId($obj->$linkAttr);
}
}
Expand Down

0 comments on commit 92f38bd

Please sign in to comment.