Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.coaching-en-developpement-personnel.fr
/
htdocs
/
src
/
Entity
/
/srv/data/web/vhosts/www.coaching-en-developpement-personnel.fr/htdocs/src/Entity/Command.php
<?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use App\Repository\CommandRepository; use Symfony\Component\Validator\Constraints\DateTime; /** * @ORM\Entity(repositoryClass=CommandRepository::class) */ class Command { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $orderKey; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="commands") * @ORM\JoinColumn(nullable=true) */ private $user; /** * @ORM\Column(type="string", length=255) */ private $stripeKey; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $billing; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="decimal", precision=5, scale=2) */ private $total; /** * @ORM\OneToMany(targetEntity=CommandFormation::class, mappedBy="command", cascade={"persist"}) */ private $commandFormations; /** * @ORM\Column(type="string", length=255) */ private $firstname; /** * @ORM\Column(type="string", length=255) */ private $lastname; /** * @ORM\Column(type="string", length=255) */ private $email; /** * @ORM\Column(type="string", length=255) */ private $phone; public function __construct() { $this->createdAt = new \DateTime(); $this->commandFormations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getOrderKey(): ?string { return $this->orderKey; } public function setOrderKey(string $orderKey): self { $this->orderKey = $orderKey; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getStripeKey(): ?string { return $this->stripeKey; } public function setStripeKey(string $stripeKey): self { $this->stripeKey = $stripeKey; return $this; } public function getBilling(): ?string { return $this->billing; } public function setBilling(?string $billing): self { $this->billing = $billing; return $this; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getTotal(): ?float { return $this->total; } public function setTotal(float $total): self { $this->total = $total; return $this; } // FONCTION GENERATE TOKEN public function getToken($length) { $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } /** * @return Collection|CommandFormation[] */ public function getCommandFormations(): Collection { return $this->commandFormations; } public function addCommandFormation(CommandFormation $commandFormation): self { if (!$this->commandFormations->contains($commandFormation)) { $this->commandFormations[] = $commandFormation; $commandFormation->setCommand($this); } return $this; } public function removeCommandFormation(CommandFormation $commandFormation): self { if ($this->commandFormations->removeElement($commandFormation)) { // set the owning side to null (unless already changed) if ($commandFormation->getCommand() === $this) { $commandFormation->setCommand(null); } } return $this; } public function getFirstname(): ?string { return $this->firstname; } public function setFirstname(string $firstname): self { $this->firstname = $firstname; return $this; } public function getLastname(): ?string { return $this->lastname; } public function setLastname(string $lastname): self { $this->lastname = $lastname; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } }