fetcher_name = $fetcher_name; } function setIncludePath($include_path) { $this->include_path = $include_path; } function setAdditionalParam($param, $value) { $this->params[$param] = $value; } function setCacheDataset($flag) { $this->cache_dataset = $flag; } function getDataset() { if($this->dataset !== null && (boolean)$this->cache_dataset) return $this->dataset; $fetcher = $this->_createFetcher(); $this->dataset = $fetcher->fetch(); return $this->dataset; } protected function _createFetcher() { $class_path = new WactClassPath($this->fetcher_name, $this->include_path); $fetcher = $class_path->createObject(); foreach($this->params as $param => $value) { $method = WactTemplate :: toStudlyCaps('set_' . $param, false); if(in_array($param, $this->reserved_params)) $this->$method($value); elseif(method_exists($fetcher, $method)) $fetcher->$method($value); else throw new WactException('Fetcher "' .$this->fetcher_name. '" does not support method: '. $method); } return $fetcher; } } ?>