src/Entity/Payement.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PayementRepository;
  4. use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PayementRepository::class)
  8.  * @Auditable()
  9.  */
  10. class Payement
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Folder::class)
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $folder;
  23.      /**
  24.      * @ORM\ManyToOne(targetEntity=Fees::class)
  25.      * @ORM\JoinColumn(nullable=true)
  26.      */
  27.     private $fees;
  28.     /**
  29.      * @ORM\Column(type="decimal", precision=18, scale=2)
  30.      */
  31.     private $amount;
  32.     /**
  33.      * @ORM\Column(type="string", length=3)
  34.      */
  35.     private $currency;
  36.     /**
  37.      * @ORM\Column(type="text")
  38.      */
  39.     private $reference;
  40.     /**
  41.      * @ORM\Column(type="string", length=25)
  42.      */
  43.     private $integrator;
  44.     
  45.     /**
  46.      * @ORM\Column(type="datetime", nullable=false)
  47.      */
  48.     private $dateCreate;
  49.     
  50.     /**
  51.      * @ORM\Column(type="boolean")
  52.      */
  53.     private $status;
  54.     public function __construct()
  55.     {
  56.         $this->dateCreate = new \DateTime();
  57.         $this->status 1;
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getAmount(): ?string
  64.     {
  65.         return $this->amount;
  66.     }
  67.     public function setAmount(float $amount): self
  68.     {
  69.         $this->amount $amount;
  70.         return $this;
  71.     }
  72.     public function getCurrency(): ?string
  73.     {
  74.         return $this->currency;
  75.     }
  76.     public function setCurrency(string $currency): self
  77.     {
  78.         $this->currency $currency;
  79.         return $this;
  80.     }
  81.     public function getStatus(): ?bool
  82.     {
  83.         return $this->status;
  84.     }
  85.     public function setStatus(bool $status): self
  86.     {
  87.         $this->status $status;
  88.         return $this;
  89.     }
  90.     public function getReference(): ?string
  91.     {
  92.         return $this->reference;
  93.     }
  94.     public function setReference(string $reference): self
  95.     {
  96.         $this->reference $reference;
  97.         return $this;
  98.     }
  99.     public function getIntegrator(): ?string
  100.     {
  101.         return $this->integrator;
  102.     }
  103.     public function setIntegator(string $integrator): self
  104.     {
  105.         $this->integrator $integrator;
  106.         return $this;
  107.     }
  108.     public function getFolder(): ?Folder
  109.     {
  110.         return $this->folder;
  111.     }
  112.     public function setFolder(?Folder $folder): self
  113.     {
  114.         $this->folder $folder;
  115.         return $this;
  116.     }
  117.     public function getFees(): ?Fees
  118.     {
  119.         return $this->fees;
  120.     }
  121.     public function setFees(?Fees $fees): self
  122.     {
  123.         $this->fees $fees;
  124.         return $this;
  125.     }
  126.     public function getDateCreate(): ?\DateTimeInterface
  127.     {
  128.         return $this->dateCreate;
  129.     }
  130.     public function setDateCreate(?\DateTimeInterface $dateCreate): self
  131.     {
  132.         $this->dateCreate $dateCreate;
  133.         return $this;
  134.     }
  135.     public function getPayementSumAmount($amount)
  136.     {
  137.         $sum 0;
  138.         foreach ($amount as $amount) {
  139.             $sum += $amount->get();
  140.         }
  141.         return $sum;
  142.     }
  143. }