|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace ControleOnline\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\Serializer\Attribute\Groups; |
|
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
use ApiPlatform\Metadata\ApiResource; |
|
|
|
|
|
|
8
|
|
|
use ApiPlatform\Metadata\Delete; |
|
|
|
|
|
|
9
|
|
|
use ApiPlatform\Metadata\Get; |
|
|
|
|
|
|
10
|
|
|
use ApiPlatform\Metadata\GetCollection; |
|
|
|
|
|
|
11
|
|
|
use ApiPlatform\Metadata\Post; |
|
|
|
|
|
|
12
|
|
|
use ApiPlatform\Metadata\Put; |
|
|
|
|
|
|
13
|
|
|
use ControleOnline\Listener\LogListener; |
|
|
|
|
|
|
14
|
|
|
use ControleOnline\Repository\ProductUnityRepository; |
|
15
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
#[ApiResource( |
|
18
|
|
|
operations: [ |
|
19
|
|
|
new Get(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')'), |
|
20
|
|
|
new Put(security: 'is_granted(\'ROLE_CLIENT\')', denormalizationContext: ['groups' => ['product_unity_edit']]), |
|
21
|
|
|
new Delete(security: 'is_granted(\'ROLE_CLIENT\')'), |
|
22
|
|
|
new Post(securityPostDenormalize: 'is_granted(\'ROLE_CLIENT\')'), |
|
23
|
|
|
new GetCollection(security: 'is_granted(\'ROLE_ADMIN\') or is_granted(\'ROLE_CLIENT\')') |
|
24
|
|
|
], |
|
25
|
|
|
formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']], |
|
26
|
|
|
normalizationContext: ['groups' => ['product_unity:read']], |
|
27
|
|
|
denormalizationContext: ['groups' => ['product_unity:write']] |
|
28
|
|
|
)] |
|
29
|
|
|
#[ORM\Table(name: 'product_unity')] |
|
30
|
|
|
#[ORM\Entity(repositoryClass: ProductUnityRepository::class)] |
|
31
|
|
|
class ProductUnity |
|
32
|
|
|
{ |
|
33
|
|
|
#[ORM\Column(name: 'id', type: 'integer', nullable: false)] |
|
34
|
|
|
#[ORM\Id] |
|
35
|
|
|
#[ORM\GeneratedValue(strategy: 'IDENTITY')] |
|
36
|
|
|
#[Groups(['product:read', 'product_group_product:read', 'product_group:read', 'product_unity:read'])] |
|
37
|
|
|
private $id; |
|
38
|
|
|
|
|
39
|
|
|
#[ORM\Column(name: 'product_unit', type: 'string', length: 3, nullable: false)] |
|
40
|
|
|
#[Groups(['product:read', 'product_group_product:read', 'product_group:read', 'product_unity:read'])] |
|
41
|
|
|
private $productUnit; |
|
42
|
|
|
|
|
43
|
|
|
#[ORM\Column(name: 'unit_type', type: 'string', length: 0, nullable: false, options: ['default' => "'I'", 'comment' => 'Integer, Fractioned'])] |
|
44
|
|
|
#[Groups(['product:read', 'product_group_product:read', 'product_group:read', 'product_unity:read'])] |
|
45
|
|
|
private $unitType = 'I'; |
|
46
|
|
|
|
|
47
|
|
|
public function getId() |
|
48
|
|
|
{ |
|
49
|
|
|
return $this->id; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function setId($id): self |
|
53
|
|
|
{ |
|
54
|
|
|
$this->id = $id; |
|
55
|
|
|
return $this; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function getProductUnit(): string |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->productUnit; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function setProductUnit(string $productUnit): self |
|
64
|
|
|
{ |
|
65
|
|
|
$this->productUnit = $productUnit; |
|
66
|
|
|
return $this; |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
public function getUnitType(): string |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->unitType; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
public function setUnitType(string $unitType): self |
|
75
|
|
|
{ |
|
76
|
|
|
$this->unitType = $unitType; |
|
77
|
|
|
return $this; |
|
78
|
|
|
} |
|
79
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths