@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | * @ORM\ManyToOne(targetEntity="Product") |
| 89 | 89 | * @ORM\JoinColumn(name="product_child_id", referencedColumnName="id", nullable=false) |
| 90 | 90 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 91 | - |
|
| 92 | 91 | */ |
| 93 | 92 | private $productChild; |
| 94 | 93 | |
@@ -97,7 +96,6 @@ discard block |
||
| 97 | 96 | * |
| 98 | 97 | * @ORM\Column(name="quantity", type="float", precision=10, scale=2, nullable=false, options={"default"="1.00"}) |
| 99 | 98 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 100 | - |
|
| 101 | 99 | */ |
| 102 | 100 | private $quantity = 0; |
| 103 | 101 | |
@@ -106,7 +104,6 @@ discard block |
||
| 106 | 104 | * |
| 107 | 105 | * @ORM\Column(name="price", type="float", precision=10, scale=2, nullable=false) |
| 108 | 106 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 109 | - |
|
| 110 | 107 | */ |
| 111 | 108 | private $price = 0; |
| 112 | 109 | |
@@ -115,7 +112,6 @@ discard block |
||
| 115 | 112 | * |
| 116 | 113 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
| 117 | 114 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 118 | - |
|
| 119 | 115 | */ |
| 120 | 116 | private $active = true; |
| 121 | 117 | |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'), |
| 27 | 27 | new Put( |
| 28 | 28 | security: 'is_granted(\'ROLE_CLIENT\')', |
| 29 | - denormalizationContext: ['groups' => ['product_group_product:write']] |
|
| 29 | + denormalizationContext: [ 'groups' => [ 'product_group_product:write' ] ] |
|
| 30 | 30 | ), |
| 31 | 31 | new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
| 32 | 32 | new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
| 33 | 33 | new GetCollection(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
| 34 | 34 | ], |
| 35 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
| 36 | - normalizationContext: ['groups' => ['product_group_product:read']], |
|
| 37 | - denormalizationContext: ['groups' => ['product_group_product:write']] |
|
| 38 | -)] |
|
| 35 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
| 36 | + normalizationContext: [ 'groups' => [ 'product_group_product:read' ] ], |
|
| 37 | + denormalizationContext: [ 'groups' => [ 'product_group_product:write' ] ] |
|
| 38 | +) ] |
|
| 39 | 39 | class ProductGroupProduct |
| 40 | 40 | { |
| 41 | 41 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @ORM\GeneratedValue(strategy="IDENTITY") |
| 47 | 47 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 48 | 48 | */ |
| 49 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
| 49 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
| 50 | 50 | |
| 51 | 51 | private $id; |
| 52 | 52 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @ORM\JoinColumn(name="product_id", referencedColumnName="id", nullable=false) |
| 58 | 58 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 59 | 59 | */ |
| 60 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'exact'])] |
|
| 60 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'exact' ]) ] |
|
| 61 | 61 | |
| 62 | 62 | private $product; |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @ORM\JoinColumn(name="product_group_id", referencedColumnName="id", nullable=true) |
| 69 | 69 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 70 | 70 | */ |
| 71 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productGroup' => 'exact'])] |
|
| 71 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productGroup' => 'exact' ]) ] |
|
| 72 | 72 | |
| 73 | 73 | private $productGroup; |
| 74 | 74 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @ORM\Column(name="product_type", type="string", columnDefinition="ENUM('feedstock', 'component', 'package')", nullable=false) |
| 79 | 79 | * @Groups({"product_group_product:read","product_group:write","product_group_product:write"}) |
| 80 | 80 | */ |
| 81 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productType' => 'exact'])] |
|
| 81 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productType' => 'exact' ]) ] |
|
| 82 | 82 | |
| 83 | 83 | private $productType; |
| 84 | 84 | |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | #[ApiResource( |
| 27 | 27 | operations: [ |
| 28 | 28 | new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'), |
| 29 | - new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['product:write']]), |
|
| 29 | + new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: [ 'groups' => [ 'product: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(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
| 33 | 33 | ], |
| 34 | - formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
| 35 | - normalizationContext: ['groups' => ['product:read']], |
|
| 36 | - denormalizationContext: ['groups' => ['product:write']] |
|
| 37 | -)] |
|
| 34 | + formats: [ 'jsonld', 'json', 'html', 'jsonhal', 'csv' => [ 'text/csv' ] ], |
|
| 35 | + normalizationContext: [ 'groups' => [ 'product:read' ] ], |
|
| 36 | + denormalizationContext: [ 'groups' => [ 'product:write' ] ] |
|
| 37 | +) ] |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | class Product |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @ORM\GeneratedValue(strategy="IDENTITY") |
| 48 | 48 | * @Groups({"product:read","order_product:read"}) |
| 49 | 49 | */ |
| 50 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['id' => 'exact'])] |
|
| 50 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'id' => 'exact' ]) ] |
|
| 51 | 51 | |
| 52 | 52 | private $id; |
| 53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @ORM\Column(name="product", type="string", length=255, nullable=false) |
| 58 | 58 | * @Groups({"product:read","product_group_product:read","order_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 59 | 59 | */ |
| 60 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['product' => 'exact'])] |
|
| 60 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'product' => 'exact' ]) ] |
|
| 61 | 61 | |
| 62 | 62 | private $product; |
| 63 | 63 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @ORM\Column(name="sku", type="string", length=32, nullable=true, options={"default"="NULL"}) |
| 68 | 68 | * @Groups({"product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 69 | 69 | */ |
| 70 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['sku' => 'exact'])] |
|
| 70 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'sku' => 'exact' ]) ] |
|
| 71 | 71 | |
| 72 | 72 | private $sku = NULL; |
| 73 | 73 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @ORM\Column(name="type", type="string", length=0, nullable=false, options={"default"="'product'"}) |
| 78 | 78 | * @Groups({"product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 79 | 79 | */ |
| 80 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['type' => 'exact'])] |
|
| 80 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'type' => 'exact' ]) ] |
|
| 81 | 81 | private $type = 'product'; |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @ORM\Column(name="product_condition", type="string", length=0, nullable=false, options={"default"="'new'"}) |
| 95 | 95 | * @Groups({"product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 96 | 96 | */ |
| 97 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['productCondition' => 'exact'])] |
|
| 97 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'productCondition' => 'exact' ]) ] |
|
| 98 | 98 | |
| 99 | 99 | private $productCondition = 'new'; |
| 100 | 100 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @ORM\Column(name="active", type="boolean", nullable=false, options={"default"="1"}) |
| 114 | 114 | * @Groups({"product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 115 | 115 | */ |
| 116 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['active' => 'exact'])] |
|
| 116 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'active' => 'exact' ]) ] |
|
| 117 | 117 | |
| 118 | 118 | private $active = true; |
| 119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * }) |
| 127 | 127 | * @Groups({"product:read","product_group_product:read","order_product:read","order:read","order_details:read","order:write","product:write"}) |
| 128 | 128 | */ |
| 129 | - #[ApiFilter(filterClass: SearchFilter::class, properties: ['company' => 'exact'])] |
|
| 129 | + #[ApiFilter(filterClass: SearchFilter::class, properties: [ 'company' => 'exact' ]) ] |
|
| 130 | 130 | |
| 131 | 131 | private $company; |
| 132 | 132 | |