/** * Add a model in the models array * * @param Model $model * @param string $alias * @return Query */ public function addModel(Model $model, string $alias = null) : self { if ($alias === null) { $alias = $model->getId(); } $this->models[$alias] = $model; return $this; }