0

The case seemed fairly simple, there is a DTO object containing

class ConfirmationMessageDto
{
    /**
     * @var mixed
     *
     * @Assert\NotNull
     * @Assert\Type(type = "bool")
     */
     protected $success;

    /**
     * @var mixed
     *
     * @Assert\Type(type = "string")
     */
     protected $errorMessage;

     [setters and getters]
}

Now I'd like it to validate if the errorMessage is not null when $success === false. Can I do it in a simple way?

4

0

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.