@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | ), |
34 | 34 | new Put( |
35 | 35 | security: 'is_granted(\'ROLE_CLIENT\')', |
36 | - denormalizationContext: ['groups' => ['product:write']] |
|
36 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
37 | 37 | ), |
38 | 38 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
39 | 39 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
40 | 40 | new GetCollection(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
41 | 41 | ], |
42 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
43 | - normalizationContext: ['groups' => ['product:read']], |
|
44 | - denormalizationContext: ['groups' => ['product:write']] |
|
45 | -)] |
|
42 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
43 | + normalizationContext: [ 'groups' => [ 'product:read' ] ], |
|
44 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
45 | +) ] |
|
46 | 46 | |
47 | -#[ApiFilter(OrderFilter::class, properties: ['id' => 'ASC', 'product' => 'ASC', 'price' => 'DESC'])] |
|
48 | -#[ApiFilter(RandomOrderFilter::class)] |
|
47 | +#[ApiFilter(OrderFilter::class, properties: [ 'id' => 'ASC', 'product' => 'ASC', 'price' => 'DESC' ]) ] |
|
48 | +#[ApiFilter(RandomOrderFilter::class) ] |
|
49 | 49 | |
50 | 50 | class Product |
51 | 51 | { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @ORM\GeneratedValue(strategy="IDENTITY") |
58 | 58 | * @Groups({"product_category:read","product:read","order_product:read"}) |
59 | 59 | */ |
60 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
60 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
61 | 61 | |
62 | 62 | private $id; |
63 | 63 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @ORM\Column(name="product", type="string", length=255, nullable=false) |
68 | 68 | * @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"}) |
69 | 69 | */ |
70 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'partial'])] |
|
70 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'partial' ]) ] |
|
71 | 71 | |
72 | 72 | private $product; |
73 | 73 | |
@@ -75,15 +75,15 @@ discard block |
||
75 | 75 | * @ORM\OneToMany(targetEntity="ProductFile", mappedBy="product") |
76 | 76 | * @Groups({"product:read","product_category:read"}) |
77 | 77 | */ |
78 | - #[ApiFilter(filterClass: ExistsFilter::class, properties: ['productFiles'])] |
|
79 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productFiles.file.fileType' => 'exact'])] |
|
78 | + #[ApiFilter(filterClass: ExistsFilter::class, properties: [ 'productFiles' ]) ] |
|
79 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productFiles.file.fileType' => 'exact' ]) ] |
|
80 | 80 | |
81 | 81 | private $productFiles; |
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @ORM\OneToMany(targetEntity="ProductCategory", mappedBy="product") |
85 | 85 | */ |
86 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCategory.category' => 'exact'])] |
|
86 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCategory.category' => 'exact' ]) ] |
|
87 | 87 | |
88 | 88 | private $productCategory; |
89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
94 | 94 | * @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"}) |
95 | 95 | */ |
96 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['sku' => 'partial'])] |
|
96 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'sku' => 'partial' ]) ] |
|
97 | 97 | |
98 | 98 | private $sku = NULL; |
99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
104 | 104 | * @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"}) |
105 | 105 | */ |
106 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['type' => 'exact'])] |
|
106 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'type' => 'exact' ]) ] |
|
107 | 107 | private $type = 'product'; |
108 | 108 | |
109 | 109 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
121 | 121 | * @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"}) |
122 | 122 | */ |
123 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCondition' => 'exact'])] |
|
123 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCondition' => 'exact' ]) ] |
|
124 | 124 | |
125 | 125 | private $productCondition = 'new'; |
126 | 126 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @ORM\Column(name="featured", type="boolean", nullable=false, options={"default"="0"}) |
141 | 141 | * @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"}) |
142 | 142 | */ |
143 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['featured' => 'exact'])] |
|
143 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'featured' => 'exact' ]) ] |
|
144 | 144 | |
145 | 145 | private $featured = false; |
146 | 146 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
151 | 151 | * @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"}) |
152 | 152 | */ |
153 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['active' => 'exact'])] |
|
153 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'active' => 'exact' ]) ] |
|
154 | 154 | |
155 | 155 | private $active = true; |
156 | 156 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * }) |
164 | 164 | * @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"}) |
165 | 165 | */ |
166 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])] |
|
166 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'company' => 'exact' ]) ] |
|
167 | 167 | |
168 | 168 | private $company; |
169 | 169 |