@@ -20,38 +20,38 @@ |
||
20 | 20 | new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'), |
21 | 21 | new Put( |
22 | 22 | security: 'is_granted(\'ROLE_CLIENT\')', |
23 | - denormalizationContext: ['groups' => ['product_file:write']] |
|
23 | + denormalizationContext: [ 'groups' => [ 'product_file:write' ] ] |
|
24 | 24 | ), |
25 | 25 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
26 | 26 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
27 | 27 | new GetCollection(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
28 | 28 | ], |
29 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
30 | - normalizationContext: ['groups' => ['product_file:read']], |
|
31 | - denormalizationContext: ['groups' => ['product_file:write']] |
|
32 | -)] |
|
33 | -#[ApiFilter(filterClass: SearchFilter::class, properties: ['file' => 'exact', 'file.fileType' => 'exact', 'product' => 'exact'])] |
|
34 | -#[ORM\Table(name: 'product_file')] |
|
35 | -#[ORM\Index(name: 'file_id', columns: ['file_id'])] |
|
36 | -#[ORM\Index(name: 'IDX_CDFC73564584665B', columns: ['product_id'])] |
|
37 | -#[ORM\UniqueConstraint(name: 'product_id', columns: ['product_id', 'file_id'])] |
|
38 | -#[ORM\Entity(repositoryClass: ProductFileRepository::class)] |
|
29 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
30 | + normalizationContext: [ 'groups' => [ 'product_file:read' ] ], |
|
31 | + denormalizationContext: [ 'groups' => [ 'product_file:write' ] ] |
|
32 | +) ] |
|
33 | +#[ApiFilter(filterClass: SearchFilter::class, properties: [ 'file' => 'exact', 'file.fileType' => 'exact', 'product' => 'exact' ]) ] |
|
34 | +#[ORM\Table(name: 'product_file') ] |
|
35 | +#[ORM\Index(name: 'file_id', columns: [ 'file_id' ]) ] |
|
36 | +#[ORM\Index(name: 'IDX_CDFC73564584665B', columns: [ 'product_id' ]) ] |
|
37 | +#[ORM\UniqueConstraint(name: 'product_id', columns: [ 'product_id', 'file_id' ]) ] |
|
38 | +#[ORM\Entity(repositoryClass: ProductFileRepository::class) ] |
|
39 | 39 | class ProductFile |
40 | 40 | { |
41 | - #[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
|
42 | - #[ORM\Id] |
|
43 | - #[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
44 | - #[Groups(['product:read', 'order_product:read', 'order_details:read', 'product_file:read', 'product_category:read'])] |
|
41 | + #[ORM\Column(name: 'id', type: 'integer', nullable: false) ] |
|
42 | + #[ORM\Id ] |
|
43 | + #[ORM\GeneratedValue(strategy: 'IDENTITY') ] |
|
44 | + #[Groups([ 'product:read', 'order_product:read', 'order_details:read', 'product_file:read', 'product_category:read' ]) ] |
|
45 | 45 | private int $id = 0; |
46 | 46 | |
47 | - #[ORM\JoinColumn(name: 'file_id', referencedColumnName: 'id')] |
|
48 | - #[ORM\ManyToOne(targetEntity: File::class)] |
|
49 | - #[Groups(['product:read', 'order_product:read', 'order_details:read', 'product_file:read', 'product_file:write', 'product_category:read'])] |
|
47 | + #[ORM\JoinColumn(name: 'file_id', referencedColumnName: 'id') ] |
|
48 | + #[ORM\ManyToOne(targetEntity: File::class) ] |
|
49 | + #[Groups([ 'product:read', 'order_product:read', 'order_details:read', 'product_file:read', 'product_file:write', 'product_category:read' ]) ] |
|
50 | 50 | private File $file; |
51 | 51 | |
52 | - #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id')] |
|
53 | - #[ORM\ManyToOne(targetEntity: Product::class)] |
|
54 | - #[Groups(['product_file:read', 'product_file:write'])] |
|
52 | + #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id') ] |
|
53 | + #[ORM\ManyToOne(targetEntity: Product::class) ] |
|
54 | + #[Groups([ 'product_file:read', 'product_file:write' ]) ] |
|
55 | 55 | private Product $product; |
56 | 56 | |
57 | 57 | public function getId(): int |