I have a Doctrine entity that has boolean field. Should I add Symfony validation for it (for type boolean), or my form is correctly validated by inferring the type automatically?
class Entity
{
/**
* @ORM\Column(type="boolean")
* @Assert\.... <- do I have to apply any Symfony assertion here?
*/
private $isActive;
}
No, you have only two cases. Value is present or not - so true or false. I imagine a validator only in one case if this checkbox has to be set by user always like "accept disclaimer" during registration process
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With