@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | ), |
32 | 32 | new Put( |
33 | 33 | security: 'is_granted(\'ROLE_CLIENT\')', |
34 | - denormalizationContext: ['groups' => ['product:write']] |
|
34 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
35 | 35 | ), |
36 | 36 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
37 | 37 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
38 | 38 | new GetCollection(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
39 | 39 | ], |
40 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
41 | - normalizationContext: ['groups' => ['product:read']], |
|
42 | - denormalizationContext: ['groups' => ['product:write']] |
|
43 | -)] |
|
40 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
41 | + normalizationContext: [ 'groups' => [ 'product:read' ] ], |
|
42 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
43 | +) ] |
|
44 | 44 | |
45 | 45 | |
46 | 46 | class Product |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @ORM\GeneratedValue(strategy="IDENTITY") |
54 | 54 | * @Groups({"product_category:read","product:read","order_product:read"}) |
55 | 55 | */ |
56 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
56 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
57 | 57 | |
58 | 58 | private $id; |
59 | 59 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @ORM\Column(name="product", type="string", length=255, nullable=false) |
64 | 64 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
65 | 65 | */ |
66 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'partial'])] |
|
66 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'partial' ]) ] |
|
67 | 67 | |
68 | 68 | private $product; |
69 | 69 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | * @ORM\OneToMany(targetEntity="ProductFile", mappedBy="product") |
72 | 72 | * @Groups({"product:read","product_category:read"}) |
73 | 73 | */ |
74 | - #[ApiFilter(filterClass: ExistsFilter::class, properties: ['productFiles'])] |
|
75 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productFiles.file.fileType' => 'exact'])] |
|
74 | + #[ApiFilter(filterClass: ExistsFilter::class, properties: [ 'productFiles' ]) ] |
|
75 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productFiles.file.fileType' => 'exact' ]) ] |
|
76 | 76 | |
77 | 77 | private $productFiles; |
78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
83 | 83 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
84 | 84 | */ |
85 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['sku' => 'partial'])] |
|
85 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'sku' => 'partial' ]) ] |
|
86 | 86 | |
87 | 87 | private $sku = NULL; |
88 | 88 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
93 | 93 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
94 | 94 | */ |
95 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['type' => 'exact'])] |
|
95 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'type' => 'exact' ]) ] |
|
96 | 96 | private $type = 'product'; |
97 | 97 | |
98 | 98 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
110 | 110 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
111 | 111 | */ |
112 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCondition' => 'exact'])] |
|
112 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCondition' => 'exact' ]) ] |
|
113 | 113 | |
114 | 114 | private $productCondition = 'new'; |
115 | 115 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
129 | 129 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
130 | 130 | */ |
131 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['active' => 'exact'])] |
|
131 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'active' => 'exact' ]) ] |
|
132 | 132 | |
133 | 133 | private $active = true; |
134 | 134 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * }) |
142 | 142 | * @Groups({"product_category:read","product:read","product_group_product:read","order_product:read","order_product_queue:read","order:read","order_details:read","order:write","product:write"}) |
143 | 143 | */ |
144 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])] |
|
144 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'company' => 'exact' ]) ] |
|
145 | 145 | |
146 | 146 | private $company; |
147 | 147 |