symfony-validator Questions

5

Solved

I need to convert an object of type ConstraintViolationListInterface to a single exception for further logging, where the message is a concatenation of the messages from each constraint violation o...
Tobytobye asked 18/12, 2017 at 20:32

3

Solved

So here is the scenario: I have a radio button group. Based on their value, I should or shouldn't validate other three fields (are they blank, do they contain numbers, etc). Can I pass all these v...
Hakon asked 13/5, 2015 at 6:4

1

Solved

I have the following entity (only attached the relevant parts): use ApiPlatform\Core\Annotation\ApiResource; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert;...
Heerlen asked 14/2, 2020 at 13:52

1

I have 2 mapped entities, Box class Box{ //[...] /** * @ORM\ManyToMany(targetEntity="Candy", cascade={"remove"}) * @ORM\OrderBy({"power" = "DESC"}) * @ORM\JoinTable(name="box_candies", * jo...
Neils asked 30/12, 2015 at 4:45

2

Solved

I need to validate an email passed by user: private function validate($value): bool { $violations = $this->validator->validate($value, [ new Assert\NotBlank(), new Assert\Email(), new Un...
Viscount asked 26/5, 2017 at 10:51

1

I'm creating a custom FormType called IntervalType. My IntervalType will have two fields, start and end and will be of type integer. This custom FormType will always be used without data_class. I ...
Ciera asked 21/3, 2017 at 18:30

2

Solved

I'm trying to compare dates in my validation. The documentation says it's possible but It's not documented. I'm using annotations and I want one date to be later that the other. How do I do this? ...
Obsession asked 20/4, 2016 at 12:48

3

Solved

I have a form with many fields and validation groups, these fields contain some view data transformers too. I need suppress the validation form partially (Groups based on the Submitted Data): use A...
Thorstein asked 19/2, 2016 at 14:43

3

Solved

Given this input: [ 'key' => 'value', ] How to validate to ensure that: key attribute exists Its value is an array (with any number of elements) I expected this constraint to work $con...
Spindle asked 24/6, 2015 at 5:22
1

© 2022 - 2024 — McMap. All rights reserved.