src/Entity/Installment.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\ClassRoom;
  4. use App\Repository\InstallmentRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Traits\Amount;
  8. use App\Entity\Traits\TimeStampable;
  9. /**
  10.  * Tranche de scolarite
  11.  *
  12.  * @ORM\Table(name="installment")
  13.  * @ORM\Entity(repositoryClass=InstallmentRepository::class)
  14.  */
  15. class Installment
  16. {
  17.     use Amount;
  18.   
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=PaymentPlan::class,inversedBy="installments")
  21.      * @ORM\JoinColumn(name="payment_plan_id", referencedColumnName="id", nullable=true)
  22.      */
  23.     private $paymentPlan;
  24.      /**
  25.      * @ORM\ManyToOne(targetEntity=ClassRoom::class) 
  26.      * @ORM\JoinColumn(name="classRoom_id", referencedColumnName="id", nullable=true)
  27.      */
  28.     private $classRoom;
  29.     /**
  30.      * @var int
  31.      *
  32.      * @ORM\Column(name="id", type="integer")
  33.      * @ORM\Id
  34.      * @ORM\GeneratedValue(strategy="AUTO")
  35.      */
  36.     private $id;
  37.       /**
  38.      * @var int
  39.      *
  40.      * @ORM\Column(name="ranking", type="integer")
  41.      */
  42.     private $ranking;
  43.       /**
  44.      * @var \Datetime
  45.      *
  46.      * @ORM\Column(name="deadline", type="datetime", nullable=false)
  47.      */
  48.     protected $deadline;
  49.    
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.    
  55.     public function getRanking(): ?int
  56.     {
  57.         return $this->ranking;
  58.     }
  59.     public function setRanking(int $order): static
  60.     {
  61.         $this->ranking $order;
  62.         if($this->getPaymentPlan()->getWeight() < $order){
  63.             $this->getPaymentPlan()->setWeight($order) ;
  64.         }
  65.         return $this;
  66.     }
  67.     public function getPaymentPlan(): ?PaymentPlan
  68.     {
  69.         return $this->paymentPlan;
  70.     }
  71.     public function setPaymentPlan(?PaymentPlan $paymentPlan): static
  72.     {
  73.         $this->paymentPlan $paymentPlan;
  74.         return $this;
  75.     }
  76.     public function getDeadline(): ?\DateTimeInterface
  77.     {
  78.         return $this->deadline;
  79.     }
  80.     public function setDeadline(?\DateTimeInterface $deadline): static
  81.     {
  82.         $this->deadline $deadline;
  83.         return $this;
  84.     }
  85.     public function getClassRoom(): ?ClassRoom
  86.     {
  87.         return $this->classRoom;
  88.     }
  89.     public function setClassRoom(?ClassRoom $classRoom): static
  90.     {
  91.         $this->classRoom $classRoom;
  92.         return $this;
  93.     }
  94.     
  95. }