Skip to content

Commit

Permalink
Updated TableRegistry get to newer way, fixed typo in strtolower
Browse files Browse the repository at this point in the history
  • Loading branch information
zunnu committed Jan 23, 2023
1 parent df19c20 commit a546ee5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ private function _associations($model, $plugin = null)
{
$associationTypes = $this->getConfig('associationTypes');

if (empty($plugin) || strtolower($plugin == 'app')) {
$setModel = TableRegistry::get($model);
if (empty($plugin) || (!empty($plugin) && strtolower($plugin) == 'app')) {
$setModel = TableRegistry::getTableLocator()->get($model);
} else {
$setModel = TableRegistry::get($plugin . '.' . $model);
$setModel = TableRegistry::getTableLocator()->get($plugin . '.' . $model);
}

$associationsArray = [];
Expand Down

0 comments on commit a546ee5

Please sign in to comment.