@@ -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,15 +71,15 @@ 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 | |
79 | 79 | /** |
80 | 80 | * @ORM\OneToMany(targetEntity="ProductCategory", mappedBy="product") |
81 | 81 | */ |
82 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCategory.category' => 'exact'])] |
|
82 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCategory.category' => 'exact' ]) ] |
|
83 | 83 | |
84 | 84 | private $productCategory; |
85 | 85 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
90 | 90 | * @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"}) |
91 | 91 | */ |
92 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['sku' => 'partial'])] |
|
92 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'sku' => 'partial' ]) ] |
|
93 | 93 | |
94 | 94 | private $sku = NULL; |
95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
100 | 100 | * @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"}) |
101 | 101 | */ |
102 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['type' => 'exact'])] |
|
102 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'type' => 'exact' ]) ] |
|
103 | 103 | private $type = 'product'; |
104 | 104 | |
105 | 105 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
117 | 117 | * @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"}) |
118 | 118 | */ |
119 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCondition' => 'exact'])] |
|
119 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCondition' => 'exact' ]) ] |
|
120 | 120 | |
121 | 121 | private $productCondition = 'new'; |
122 | 122 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
136 | 136 | * @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"}) |
137 | 137 | */ |
138 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['active' => 'exact'])] |
|
138 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'active' => 'exact' ]) ] |
|
139 | 139 | |
140 | 140 | private $active = true; |
141 | 141 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * }) |
149 | 149 | * @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"}) |
150 | 150 | */ |
151 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])] |
|
151 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'company' => 'exact' ]) ] |
|
152 | 152 | |
153 | 153 | private $company; |
154 | 154 |