소스 검색

fix: 修复命名空间不兼容

runphp 6 달 전
부모
커밋
eaa4531d88
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/Entity/BaseEntity.php

+ 5 - 1
src/Entity/BaseEntity.php

@@ -9,7 +9,11 @@ abstract class BaseEntity extends Entity
     protected function getOptions(): array
     {
         return [
-            'modelClass' => str_replace(['\\Entity\\', 'Entity'], ['\\Entity\\', 'Model'], static::class),
+            'modelClass' => str_replace(
+                ['\\Entity\\', '\\entity\\','Entity'], 
+                ['\\Model\\', '\\model\\', 'Model'], 
+                static::class
+            ),
         ];
     }
 }