Skip to content

Instantly share code, notes, and snippets.

@xaptronic
Created November 7, 2011 14:24
Show Gist options
  • Save xaptronic/1345154 to your computer and use it in GitHub Desktop.
Save xaptronic/1345154 to your computer and use it in GitHub Desktop.
Potential for sfDoctrineRouteCollection to pass method_for_query to sfDoctrineRoutes
listings:
class: sfDoctrineRouteCollection
options:
model: Listing
with_wildcard_routes: true
method_for_query:
list: oldestToNewest
object: customObjectMethod
other_action: myCustomMethod
protected function getRouteForList()
{
return new $this->routeClass(
sprintf('%s.:sf_format', $this->options['prefix_path']),
array_merge(array('module' => $this->options['module'], 'action' => $this->getActionMethod('list'), 'sf_format' => 'html'), $this->options['default_params']),
array_merge($this->options['requirements'], array('sf_method' => array('get', 'head'))),
- array('model' => $this->options['model'], 'type' => 'list', 'method' => $this->options['model_methods']['list'])
+ array('model' => $this->options['model'], 'type' => 'list', 'method' => $this->options['model_methods']['list'], 'method_for_query' => $this->options['method_for_query']['list'])
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment