W
W
wittyrider2015-08-11 20:13:27
symfony
wittyrider, 2015-08-11 20:13:27

Doctrine + ParamConverter error when using repository_method?

controller:

/**
     * @Route(path="/user/{usernameOrEmail}/exists")
     * @ParamConverter("user", class="AppBundle:User",
     *     options={
     *         "repository_method" = "findByUsernameOrEmail",
     *         "mapping" = {"usernameOrEmail": "usernameOrEmail"}
     *     }
     * )
     * @param User $user
     */
    public function checkUsernameAction(User $user)
    {
    }

The repository method is executed, but the data is not injected into the controller and gives a 500 error.
Unable to guess how to get a Doctrine instance from the request information.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2015-08-11
@wittyrider

Maybe "map_method_signature" = true ?
symfony.com/doc/current/bundles/SensioFrameworkExt...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question