diff --git a/api/src/Entity/Action.php b/api/src/Entity/Action.php index 17c9e6cb4..c2431a087 100644 --- a/api/src/Entity/Action.php +++ b/api/src/Entity/Action.php @@ -15,6 +15,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; @@ -48,6 +49,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Action { diff --git a/api/src/Entity/Application.php b/api/src/Entity/Application.php index 2afb2f2fd..bc355792b 100644 --- a/api/src/Entity/Application.php +++ b/api/src/Entity/Application.php @@ -16,6 +16,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; @@ -50,6 +51,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Application { diff --git a/api/src/Entity/CollectionEntity.php b/api/src/Entity/CollectionEntity.php index 97823f723..8d97afdb0 100644 --- a/api/src/Entity/CollectionEntity.php +++ b/api/src/Entity/CollectionEntity.php @@ -51,6 +51,7 @@ * }) * * @UniqueEntity("name") + * @UniqueEntity("reference") */ class CollectionEntity { diff --git a/api/src/Entity/Cronjob.php b/api/src/Entity/Cronjob.php index 862ba6b03..c05d7a116 100644 --- a/api/src/Entity/Cronjob.php +++ b/api/src/Entity/Cronjob.php @@ -13,6 +13,7 @@ use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; @@ -43,6 +44,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Cronjob { diff --git a/api/src/Entity/Endpoint.php b/api/src/Entity/Endpoint.php index 567c865c4..fb4087242 100644 --- a/api/src/Entity/Endpoint.php +++ b/api/src/Entity/Endpoint.php @@ -18,6 +18,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; @@ -57,6 +58,8 @@ * "entities", * "proxy" * }) + * + * @UniqueEntity("reference") */ class Endpoint { diff --git a/api/src/Entity/Entity.php b/api/src/Entity/Entity.php index a3091daed..0826b08d7 100644 --- a/api/src/Entity/Entity.php +++ b/api/src/Entity/Entity.php @@ -19,6 +19,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use phpDocumentor\Reflection\Types\This; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; @@ -63,6 +64,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Entity { diff --git a/api/src/Entity/Gateway.php b/api/src/Entity/Gateway.php index 723573295..9da2242f0 100644 --- a/api/src/Entity/Gateway.php +++ b/api/src/Entity/Gateway.php @@ -149,6 +149,7 @@ * }) * * @UniqueEntity("name") + * @UniqueEntity("reference") */ class Gateway { diff --git a/api/src/Entity/Mapping.php b/api/src/Entity/Mapping.php index 6187d7fd4..ebf53a2bc 100644 --- a/api/src/Entity/Mapping.php +++ b/api/src/Entity/Mapping.php @@ -15,6 +15,7 @@ use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; @@ -44,6 +45,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Mapping { diff --git a/api/src/Entity/Organization.php b/api/src/Entity/Organization.php index cd231688b..8fd89a1bb 100644 --- a/api/src/Entity/Organization.php +++ b/api/src/Entity/Organization.php @@ -16,6 +16,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; @@ -49,6 +50,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Organization { diff --git a/api/src/Entity/SecurityGroup.php b/api/src/Entity/SecurityGroup.php index ded4d2b26..457b35f2f 100644 --- a/api/src/Entity/SecurityGroup.php +++ b/api/src/Entity/SecurityGroup.php @@ -16,6 +16,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; use Symfony\Component\Validator\Constraints as Assert; @@ -50,6 +51,8 @@ * "name": "exact", * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class SecurityGroup { diff --git a/api/src/Entity/Template.php b/api/src/Entity/Template.php index a400d7a1a..1041057f2 100644 --- a/api/src/Entity/Template.php +++ b/api/src/Entity/Template.php @@ -13,6 +13,7 @@ use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Validator\Constraints as Assert; @@ -41,8 +42,11 @@ * @ApiFilter(DateFilter::class, strategy=DateFilter::EXCLUDE_NULL) * @ApiFilter(SearchFilter::class, properties={ * "supportedSchemas": "exact", - * "name": "exact" + * "name": "exact", + * "reference": "exact" * }) + * + * @UniqueEntity("reference") */ class Template { diff --git a/api/src/Entity/User.php b/api/src/Entity/User.php index 845610de9..1f26d4939 100644 --- a/api/src/Entity/User.php +++ b/api/src/Entity/User.php @@ -16,6 +16,7 @@ use Gedmo\Mapping\Annotation as Gedmo; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\MaxDepth; @@ -50,6 +51,8 @@ * "reference": "exact" * }) * + * @UniqueEntity("reference") + * * @ORM\Table(name="`user`") */ class User implements PasswordAuthenticatedUserInterface