(static::model)::count($conditions); // 请问这种写法有什么弊端吗
trait SRV { public static function count(array $conditions) { if (empty(static::model)) { return 0;
} return (static::model)::count($conditions);
}
}class CommentSrv { // DB静态类
const model = CommentDB::class; use SRV;
}上面的代码在实际应用中可以正常使用,但是这种写法,我没有搜索到,不知道会不会产生什么后遗症..导致后期维护成本提高
GCT1015
阿波罗的战车
随时随地看视频慕课网APP