<?phpnamespace App\Entity;use App\Repository\PayementRepository;use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=PayementRepository::class) * @Auditable() */class Payement{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=Folder::class) * @ORM\JoinColumn(nullable=false) */ private $folder; /** * @ORM\ManyToOne(targetEntity=Fees::class) * @ORM\JoinColumn(nullable=true) */ private $fees; /** * @ORM\Column(type="decimal", precision=18, scale=2) */ private $amount; /** * @ORM\Column(type="string", length=3) */ private $currency; /** * @ORM\Column(type="text") */ private $reference; /** * @ORM\Column(type="string", length=25) */ private $integrator; /** * @ORM\Column(type="datetime", nullable=false) */ private $dateCreate; /** * @ORM\Column(type="boolean") */ private $status; public function __construct() { $this->dateCreate = new \DateTime(); $this->status = 1; } public function getId(): ?int { return $this->id; } public function getAmount(): ?string { return $this->amount; } public function setAmount(float $amount): self { $this->amount = $amount; return $this; } public function getCurrency(): ?string { return $this->currency; } public function setCurrency(string $currency): self { $this->currency = $currency; return $this; } public function getStatus(): ?bool { return $this->status; } public function setStatus(bool $status): self { $this->status = $status; return $this; } public function getReference(): ?string { return $this->reference; } public function setReference(string $reference): self { $this->reference = $reference; return $this; } public function getIntegrator(): ?string { return $this->integrator; } public function setIntegator(string $integrator): self { $this->integrator = $integrator; return $this; } public function getFolder(): ?Folder { return $this->folder; } public function setFolder(?Folder $folder): self { $this->folder = $folder; return $this; } public function getFees(): ?Fees { return $this->fees; } public function setFees(?Fees $fees): self { $this->fees = $fees; return $this; } public function getDateCreate(): ?\DateTimeInterface { return $this->dateCreate; } public function setDateCreate(?\DateTimeInterface $dateCreate): self { $this->dateCreate = $dateCreate; return $this; } public function getPayementSumAmount($amount) { $sum = 0; foreach ($amount as $amount) { $sum += $amount->get(); } return $sum; }}