mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding a backwards compatible check to ClassRegistry::init() so it is still able to return classes that are not instance of Model
This commit is contained in:
parent
d63dde0fde
commit
31efa022df
1 changed files with 3 additions and 1 deletions
|
@ -137,7 +137,9 @@ class ClassRegistry {
|
|||
|
||||
if (class_exists($class)) {
|
||||
${$class} = new $class($settings);
|
||||
${$class} = (${$class} instanceof Model) ? ${$class} : null;
|
||||
if ($strict) {
|
||||
${$class} = (${$class} instanceof Model) ? ${$class} : null;
|
||||
}
|
||||
}
|
||||
if (!isset(${$class})) {
|
||||
if ($strict) {
|
||||
|
|
Loading…
Reference in a new issue