Skip to content

Commit

Permalink
feat(ParamConverter): add named ParamConvert
Browse files Browse the repository at this point in the history
this allow the PropelParamConvert to be used by name "propel"
Priority also lowered from maximum 10 to 1 #246
  • Loading branch information
jaugustin committed Sep 23, 2013
1 parent 2c0342f commit 1330e3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Resources/config/converters.xml
Expand Up @@ -10,7 +10,7 @@

<services>
<service id="propel.converter.propel.orm" class="%propel.converter.propel.class%">
<tag name="request.param_converter" priority="10" />
<tag name="request.param_converter" converter="propel" priority="1" />

<call method="setRouter">
<argument type="service" id="router" on-invalid="null" />
Expand Down
23 changes: 19 additions & 4 deletions Resources/doc/param_converter.markdown
Expand Up @@ -27,8 +27,8 @@ public function myAction(Post $post)
}
```

**New** with last version of `SensioFrameworkExtraBundle`,
you can ommit the `class` parameter if your controller parameter is typed,
**New** with last version of `SensioFrameworkExtraBundle`,
you can ommit the `class` parameter if your controller parameter is typed,
this is usefull when you need to set extra `options`.

``` php
Expand Down Expand Up @@ -109,10 +109,25 @@ public function myAction(Post $post)
{
}
```
Accepted parmeters for join :
Accepted parameters for join :

* left, LEFT, left join, LEFT JOIN, left_join, LEFT_JOIN
* left, LEFT, left join, LEFT JOIN, left_join, LEFT_JOIN
* right, RIGHT, right join, RIGHT JOIN, right_join, RIGHT_JOIN
* inner, INNER, inner join, INNER JOIN, inner_join, INNER_JOIN

#### Named converter ####

If you have a conflict with another ParamConverter you can force the `PropelParamConverter` with the `converter` option.

``` php
<?php

/**
* @ParamConverter("post", converter="propel")
*/
public function myAction(Post $post)
{
}
```

[Back to index](index.markdown)

0 comments on commit 1330e3e

Please sign in to comment.