src/Entity/TransfertEnvoie.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  5. use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\TransfertEnvoieRepository")
  8.  */
  9. class TransfertEnvoie
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\Agent", inversedBy="transfertEnvoies")
  19.      */
  20.     private $agent;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $expediteur;
  25.     /**
  26.      * @ORM\Column(type="string", length=255)
  27.      */
  28.     private $destinateur;
  29.     /**
  30.      * @ORM\Column(type="string", length=5)
  31.      */
  32.     private $ville;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      */
  36.     private $code;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $phraseSecret;
  41.     /**
  42.      * @ORM\Column(type="float")
  43.      */
  44.     private $pourcentage;
  45.     /**
  46.      * @ORM\Column(type="decimal", scale=3, precision=11)
  47.      */
  48.     private $Montant;
  49.     /**
  50.      * @ORM\Column(type="date")
  51.      */
  52.     private $dateOperation;
  53.     /**
  54.      * @ORM\Column(type="boolean")
  55.      */
  56.     private $etat;
  57.     private $montantPourcentage;
  58.     private $montantPourcentageBanque;
  59.     private $montantPourcentageNous;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $numeroTel;
  64.     /**
  65.      * @ORM\Column(type="boolean")
  66.      */
  67.     private $isDelivered;
  68.     /**
  69.      * @ORM\Column(type="datetime", nullable=true)
  70.      */
  71.     private $deliveredAt;
  72.     /**
  73.      * @ORM\Column(type="integer")
  74.      */
  75.     private $periodDelivered;
  76.     /**
  77.      * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="transfertEnvoies")
  78.      */
  79.     private $userValidated;
  80.     private $alert;
  81.     /**
  82.      * @ORM\Column(type="string", length=17, nullable=true)
  83.      */
  84.     private $contactExpediteur;
  85.     public function __construct()
  86.     {
  87.         $this->dateOperation = new \DateTime();
  88.         $this->deliveredAt null;
  89.         $this->etat false;
  90.         $this->isDelivered false;
  91.         $this->userValidated null;
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function getAgent(): ?agent
  98.     {
  99.         return $this->agent;
  100.     }
  101.     public function setAgent(?agent $agent): self
  102.     {
  103.         $this->agent $agent;
  104.         return $this;
  105.     }
  106.     public function getExpediteur(): ?string
  107.     {
  108.         return $this->expediteur;
  109.     }
  110.     public function setExpediteur(string $expediteur): self
  111.     {
  112.         $this->expediteur $expediteur;
  113.         return $this;
  114.     }
  115.     public function getDestinateur(): ?string
  116.     {
  117.         return $this->destinateur;
  118.     }
  119.     public function setDestinateur(string $destinateur): self
  120.     {
  121.         $this->destinateur $destinateur;
  122.         return $this;
  123.     }
  124.     public function getVille(): ?string
  125.     {
  126.         return $this->ville;
  127.     }
  128.     public function setVille(string $ville): self
  129.     {
  130.         $this->ville $ville;
  131.         return $this;
  132.     }
  133.     public function getCode(): ?string
  134.     {
  135.         return $this->code;
  136.     }
  137.     public function setCode(string $code): self
  138.     {
  139.         $this->code $code;
  140.         return $this;
  141.     }
  142.     public function getPhraseSecret(): ?string
  143.     {
  144.         return $this->phraseSecret;
  145.     }
  146.     public function setPhraseSecret(?string $phraseSecret): self
  147.     {
  148.         $this->phraseSecret $phraseSecret;
  149.         return $this;
  150.     }
  151.     public function getPourcentage(): ?float
  152.     {
  153.         return $this->pourcentage;
  154.     }
  155.     public function setPourcentage(float $pourcentage): self
  156.     {
  157.         $this->pourcentage $pourcentage;
  158.         return $this;
  159.     }
  160.     public function getMontant(): ?float
  161.     {
  162.         return $this->Montant;
  163.     }
  164.     public function setMontant(float $Montant): self
  165.     {
  166.         $this->Montant $Montant;
  167.         return $this;
  168.     }
  169.     public function getDateOperation(): ?\DateTimeInterface
  170.     {
  171.         return $this->dateOperation;
  172.     }
  173.     public function setDateOperation(\DateTimeInterface $dateOperation): self
  174.     {
  175.         $this->dateOperation $dateOperation;
  176.         return $this;
  177.     }
  178.     public function getEtat(): ?bool
  179.     {
  180.         return $this->etat;
  181.     }
  182.     public function setEtat(bool $etat): self
  183.     {
  184.         $this->etat $etat;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return mixed
  189.      */
  190.     public function getMontantPourcentage()
  191.     {
  192.         $this->montantPourcentage = ($this->getMontant() / 100) * $this->getPourcentage();
  193.         return $this->montantPourcentage;
  194.     }
  195.     /**
  196.      * @return mixed
  197.      */
  198.     public function getMontantPourcentageBanque()
  199.     {
  200.         $this->montantPourcentageBanque = ($this->getMontant() / 100) * 1.5;
  201.         return $this->montantPourcentageBanque;
  202.     }
  203.     /**
  204.      * @return mixed
  205.      */
  206.     public function getMontantPourcentageNous()
  207.     {
  208.         $pourcBq $this->getPourcentage() - 1.5;
  209.         $this->montantPourcentageNous = ($this->getMontant() / 100) * $pourcBq;
  210.         return $this->montantPourcentageNous;
  211.     }
  212.     public function getNumeroTel(): ?string
  213.     {
  214.         return $this->numeroTel;
  215.     }
  216.     public function setNumeroTel(?string $numeroTel): self
  217.     {
  218.         $this->numeroTel $numeroTel;
  219.         return $this;
  220.     }
  221.     public function isIsDelivered(): ?bool
  222.     {
  223.         return $this->isDelivered;
  224.     }
  225.     public function setIsDelivered(bool $isDelivered): self
  226.     {
  227.         $this->isDelivered $isDelivered;
  228.         return $this;
  229.     }
  230.     public function getDeliveredAt(): ?\DateTimeInterface
  231.     {
  232.         return $this->deliveredAt;
  233.     }
  234.     public function setDeliveredAt(?\DateTimeInterface $deliveredAt): self
  235.     {
  236.         $this->deliveredAt $deliveredAt;
  237.         return $this;
  238.     }
  239.     public function getPeriodDelivered(): ?int
  240.     {
  241.         return $this->periodDelivered;
  242.     }
  243.     public function setPeriodDelivered(int $periodDelivered): self
  244.     {
  245.         $this->periodDelivered $periodDelivered;
  246.         return $this;
  247.     }
  248.     public function getUserValidated(): ?Utilisateur
  249.     {
  250.         return $this->userValidated;
  251.     }
  252.     public function setUserValidated(?Utilisateur $userValidated): self
  253.     {
  254.         $this->userValidated $userValidated;
  255.         return $this;
  256.     }
  257.     public function getAlert()
  258.     {
  259.         $create $this->getDateOperation();
  260.         $later = new \DateTime(date('Y-m-d'));
  261.         $this->alert $later->diff($create)->format("%a");
  262.         return $this->alert;
  263.     }
  264.     public function getContactExpediteur(): ?string
  265.     {
  266.         return $this->contactExpediteur;
  267.     }
  268.     public function setContactExpediteur(?string $contactExpediteur): self
  269.     {
  270.         $this->contactExpediteur $contactExpediteur;
  271.         return $this;
  272.     }
  273. }