Cotisation.php 2.76 KB
Newer Older
Julien Jorry committed
1 2 3 4
<?php

namespace App\Entity;

5
use App\Entity\CotisationInfos;
Julien Jorry committed
6 7 8 9
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
10 11
 * Cotisation d'un utilisateur
 *
Julien Jorry committed
12 13
 * @ORM\Entity
 */
14
class Cotisation extends Flux
Julien Jorry committed
15 16
{
    /**
17 18
     * @ORM\OneToOne(targetEntity="Siege")
     * @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=true)
Julien Jorry committed
19
     */
20
    protected $destinataire;
Julien Jorry committed
21 22

    /**
23
     * @ORM\OneToOne(targetEntity="CotisationInfos", inversedBy="cotisation", cascade={"persist"})
24
     * @ORM\JoinColumn(name="cotisationinfos_id", referencedColumnName="id", nullable=true)
Julien Jorry committed
25
     */
26
    protected $cotisationInfos;
Julien Jorry committed
27 28

    /**
29
     * Constructeur
Julien Jorry committed
30
     */
31 32
    public function __construct()
    {
33
        parent::__construct();
34 35
        $this->cotisationInfos = new CotisationInfos();
    }
Julien Jorry committed
36 37

    /**
38
     * @return string
Julien Jorry committed
39
     */
40
    public function getParenttype(): string
Julien Jorry committed
41
    {
42
        return 'cotisation';
Julien Jorry committed
43 44
    }

45 46 47 48 49 50 51 52
    /**
     * @return string
     */
    public function getType(): string
    {
        return 'cotisation';
    }

Julien Jorry committed
53
    /**
54 55 56 57
    * Get cotisationInfos
    * @return cotisationInfos
    */
    public function getCotisationInfos(): ?CotisationInfos
Julien Jorry committed
58
    {
59
        return $this->cotisationInfos;
Julien Jorry committed
60 61 62
    }

    /**
63 64 65 66
    * Set CotisationInfos cotisationInfos
    * @return $this
    */
    public function setCotisationInfos(CotisationInfos $cotisationInfos)
Julien Jorry committed
67
    {
68
        $this->cotisationInfos = $cotisationInfos;
Julien Jorry committed
69 70 71 72 73 74
        return $this;
    }

    /**
     * @return int
     */
Julien Jorry committed
75
    public function getAnnee(): ?int
Julien Jorry committed
76
    {
77
        return $this->cotisationInfos->getAnnee();
Julien Jorry committed
78 79 80 81 82 83 84 85
    }

    /**
     * @param int $annee
     * @return Cotisation
     */
    public function setAnnee(int $annee)
    {
86
        $this->cotisationInfos->setAnnee($annee);
Julien Jorry committed
87 88 89 90 91 92
        return $this;
    }

    /**
     * @return \DateTime
     */
Julien Jorry committed
93
    public function getDebut(): ?\DateTime
Julien Jorry committed
94
    {
95
        return $this->cotisationInfos->getDebut();
Julien Jorry committed
96 97 98 99 100 101 102 103
    }

    /**
     * @param \DateTime $debut
     * @return Cotisation
     */
    public function setDebut(\DateTime $debut)
    {
104
        $this->cotisationInfos->setDebut($debut);
Julien Jorry committed
105 106 107 108 109 110
        return $this;
    }

    /**
     * @return \DateTime
     */
Julien Jorry committed
111
    public function getFin(): ?\DateTime
Julien Jorry committed
112
    {
113
        return $this->cotisationInfos->getFin();
Julien Jorry committed
114 115 116 117 118 119 120 121
    }

    /**
     * @param \DateTime $fin
     * @return Cotisation
     */
    public function setFin(\DateTime $fin)
    {
122
        $this->cotisationInfos->setFin($fin);
Julien Jorry committed
123 124 125 126 127 128
        return $this;
    }

    /**
     * @return bool
     */
Julien Jorry committed
129
    public function isRecu(): ?bool
Julien Jorry committed
130
    {
131
        return $this->cotisationInfos->isRecu();
Julien Jorry committed
132 133 134 135 136 137 138 139
    }

    /**
     * @param bool $recu
     * @return Cotisation
     */
    public function setRecu(bool $recu)
    {
140
        $this->cotisationInfos->setRecu($recu);
Julien Jorry committed
141 142 143
        return $this;
    }
}