1

I'm trying to do something like this https://github.com/brikou/AcmePizzaBundle/blob/master/Entity/Factory/... in symfony2 beta1, but it simply does not trigger my validation callback.

When I try this http://symfony.com/doc/current/book/validation.html#getters

/**
     * @assert:True(message = "The token is invalid")
     */
    public function isTokenValid()
    {
        // return true or false
    }

it works, but i want callback validation with ExecutionContext. I hope that I can access DI container from here and retreive my services.

Any idea why @assert:callback(methods={"isValidFoo"}) is not working?

1
  • Please post your code. Make sure you are spelling the function name correctly. Commented Jul 7, 2011 at 21:38

1 Answer 1

2

Yes, those validation callback functions should not return true or false but add violations to an execution context. Check the documentation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.