@@ -52,7 +52,6 @@ discard block |
||
52 | 52 | * @ORM\Id |
53 | 53 | * @ORM\GeneratedValue(strategy="IDENTITY") |
54 | 54 | * @Groups({"product_read"}) |
55 | - |
|
56 | 55 | */ |
57 | 56 | private $id; |
58 | 57 | |
@@ -69,7 +68,6 @@ discard block |
||
69 | 68 | * |
70 | 69 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
71 | 70 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
72 | - |
|
73 | 71 | */ |
74 | 72 | private $sku = NULL; |
75 | 73 | |
@@ -78,7 +76,6 @@ discard block |
||
78 | 76 | * |
79 | 77 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
80 | 78 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
81 | - |
|
82 | 79 | */ |
83 | 80 | private $type = 'product'; |
84 | 81 | |
@@ -87,7 +84,6 @@ discard block |
||
87 | 84 | * |
88 | 85 | * @ORM\Column(name="price", type="float", precision=10, scale=0, nullable=false) |
89 | 86 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
90 | - |
|
91 | 87 | */ |
92 | 88 | private $price = 0; |
93 | 89 | |
@@ -96,7 +92,6 @@ discard block |
||
96 | 92 | * |
97 | 93 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
98 | 94 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
99 | - |
|
100 | 95 | */ |
101 | 96 | private $productCondition = 'new'; |
102 | 97 | |
@@ -106,7 +101,6 @@ discard block |
||
106 | 101 | * |
107 | 102 | * @ORM\Column(name="description", type="string", length=0, nullable=false) |
108 | 103 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
109 | - |
|
110 | 104 | */ |
111 | 105 | private $description = ''; |
112 | 106 | |
@@ -115,7 +109,6 @@ discard block |
||
115 | 109 | * |
116 | 110 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
117 | 111 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
118 | - |
|
119 | 112 | */ |
120 | 113 | private $active = true; |
121 | 114 | |
@@ -127,7 +120,6 @@ discard block |
||
127 | 120 | * @ORM\JoinColumn(name="company_id", referencedColumnName="id") |
128 | 121 | * }) |
129 | 122 | * @Groups({"product_read","order_product_read","order_read","product_write"}) |
130 | - |
|
131 | 123 | */ |
132 | 124 | private $company; |
133 | 125 |
@@ -32,15 +32,15 @@ |
||
32 | 32 | #[ApiResource( |
33 | 33 | operations: [ |
34 | 34 | new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'), |
35 | - new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['product_write']]), |
|
35 | + new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: [ 'groups' => [ 'product_write' ] ]), |
|
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 |