Created
November 7, 2011 14:24
-
-
Save xaptronic/1345154 to your computer and use it in GitHub Desktop.
Potential for sfDoctrineRouteCollection to pass method_for_query to sfDoctrineRoutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| listings: | |
| class: sfDoctrineRouteCollection | |
| options: | |
| model: Listing | |
| with_wildcard_routes: true | |
| method_for_query: | |
| list: oldestToNewest | |
| object: customObjectMethod | |
| other_action: myCustomMethod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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