src/Entity/PaymentMethod.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. #[ORM\Entity(repositoryClass"App\Repository\PaymentMethodRepository")]
  7. #[ORM\Table(name"payment_method")]
  8. class PaymentMethod {
  9.     #[ORM\Id]
  10.     #[ORM\Column(type"integer")]
  11.     #[ORM\GeneratedValue(strategy"AUTO")]
  12.     private ?int $id;
  13.     #[ORM\ManyToMany(targetEntityLossReport::class, mappedBy"paymentMethods"cascade: ["persist"])]
  14.     private Collection|array $lossReports;
  15.     #[ORM\Column(type"boolean")]
  16.     private bool $isDeleted false;
  17.     #[ORM\ManyToMany(targetEntityComplaintX::class, mappedBy"paymentMethods"cascade: ["persist"])]
  18.     private Collection|array $complaintXs;
  19.     #[ORM\ManyToMany(targetEntityItemsListComplaint::class, mappedBy"paymentMethods"cascade: ["persist"])]
  20.     private Collection|array $itemsListComplaints;
  21.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"paymentMethods")]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private User $user;
  24.     #[ORM\Column(type"string"length255)]
  25.     private string $bank;
  26.     #[ORM\Column(type"string"length255nullabletrue)]
  27.     #[Assert\Choice(callback"getTypes"multiplefalse)]
  28.     private ?string $type;
  29.     #[ORM\Column(name"lastName"type"string"length255)]
  30.     private string $lastName;
  31.     #[ORM\Column(name"firstName"type"string"length255)]
  32.     private string $firstName;
  33.     #[ORM\Column(name"stripeCardId"type"string"length255)]
  34.     private string $stripeCardId;
  35.     public function __toString() {
  36.         return "#" $this->id " - " $this->stripeCardId;
  37.     }
  38.     /**
  39.      *
  40.      */
  41.     public static function getTypes() {
  42.         $arr = [
  43.             'American Express',
  44.             'MasterCard',
  45.             'VISA',
  46.         ];
  47.         return array_combine($arr$arr);
  48.     }
  49.     /**
  50.      *
  51.      */
  52.     public static function getBanks() {
  53.         $arr = [
  54.             "Allianz Banque",
  55.             "Anytime",
  56.             "AXA Banque",
  57.             "B For Bank",
  58.             "Banque Accord",
  59.             "Banque Casino",
  60.             "Banque de Savoie",
  61.             "Banque Fédérale Mutualiste",
  62.             "Banque Hottinguer",
  63.             "Banque Palatine",
  64.             "Banque Populaire",
  65.             "Banque Privée Européenne",
  66.             "Barclays",
  67.             "BNP Paribas",
  68.             "Boursorama Banque",
  69.             "BRED",
  70.             "Caisse d'Epargne",
  71.             "Carrefour Banque",
  72.             "CCSO",
  73.             "CIC",
  74.             "Compte Nickel",
  75.             "Coopabanque",
  76.             "Cortal Consors",
  77.             "Crédit agricole",
  78.             "Crédit coopératif",
  79.             "Crédit du nord",
  80.             "Crédit mutuel",
  81.             "C-Zam",
  82.             "Ditto Bank",
  83.             "e.LCL",
  84.             "Eko",
  85.             "Fortis Banque",
  86.             "Fortuneo",
  87.             "Groupama Banque",
  88.             "Hello bank",
  89.             "HSBC",
  90.             "ING Direct",
  91.             "La Banque Postale",
  92.             "L'agence directe",
  93.             "L'Agence en ligne",
  94.             "LCL",
  95.             "Legal & General",
  96.             "Lydia",
  97.             "Manager.one",
  98.             "Mirabaud",
  99.             "Monabanq",
  100.             "Morning",
  101.             "N26",
  102.             "Natixis ",
  103.             "Orange Bank",
  104.             "PCS",
  105.             "Qonto ",
  106.             "Revolut",
  107.             "Rothschild",
  108.             "SmartPay",
  109.             "Société Générale",
  110.             "Wormser Frères",
  111.         ];
  112.         return array_combine($arr$arr);
  113.     }
  114.     /**
  115.      * Get id
  116.      *
  117.      * @return int
  118.      */
  119.     public function getId() {
  120.         return $this->id;
  121.     }
  122.     /**
  123.      * Set bank
  124.      *
  125.      * @param string $bank
  126.      *
  127.      * @return PaymentMethod
  128.      */
  129.     public function setBank($bank) {
  130.         $this->bank $bank;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get bank
  135.      *
  136.      * @return string
  137.      */
  138.     public function getBank() {
  139.         return $this->bank;
  140.     }
  141.     /**
  142.      * Set type
  143.      *
  144.      * @param string $type
  145.      *
  146.      * @return PaymentMethod
  147.      */
  148.     public function setType($type) {
  149.         $this->type $type;
  150.         return $this;
  151.     }
  152.     /**
  153.      * Get type
  154.      *
  155.      * @return string
  156.      */
  157.     public function getType() {
  158.         return $this->type;
  159.     }
  160.     /**
  161.      * Set lastName
  162.      *
  163.      * @param string $lastName
  164.      *
  165.      * @return PaymentMethod
  166.      */
  167.     public function setLastName($lastName) {
  168.         $this->lastName $lastName;
  169.         return $this;
  170.     }
  171.     /**
  172.      * Get lastName
  173.      *
  174.      * @return string
  175.      */
  176.     public function getLastName() {
  177.         return $this->lastName;
  178.     }
  179.     /**
  180.      * Set firstName
  181.      *
  182.      * @param string $firstName
  183.      *
  184.      * @return PaymentMethod
  185.      */
  186.     public function setFirstName($firstName) {
  187.         $this->firstName $firstName;
  188.         return $this;
  189.     }
  190.     /**
  191.      * Get firstName
  192.      *
  193.      * @return string
  194.      */
  195.     public function getFirstName() {
  196.         return $this->firstName;
  197.     }
  198.     /**
  199.      * Set stripeCardId
  200.      *
  201.      * @param string $stripeCardId
  202.      *
  203.      * @return PaymentMethod
  204.      */
  205.     public function setStripeCardId($stripeCardId) {
  206.         $this->stripeCardId $stripeCardId;
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get stripeCardId
  211.      *
  212.      * @return string
  213.      */
  214.     public function getStripeCardId() {
  215.         return $this->stripeCardId;
  216.     }
  217.     /**
  218.      * Set user
  219.      *
  220.      * @param \App\Entity\User $user
  221.      *
  222.      * @return PaymentMethod
  223.      */
  224.     public function setUser(\App\Entity\User $user) {
  225.         $this->user $user;
  226.         return $this;
  227.     }
  228.     /**
  229.      * Get user
  230.      *
  231.      * @return \App\Entity\User
  232.      */
  233.     public function getUser() {
  234.         return $this->user;
  235.     }
  236.     /**
  237.      * Set isDeleted
  238.      *
  239.      * @param boolean $isDeleted
  240.      *
  241.      * @return PaymentMethod
  242.      */
  243.     public function setIsDeleted($isDeleted) {
  244.         $this->isDeleted $isDeleted;
  245.         return $this;
  246.     }
  247.     /**
  248.      * Get isDeleted
  249.      *
  250.      * @return boolean
  251.      */
  252.     public function getIsDeleted() {
  253.         return $this->isDeleted;
  254.     }
  255.     /**
  256.      * Constructor
  257.      */
  258.     public function __construct() {
  259.         $this->itemsListComplaints = new \Doctrine\Common\Collections\ArrayCollection();
  260.     }
  261.     /**
  262.      * Add itemsListComplaint
  263.      *
  264.      * @param \App\Entity\ItemsListComplaint $itemsListComplaint
  265.      *
  266.      * @return PaymentMethod
  267.      */
  268.     public function addItemsListComplaint(\App\Entity\ItemsListComplaint $itemsListComplaint) {
  269.         $this->itemsListComplaints[] = $itemsListComplaint;
  270.         return $this;
  271.     }
  272.     /**
  273.      * Remove itemsListComplaint
  274.      *
  275.      * @param \App\Entity\ItemsListComplaint $itemsListComplaint
  276.      */
  277.     public function removeItemsListComplaint(\App\Entity\ItemsListComplaint $itemsListComplaint) {
  278.         $this->itemsListComplaints->removeElement($itemsListComplaint);
  279.     }
  280.     /**
  281.      * Get itemsListComplaints
  282.      *
  283.      * @return \Doctrine\Common\Collections\Collection
  284.      */
  285.     public function getItemsListComplaints() {
  286.         return $this->itemsListComplaints;
  287.     }
  288.     /**
  289.      * Add complaintX
  290.      *
  291.      * @param \App\Entity\ComplaintX $complaintX
  292.      *
  293.      * @return PaymentMethod
  294.      */
  295.     public function addComplaintX(\App\Entity\ComplaintX $complaintX) {
  296.         $this->complaintXs[] = $complaintX;
  297.         return $this;
  298.     }
  299.     /**
  300.      * Remove complaintX
  301.      *
  302.      * @param \App\Entity\ComplaintX $complaintX
  303.      */
  304.     public function removeComplaintX(\App\Entity\ComplaintX $complaintX) {
  305.         $this->complaintXs->removeElement($complaintX);
  306.     }
  307.     /**
  308.      * Get complaintXs
  309.      *
  310.      * @return \Doctrine\Common\Collections\Collection
  311.      */
  312.     public function getComplaintXs() {
  313.         return $this->complaintXs;
  314.     }
  315.     /**
  316.      * Add lossReport
  317.      *
  318.      * @param \App\Entity\LossReport $lossReport
  319.      *
  320.      * @return PaymentMethod
  321.      */
  322.     public function addLossReport(\App\Entity\LossReport $lossReport) {
  323.         $this->lossReports[] = $lossReport;
  324.         return $this;
  325.     }
  326.     /**
  327.      * Remove lossReport
  328.      *
  329.      * @param \App\Entity\LossReport $lossReport
  330.      */
  331.     public function removeLossReport(\App\Entity\LossReport $lossReport) {
  332.         $this->lossReports->removeElement($lossReport);
  333.     }
  334.     /**
  335.      * Get lossReports
  336.      *
  337.      * @return \Doctrine\Common\Collections\Collection
  338.      */
  339.     public function getLossReports() {
  340.         return $this->lossReports;
  341.     }
  342. }