File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ class Models
34
34
*/
35
35
public const KEY_BY_CLASS_ALIAS = 'class alias ' ;
36
36
37
+ protected static $ instance ;
38
+
37
39
/**
38
40
* Types.
39
41
* @var array
@@ -42,6 +44,7 @@ class Models
42
44
\Zhiyi \Plus \Models \FeedTopic::class => 'types/models/feed-topics ' ,
43
45
\Zhiyi \Plus \Models \User::class => 'users ' , /* 旧关系别名,保持不变 */
44
46
\Zhiyi \Plus \Models \Comment::class => 'comments ' , /* 旧关系别名,保持不变 */
47
+ \Zhiyi \Component \ZhiyiPlus \PlusComponentFeed \Models \Feed::class => 'feeds ' , /* 旧关系别名,保持不变 */
45
48
];
46
49
47
50
/**
@@ -72,4 +75,13 @@ public function all(?string $keyBy = self::KEY_BY_CLASSNAME): array
72
75
73
76
return static ::$ types ;
74
77
}
78
+
79
+ public static function __callStatic ($ method , $ params )
80
+ {
81
+ if (!static ::$ instance instanceof static) {
82
+ static ::$ instance = new static ;
83
+ }
84
+
85
+ return static ::$ instance ->$ method (...$ params );
86
+ }
75
87
}
You can’t perform that action at this time.
0 commit comments