|
@@ -22,60 +22,60 @@ |
|
|
block discarded – undo |
|
22
|
22
|
new Get(security: 'is_granted(\'PUBLIC_ACCESS\')'), |
|
23
|
23
|
new Put( |
|
24
|
24
|
security: 'is_granted(\'ROLE_CLIENT\')', |
|
25
|
|
- denormalizationContext: ['groups' => ['product_group_product:write']] |
|
|
25
|
+ denormalizationContext: [ 'groups' => [ 'product_group_product:write' ] ] |
|
26
|
26
|
), |
|
27
|
27
|
new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
|
28
|
28
|
new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
|
29
|
29
|
new GetCollection(security: 'is_granted(\'PUBLIC_ACCESS\')') |
|
30
|
30
|
], |
|
31
|
|
- formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
32
|
|
- normalizationContext: ['groups' => ['product_group_product:read']], |
|
33
|
|
- denormalizationContext: ['groups' => ['product_group_product:write']] |
|
34
|
|
-)] |
|
35
|
|
-#[ApiFilter(OrderFilter::class, properties: ['productGroup.productGroup' => 'ASC', 'product.product' => 'ASC'])] |
|
36
|
|
-#[ORM\Table(name: 'product_group_product')] |
|
37
|
|
-#[ORM\Entity(repositoryClass: ProductGroupProductRepository::class)] |
|
|
31
|
+ formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
|
32
|
+ normalizationContext: [ 'groups' => [ 'product_group_product:read' ] ], |
|
|
33
|
+ denormalizationContext: [ 'groups' => [ 'product_group_product:write' ] ] |
|
|
34
|
+) ] |
|
|
35
|
+#[ApiFilter(OrderFilter::class, properties: [ 'productGroup.productGroup' => 'ASC', 'product.product' => 'ASC' ]) ] |
|
|
36
|
+#[ORM\Table(name: 'product_group_product') ] |
|
|
37
|
+#[ORM\Entity(repositoryClass: ProductGroupProductRepository::class) ] |
|
38
|
38
|
class ProductGroupProduct |
|
39
|
39
|
{ |
|
40
|
|
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
41
|
|
- #[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
|
42
|
|
- #[ORM\Id] |
|
43
|
|
- #[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
44
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
40
|
+ #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
|
41
|
+ #[ORM\Column(name: 'id', type: 'integer', nullable: false) ] |
|
|
42
|
+ #[ORM\Id ] |
|
|
43
|
+ #[ORM\GeneratedValue(strategy: 'IDENTITY') ] |
|
|
44
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
45
|
45
|
private $id; |
|
46
|
46
|
|
|
47
|
|
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'exact'])] |
|
48
|
|
- #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id', nullable: false)] |
|
49
|
|
- #[ORM\ManyToOne(targetEntity: Product::class)] |
|
50
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
47
|
+ #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'exact' ]) ] |
|
|
48
|
+ #[ORM\JoinColumn(name: 'product_id', referencedColumnName: 'id', nullable: false) ] |
|
|
49
|
+ #[ORM\ManyToOne(targetEntity: Product::class) ] |
|
|
50
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
51
|
51
|
private $product; |
|
52
|
52
|
|
|
53
|
|
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['productGroup' => 'exact'])] |
|
54
|
|
- #[ORM\JoinColumn(name: 'product_group_id', referencedColumnName: 'id', nullable: true)] |
|
55
|
|
- #[ORM\ManyToOne(targetEntity: ProductGroup::class)] |
|
56
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
53
|
+ #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productGroup' => 'exact' ]) ] |
|
|
54
|
+ #[ORM\JoinColumn(name: 'product_group_id', referencedColumnName: 'id', nullable: true) ] |
|
|
55
|
+ #[ORM\ManyToOne(targetEntity: ProductGroup::class) ] |
|
|
56
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
57
|
57
|
private $productGroup; |
|
58
|
58
|
|
|
59
|
|
- #[ApiFilter(filterClass: SearchFilter::class, properties: ['productType' => 'exact'])] |
|
60
|
|
- #[ORM\Column(name: 'product_type', type: 'string', columnDefinition: "ENUM('feedstock', 'component', 'package')", nullable: false)] |
|
61
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
59
|
+ #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productType' => 'exact' ]) ] |
|
|
60
|
+ #[ORM\Column(name: 'product_type', type: 'string', columnDefinition: "ENUM('feedstock', 'component', 'package')", nullable: false) ] |
|
|
61
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
62
|
62
|
private $productType = 'component'; |
|
63
|
63
|
|
|
64
|
|
- #[ORM\JoinColumn(name: 'product_child_id', referencedColumnName: 'id', nullable: true)] |
|
65
|
|
- #[ORM\ManyToOne(targetEntity: Product::class)] |
|
66
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
64
|
+ #[ORM\JoinColumn(name: 'product_child_id', referencedColumnName: 'id', nullable: true) ] |
|
|
65
|
+ #[ORM\ManyToOne(targetEntity: Product::class) ] |
|
|
66
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
67
|
67
|
private $productChild; |
|
68
|
68
|
|
|
69
|
|
- #[ORM\Column(name: 'quantity', type: 'float', precision: 10, scale: 2, nullable: false, options: ['default' => '1.00'])] |
|
70
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
69
|
+ #[ORM\Column(name: 'quantity', type: 'float', precision: 10, scale: 2, nullable: false, options: [ 'default' => '1.00' ]) ] |
|
|
70
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
71
|
71
|
private $quantity = 0; |
|
72
|
72
|
|
|
73
|
|
- #[ORM\Column(name: 'price', type: 'float', precision: 10, scale: 2, nullable: false)] |
|
74
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
73
|
+ #[ORM\Column(name: 'price', type: 'float', precision: 10, scale: 2, nullable: false) ] |
|
|
74
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
75
|
75
|
private $price = 0; |
|
76
|
76
|
|
|
77
|
|
- #[ORM\Column(name: 'active', type: 'boolean', nullable: false, options: ['default' => '1'])] |
|
78
|
|
- #[Groups(['product_group_product:read', 'product_group:write', 'product_group_product:write'])] |
|
|
77
|
+ #[ORM\Column(name: 'active', type: 'boolean', nullable: false, options: [ 'default' => '1' ]) ] |
|
|
78
|
+ #[Groups([ 'product_group_product:read', 'product_group:write', 'product_group_product:write' ]) ] |
|
79
|
79
|
private $active = true; |
|
80
|
80
|
|
|
81
|
81
|
public function getId() |