public function setModel($model)
    {
        // convert the model class into an instance
        if (!is_object($model)) {
            $this->modelClass = $model;
            $model = new $model($this->modelId);
        } else {
            $this->modelId = $model->ids();
            $this->modelClass = get_class($model);
        }

        $this->model = $model;

        return $this;
    }