Example #1
0
 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;
 }
Example #2
0
 protected function _applyDecorators($dataset)
 {
     foreach ($this->decorators as $decorator_class => $decorator_info) {
         $class_path = new WactClassPath($decorator_info['class_name'], $decorator_info['include_path']);
         $dataset = $class_path->createObject(array($dataset));
         $this->_addParamsToDataset($dataset, $decorator_info['params']);
     }
     return $dataset;
 }
Example #3
0
 protected function _createCommand($template)
 {
     $class_path = new WactClassPath($this->command, $this->include_path);
     return $class_path->createObject(array($template, $this->parent));
 }