wiki/content/20201112130816-notblank_allownull.md

28 lines
410 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-12
2024-05-06 20:40:05 +00:00
id: 47dd501e-a567-481a-8d85-5eb1cd0bad15
title: NotBlank allowNull
---
# Description
The default option is `false`. If set to true then `null` values will be
considered valid.
# Syntax
``` php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class SomeEntity
{
/**
* @Assert\NotBlank(allowNull = true)
*/
protected $someProperty;
}
```