@@ -24,17 +24,17 @@ |
||
24 | 24 | #[ApiResource( |
25 | 25 | operations: [ |
26 | 26 | new Get(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
27 | - new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['inventory:write']]), |
|
27 | + new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: [ 'groups' => [ 'inventory:write' ] ]), |
|
28 | 28 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
29 | 29 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
30 | 30 | new GetCollection(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
31 | 31 | ], |
32 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
33 | - normalizationContext: ['groups' => ['inventory:read']], |
|
34 | - denormalizationContext: ['groups' => ['inventory:write']] |
|
35 | -)] |
|
36 | -#[ApiFilter(OrderFilter::class, properties: ['inventory', 'type'])] |
|
37 | -#[ApiFilter(SearchFilter::class, properties: ['id' => 'exact', 'inventory' => 'partial', 'type' => 'exact', 'people' => 'exact'])] |
|
32 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
33 | + normalizationContext: [ 'groups' => [ 'inventory:read' ] ], |
|
34 | + denormalizationContext: [ 'groups' => [ 'inventory:write' ] ] |
|
35 | +) ] |
|
36 | +#[ApiFilter(OrderFilter::class, properties: [ 'inventory', 'type' ]) ] |
|
37 | +#[ApiFilter(SearchFilter::class, properties: [ 'id' => 'exact', 'inventory' => 'partial', 'type' => 'exact', 'people' => 'exact' ]) ] |
|
38 | 38 | class Inventory |
39 | 39 | { |
40 | 40 | /** |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | #[ApiResource( |
30 | 30 | operations: [ |
31 | 31 | new Get(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
32 | - new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['product:write']]), |
|
32 | + new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: [ 'groups' => [ 'product:write' ] ]), |
|
33 | 33 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
34 | 34 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
35 | 35 | new GetCollection(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
36 | 36 | ], |
37 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
38 | - normalizationContext: ['groups' => ['product:read']], |
|
39 | - denormalizationContext: ['groups' => ['product:write']] |
|
40 | -)] |
|
41 | -#[ApiFilter(OrderFilter::class, properties: ['product', 'price', 'description'])] |
|
42 | -#[ApiFilter(RandomOrderFilter::class)] |
|
37 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
38 | + normalizationContext: [ 'groups' => [ 'product:read' ] ], |
|
39 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
40 | +) ] |
|
41 | +#[ApiFilter(OrderFilter::class, properties: [ 'product', 'price', 'description' ]) ] |
|
42 | +#[ApiFilter(RandomOrderFilter::class) ] |
|
43 | 43 | class Product |
44 | 44 | { |
45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @ORM\GeneratedValue(strategy="IDENTITY") |
50 | 50 | * @Groups({"product_category:read","product:read","order_product:read"}) |
51 | 51 | */ |
52 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
52 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
53 | 53 | private $id; |
54 | 54 | |
55 | 55 | /** |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | * @ORM\Column(name="product", type="string", length=255, nullable=false) |
58 | 58 | * @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"}) |
59 | 59 | */ |
60 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'partial'])] |
|
60 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'partial' ]) ] |
|
61 | 61 | private $product; |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @ORM\OneToMany(targetEntity="ProductFile", mappedBy="product") |
65 | 65 | * @Groups({"product:read","product_category:read","order_product:read"}) |
66 | 66 | */ |
67 | - #[ApiFilter(filterClass: ExistsFilter::class, properties: ['productFiles'])] |
|
68 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productFiles.file.fileType' => 'exact'])] |
|
67 | + #[ApiFilter(filterClass: ExistsFilter::class, properties: [ 'productFiles' ]) ] |
|
68 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productFiles.file.fileType' => 'exact' ]) ] |
|
69 | 69 | private $productFiles; |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @ORM\OneToMany(targetEntity="ProductCategory", mappedBy="product") |
73 | 73 | */ |
74 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCategory.category' => 'exact'])] |
|
74 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCategory.category' => 'exact' ]) ] |
|
75 | 75 | private $productCategory; |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
80 | 80 | * @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"}) |
81 | 81 | */ |
82 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['sku' => 'partial'])] |
|
82 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'sku' => 'partial' ]) ] |
|
83 | 83 | private $sku = null; |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
88 | 88 | * @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"}) |
89 | 89 | */ |
90 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['type' => 'exact'])] |
|
90 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'type' => 'exact' ]) ] |
|
91 | 91 | private $type = 'product'; |
92 | 92 | |
93 | 93 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
103 | 103 | * @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"}) |
104 | 104 | */ |
105 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCondition' => 'exact'])] |
|
105 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCondition' => 'exact' ]) ] |
|
106 | 106 | private $productCondition = 'new'; |
107 | 107 | |
108 | 108 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @ORM\Column(name="featured", type="boolean", nullable=false, options={"default"="0"}) |
118 | 118 | * @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"}) |
119 | 119 | */ |
120 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['featured' => 'exact'])] |
|
120 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'featured' => 'exact' ]) ] |
|
121 | 121 | private $featured = false; |
122 | 122 | |
123 | 123 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
126 | 126 | * @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"}) |
127 | 127 | */ |
128 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['active' => 'exact'])] |
|
128 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'active' => 'exact' ]) ] |
|
129 | 129 | private $active = true; |
130 | 130 | |
131 | 131 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * }) |
137 | 137 | * @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"}) |
138 | 138 | */ |
139 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])] |
|
139 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'company' => 'exact' ]) ] |
|
140 | 140 | private $company; |
141 | 141 | |
142 | 142 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * }) |
168 | 168 | * @Groups({"product:read", "product:write"}) |
169 | 169 | */ |
170 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['defaultOutInventory' => 'exact'])] |
|
170 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'defaultOutInventory' => 'exact' ]) ] |
|
171 | 171 | private $defaultOutInventory; |
172 | 172 | |
173 | 173 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * }) |
179 | 179 | * @Groups({"product:read", "product:write"}) |
180 | 180 | */ |
181 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['defaultInInventory' => 'exact'])] |
|
181 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'defaultInInventory' => 'exact' ]) ] |
|
182 | 182 | private $defaultInInventory; |
183 | 183 | |
184 | 184 | public function __construct() |
@@ -26,17 +26,17 @@ |
||
26 | 26 | #[ApiResource( |
27 | 27 | operations: [ |
28 | 28 | new Get(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
29 | - new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['product_inventory:write']]), |
|
29 | + new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: [ 'groups' => [ 'product_inventory:write' ] ]), |
|
30 | 30 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
31 | 31 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
32 | 32 | new GetCollection(security: 'is_granted(\'IS_AUTHENTICATED_ANONYMOUSLY\')'), |
33 | 33 | ], |
34 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
35 | - normalizationContext: ['groups' => ['product_inventory:read']], |
|
36 | - denormalizationContext: ['groups' => ['product_inventory:write']] |
|
37 | -)] |
|
38 | -#[ApiFilter(OrderFilter::class, properties: ['id', 'available', 'sales', 'ordered', 'transit'])] |
|
39 | -#[ApiFilter(SearchFilter::class, properties: ['id' => 'exact', 'inventory' => 'exact', 'product' => 'exact', 'productUnity' => 'exact'])] |
|
34 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
35 | + normalizationContext: [ 'groups' => [ 'product_inventory:read' ] ], |
|
36 | + denormalizationContext: [ 'groups' => [ 'product_inventory:write' ] ] |
|
37 | +) ] |
|
38 | +#[ApiFilter(OrderFilter::class, properties: [ 'id', 'available', 'sales', 'ordered', 'transit' ]) ] |
|
39 | +#[ApiFilter(SearchFilter::class, properties: [ 'id' => 'exact', 'inventory' => 'exact', 'product' => 'exact', 'productUnity' => 'exact' ]) ] |
|
40 | 40 | class ProductInventory |
41 | 41 | { |
42 | 42 | /** |