src/Entity/Payment.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Student;
  4. use App\Entity\SchoolYear;
  5. use App\Repository\PaymentRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Traits\TimeStampable;
  8. use App\Entity\Traits\Amount;
  9. /**
  10.  * Payment
  11.  *
  12.  * @ORM\Table(name="payment")
  13.  * @ORM\Entity(repositoryClass=PaymentRepository::class)
  14.  */
  15. class Payment
  16. {
  17.     use TimeStampable;
  18.     use Amount;
  19.     public const NUM_ITEMS_PER_PAGE 20;
  20.     /**
  21.      * @var int
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\Column(type="string", length=25, nullable=true, unique=true)
  31.      */
  32.     private $code;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity=SchoolYear::class)
  35.      * @ORM\JoinColumn(name="school_year_id", referencedColumnName="id", nullable=true)
  36.      */
  37.     private $schoolYear;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity=Student::class)
  40.      * @ORM\JoinColumn(name="student_id", referencedColumnName="id", nullable=true)
  41.      */
  42.     private $student;
  43.      /**
  44.      * @var boolean
  45.      *
  46.      * @ORM\Column(name="subscription", type="boolean", options={"default":false})
  47.      */
  48.     private $subscription false;
  49.     public function __construct()
  50.     {
  51.   
  52.         $this->createdAt= new \DateTime();
  53.         $this->updatedAt= new \DateTime();
  54.        
  55.     }
  56.     /**
  57.      * Get id
  58.      *
  59.      * @return int
  60.      */
  61.     public function getId()
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getCode(): ?string
  66.     {
  67.         return $this->code;
  68.     }
  69.     public function setCode(string $code): self
  70.     {
  71.         $this->code $code;
  72.         return $this;
  73.     }
  74.     /**
  75.      * Set schoolYear
  76.      *
  77.      * @param SchoolYear $schoolYear
  78.      *
  79.      * @return Payment
  80.      */
  81.     public function setSchoolYear(SchoolYear $schoolYear null)
  82.     {
  83.         $this->schoolYear $schoolYear;
  84.         return $this;
  85.     }
  86.      /**
  87.      *  Get schoolYear
  88.      * 
  89.      * @return SchoolYear
  90.      */
  91.     public function getSchoolYear()
  92.     {
  93.         return $this->schoolYear;
  94.     }
  95.     /**
  96.      * Set student
  97.      *
  98.      * @param Student $student
  99.      *
  100.      * @return Payment
  101.      */
  102.     public function setStudent(Student $student null)
  103.     {
  104.         $this->student $student;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get student
  109.      *
  110.      * @return Student
  111.      */
  112.     public function getStudent()
  113.     {
  114.         return $this->student;
  115.     }
  116.     public function isSubscription(): ?bool
  117.     {
  118.         return $this->subscription;
  119.     }
  120.     public function setSubscription(bool $subscription): static
  121.     {
  122.         $this->subscription $subscription;
  123.         return $this;
  124.     }
  125. }