[WIP] Repository method with arguments

Example:

I have set this:

    /**
     * @ParamConverter(
     *    "post",
     *    class="AcmeBlogBundle:Post",
     *    options={
     *        "repository_method" = "findForYmdLink",
     *        "mapping": {"year": "year", "month": "month", "day": "day", "permalink": "permalink"}
     *    }
     * )
     */

My repository method looks like this:

    public function findForYmdLink($year, $month, $day, $permalink)
    {
        $creationDate = \DateTime::createFromFormat('Ymd', $year.$month.$day);

        return $this->findOneBy(array(
            'creationDate' => $creationDate,
            'permalink' => $permalink,
            'published' => true,
        ));
    }

My Post entity doesn't have the fields day, month and year but has creationDate instead (DateTime). The current implementation of the converter doesn't pass the 3 fields because they are not in the metadata. I don't see why they should be if I pass a custom repository_method. This patch changes that behaviour.

With the current implementation, I would also have to change the repository method to this:

    public function findForYmdLink($params)
    {
        list($year, $month, $day, $permalink) = $params;
        ...

This patch changes that behaviour by calling invokeArgs on the reflectionMethod so the exact parameters are in the method signature.
@fabpot  what is wrong with that? Maybe I don't understand. It's a programmer error and is very clear at pointing what you did wrong. The route will make sure all parameters are present at runtime (user input or defaults), so if the programmer doesn't provide all parameters, it will throw an exception in the same way that it will trow an exception at line 170 when the mapping is wrong. When I call a repository method directly from my code and don't provide all parameters, it will also throw an (the same) exception.