validate color (#2072)

This commit is contained in:
Kevin Papst
2020-10-28 20:01:08 +01:00
committed by GitHub
parent 82e1d6b917
commit 1444593bbd
8 changed files with 189 additions and 14 deletions

View File

@@ -11,9 +11,9 @@ namespace App\Entity;
use App\Constants;
use App\Export\Annotation as Exporter;
use App\Validator\Constraints as Constraints;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
trait ColorTrait
{
@@ -28,7 +28,7 @@ trait ColorTrait
* @Exporter\Expose(label="label.color")
*
* @ORM\Column(name="color", type="string", length=7, nullable=true)
* @Assert\Length(min=4, max=7, allowEmptyString=true)
* @Constraints\HexColor()
*/
private $color = null;