Passed
Push — master ( a85de5...2adc92 )
by Luiz Kim
02:38
created

CompanyDocument::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace ControleOnline\Entity;
4
5
use Symfony\Component\Serializer\Attribute\Groups;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Serializer\Attribute\Groups was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Doctrine\Orm\Filter\SearchFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use ApiPlatform\Metadata\ApiFilter;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiFilter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use ApiPlatform\Metadata\ApiResource;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\ApiResource was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use ApiPlatform\Metadata\Get;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\Get was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use ApiPlatform\Metadata\GetCollection;
0 ignored issues
show
Bug introduced by
The type ApiPlatform\Metadata\GetCollection was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
use ControleOnline\Repository\CompanyDocumentRepository;
14
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
16
#[ApiResource(
17
    operations: [
18
        new Get(security: 'is_granted(\'ROLE_CLIENT\')'),
19
        new GetCollection(security: 'is_granted(\'ROLE_CLIENT\')')
20
    ],
21
    formats: ['jsonld', 'json', 'html', 'jsonhal', 'csv' => ['text/csv']],
22
    normalizationContext: ['groups' => ['company_document:read']],
23
    denormalizationContext: ['groups' => ['company_document:write']]
24
)]
25
#[ApiFilter(filterClass: SearchFilter::class, properties: ['peopleType' => 'exact'])]
26
#[ORM\Table(name: 'company_document')]
27
28
#[ORM\Entity(repositoryClass: CompanyDocumentRepository::class)]
29
class CompanyDocument
30
{
31
    #[ORM\Column(name: 'id', type: 'integer', nullable: false)]
32
    #[ORM\Id]
33
    #[ORM\GeneratedValue(strategy: 'IDENTITY')]
34
    private int $id = 0;
35
36
    #[ORM\JoinColumn(name: 'people_id', referencedColumnName: 'id', nullable: false)]
37
    #[ORM\ManyToOne(targetEntity: People::class, inversedBy: 'company_document')]
38
    #[Groups(['company_document:read', 'company_document:write'])]
39
    private People $people;
40
41
    #[ORM\JoinColumn(name: 'document_type_id', referencedColumnName: 'id', nullable: false)]
42
    #[ORM\ManyToOne(targetEntity: DocumentType::class, inversedBy: 'company_document')]
43
    #[Groups(['company_document:read', 'company_document:write'])]
44
    private People $document_type;
45
46
    public function getId(): int
47
    {
48
        return $this->id;
49
    }
50
51
    /**
52
     * Get the value of people
53
     */
54
    public function getPeople(): People
55
    {
56
        return $this->people;
57
    }
58
59
    /**
60
     * Set the value of people
61
     */
62
    public function setPeople(People $people): self
63
    {
64
        $this->people = $people;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Get the value of document_type
71
     */
72
    public function getDocumentType(): People
73
    {
74
        return $this->document_type;
75
    }
76
77
    /**
78
     * Set the value of document_type
79
     */
80
    public function setDocumentType(People $document_type): self
81
    {
82
        $this->document_type = $document_type;
83
84
        return $this;
85
    }
86
}