src/Entity/Acheter.php line 33
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\GetCollection;use ApiPlatform\Metadata\Post;use ApiPlatform\Metadata\Put;use ApiPlatform\Metadata\Patch;use App\Repository\AcheterRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;use ApiPlatform\Metadata\ApiFilter;#[ORM\Entity(repositoryClass: AcheterRepository::class)]#[ApiResource(normalizationContext: ['groups' => ['read:acheter']],denormalizationContext: ['groups' => ['write:acheter']],operations: [new Get(),new GetCollection(),new Post(),new Put(),new Patch(),],paginationEnabled: true,paginationItemsPerPage: 30),ApiFilter(SearchFilter::class, properties: ['client' => 'exact', 'etat' => 'exact'])]class Acheter{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'acheters')]#[Groups(['read:acheter','write:acheter'])]private ?Pack $packAcheter = null;#[ORM\ManyToOne(inversedBy: 'acheters')]#[Groups(['read:acheter','write:acheter'])]private ?User $client = null;#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]#[Groups(['read:acheter','write:acheter'])]private ?\DateTimeInterface $dateAchat = null;#[ORM\Column(length: 255,nullable:true)]#[Groups(['read:acheter','write:acheter'])]private ?string $gainActuelle ='0';#[ORM\Column(nullable: true)]#[Groups(['read:acheter','write:acheter'])]private ?bool $etat = false;public function getId(): ?int{return $this->id;}public function getPackAcheter(): ?Pack{return $this->packAcheter;}public function setPackAcheter(?Pack $packAcheter): self{$this->packAcheter = $packAcheter;return $this;}public function getClient(): ?User{return $this->client;}public function setClient(?User $client): self{$this->client = $client;return $this;}public function getDateAchat(): ?\DateTimeInterface{return $this->dateAchat;}public function setDateAchat(?\DateTimeInterface $dateAchat): self{$this->dateAchat = $dateAchat;return $this;}public function getGainActuelle(): ?string{return $this->gainActuelle;}public function setGainActuelle(string $gainActuelle): self{$this->gainActuelle = $gainActuelle;return $this;}public function isEtat(): ?bool{return $this->etat;}public function setEtat(?bool $etat): self{$this->etat = $etat;return $this;}}