wiki/content/20201117104332-ulid_constraint.md

30 lines
450 B
Markdown
Raw Permalink Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-17
2024-05-06 20:40:05 +00:00
id: 5dbf9ea2-81ad-4b35-83ba-e4ab2e247c9a
title: ULID Constraint
---
# Syntax
``` php
// src/Entity/Product.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
*/
class Product
{
/**
* @ORM\Column(type="ulid")
* @Assert\Ulid
*/
private $someProperty;
// ...
}
```