Newer
Older
<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Doctrine\Orm\Filter\RangeFilter;
use App\Repository\TaxeRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TaxeRepository::class)]
#[ApiResource(
operations: [
new Get(),
new GetCollection()
],
paginationClientEnabled: true
)]
#[ApiFilter(SearchFilter::class, properties: [
'type' => 'exact',
'type.code' => 'exact',
'annee' => 'exact',
'commune.departement' => 'exact'
])]
#[ApiFilter(RangeFilter::class, properties: ['annee'])]
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
class Taxe
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'taxes')]
#[ORM\JoinColumn(nullable: false)]
private ?Commune $commune = null;
#[ORM\Column]
private ?int $annee = null;
#[ORM\ManyToOne(inversedBy: 'taxes')]
#[ORM\JoinColumn(nullable: false)]
private ?TypeTaxe $type = null;
#[ORM\Column]
private ?float $taux = null;
#[ORM\Column]
private ?float $volume = null;
public function getId(): ?int
{
return $this->id;
}
public function getCommune(): ?Commune
{
return $this->commune;
}
public function setCommune(?Commune $commune): static
{
$this->commune = $commune;
return $this;
}
public function getAnnee(): ?int
{
return $this->annee;
}
public function setAnnee(int $annee): static
{
$this->annee = $annee;
return $this;
}
public function getType(): ?TypeTaxe
{
return $this->type;
}
public function setType(?TypeTaxe $type): static
{
$this->type = $type;
return $this;
}
public function getTaux(): ?float
{
return $this->taux;
}
public function setTaux(float $taux): static
{
$this->taux = $taux;
return $this;
}
public function getVolume(): ?float
{
return $this->volume;
}
public function setVolume(float $volume): static
{
$this->volume = $volume;
return $this;
}
}