public function setModel($model) { if (!$model instanceof \SVMModel) { throw new \RuntimeException("Expected SVMModel"); } $this->model = $model; $this->model->save($this->modelFilename); }