我的那个代码太多了就不贴了,我简化一下
abstract class Model implements CriteriaInterface{
public $model;
public function __construct(Container $container,Collection $collection)
{
$this->container = $container;
$this->makeModel();
}
abstract function model();
public function makeModel() {
$model = $this->container->make($this->model());
return $this->model = $model
}
}
class userModel extends Model{
public function model(){
return 'App\User';
}
}
流程就这样的
现在问题来了
App\User模型的构造函数需要传入一个数组。
要怎么传?