Set and get method for the model associated with the `Query`. Will also set the source table, i.e. `$this->_config['source']`.

Parameters

  • string $model

Returns

string

Source

						public function model($model = null) {
		if ($model) {
			$this->_config['model'] = $model;
			$this->_config['source'] = $this->_config['source'] ?: $model::meta('source');
			$this->_config['alias'] = $this->_config['alias'] ?: $model::meta('name');
			$this->_config['name'] = $this->_config['name'] ?: $this->_config['alias'];
			return $this;
		}
		return $this->_config['model'];
	}