File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -414,17 +414,19 @@ public function __get($property)
414414 $ class = static ::class;
415415 $ result = $ this ->orm ->get ($ property );
416416
417+ $ _has_method = [];
418+
417419 if ($ result !== null ) {
418420 $ method = 'get_ ' . $ property ;
419- if (method_exists ($ this , $ method )) {
421+ if ($ _has_method [ $ class ][ $ method ] ??= method_exists ($ this , $ method )) {
420422 return $ this ->$ method ($ result );
421423 }
422424
423425 return $ result ;
424426 }
425427
426428 $ method = 'missing_ ' . $ property ;
427- if (method_exists ($ this , $ method )) {
429+ if ($ _has_method [ $ class ][ $ method ] ??= method_exists ($ this , $ method )) {
428430 return $ this ->$ method ();
429431 }
430432
@@ -433,7 +435,7 @@ public function __get($property)
433435 }
434436
435437 $ method = $ property ;
436- if (method_exists ($ this , $ method )) {
438+ if ($ _has_method [ $ class ][ $ method ] ??= method_exists ($ this , $ method )) {
437439 if ($ property != self ::_get_id_column_name ($ class )) {
438440 $ relation = $ this ->$ property ();
439441
You can’t perform that action at this time.
0 commit comments