public function addModel(Model $model)
 {
     if (isset($this->models[$model->getName()])) {
         throw new ModelAlreadyDefined("Model " . $model->getName() . " is already defined.");
     }
     // Set error container
     $model->setErrors($this->errors);
     // Add the model.
     $this->models[$model->getName()] = $model;
 }
 public function setErrors(ErrorCollection $errors)
 {
     parent::setErrors($errors);
     $this->model->setErrors($errors);
 }