<?php
namespace App\Entity;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: "App\Repository\PaymentMethodRepository")]
#[ORM\Table(name: "payment_method")]
class PaymentMethod {
#[ORM\Id]
#[ORM\Column(type: "integer")]
#[ORM\GeneratedValue(strategy: "AUTO")]
private ?int $id;
#[ORM\ManyToMany(targetEntity: LossReport::class, mappedBy: "paymentMethods", cascade: ["persist"])]
private Collection|array $lossReports;
#[ORM\Column(type: "boolean")]
private bool $isDeleted = false;
#[ORM\ManyToMany(targetEntity: ComplaintX::class, mappedBy: "paymentMethods", cascade: ["persist"])]
private Collection|array $complaintXs;
#[ORM\ManyToMany(targetEntity: ItemsListComplaint::class, mappedBy: "paymentMethods", cascade: ["persist"])]
private Collection|array $itemsListComplaints;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: "paymentMethods")]
#[ORM\JoinColumn(nullable: false)]
private User $user;
#[ORM\Column(type: "string", length: 255)]
private string $bank;
#[ORM\Column(type: "string", length: 255, nullable: true)]
#[Assert\Choice(callback: "getTypes", multiple: false)]
private ?string $type;
#[ORM\Column(name: "lastName", type: "string", length: 255)]
private string $lastName;
#[ORM\Column(name: "firstName", type: "string", length: 255)]
private string $firstName;
#[ORM\Column(name: "stripeCardId", type: "string", length: 255)]
private string $stripeCardId;
public function __toString() {
return "#" . $this->id . " - " . $this->stripeCardId;
}
/**
*
*/
public static function getTypes() {
$arr = [
'American Express',
'MasterCard',
'VISA',
];
return array_combine($arr, $arr);
}
/**
*
*/
public static function getBanks() {
$arr = [
"Allianz Banque",
"Anytime",
"AXA Banque",
"B For Bank",
"Banque Accord",
"Banque Casino",
"Banque de Savoie",
"Banque Fédérale Mutualiste",
"Banque Hottinguer",
"Banque Palatine",
"Banque Populaire",
"Banque Privée Européenne",
"Barclays",
"BNP Paribas",
"Boursorama Banque",
"BRED",
"Caisse d'Epargne",
"Carrefour Banque",
"CCSO",
"CIC",
"Compte Nickel",
"Coopabanque",
"Cortal Consors",
"Crédit agricole",
"Crédit coopératif",
"Crédit du nord",
"Crédit mutuel",
"C-Zam",
"Ditto Bank",
"e.LCL",
"Eko",
"Fortis Banque",
"Fortuneo",
"Groupama Banque",
"Hello bank",
"HSBC",
"ING Direct",
"La Banque Postale",
"L'agence directe",
"L'Agence en ligne",
"LCL",
"Legal & General",
"Lydia",
"Manager.one",
"Mirabaud",
"Monabanq",
"Morning",
"N26",
"Natixis ",
"Orange Bank",
"PCS",
"Qonto ",
"Revolut",
"Rothschild",
"SmartPay",
"Société Générale",
"Wormser Frères",
];
return array_combine($arr, $arr);
}
/**
* Get id
*
* @return int
*/
public function getId() {
return $this->id;
}
/**
* Set bank
*
* @param string $bank
*
* @return PaymentMethod
*/
public function setBank($bank) {
$this->bank = $bank;
return $this;
}
/**
* Get bank
*
* @return string
*/
public function getBank() {
return $this->bank;
}
/**
* Set type
*
* @param string $type
*
* @return PaymentMethod
*/
public function setType($type) {
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return string
*/
public function getType() {
return $this->type;
}
/**
* Set lastName
*
* @param string $lastName
*
* @return PaymentMethod
*/
public function setLastName($lastName) {
$this->lastName = $lastName;
return $this;
}
/**
* Get lastName
*
* @return string
*/
public function getLastName() {
return $this->lastName;
}
/**
* Set firstName
*
* @param string $firstName
*
* @return PaymentMethod
*/
public function setFirstName($firstName) {
$this->firstName = $firstName;
return $this;
}
/**
* Get firstName
*
* @return string
*/
public function getFirstName() {
return $this->firstName;
}
/**
* Set stripeCardId
*
* @param string $stripeCardId
*
* @return PaymentMethod
*/
public function setStripeCardId($stripeCardId) {
$this->stripeCardId = $stripeCardId;
return $this;
}
/**
* Get stripeCardId
*
* @return string
*/
public function getStripeCardId() {
return $this->stripeCardId;
}
/**
* Set user
*
* @param \App\Entity\User $user
*
* @return PaymentMethod
*/
public function setUser(\App\Entity\User $user) {
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \App\Entity\User
*/
public function getUser() {
return $this->user;
}
/**
* Set isDeleted
*
* @param boolean $isDeleted
*
* @return PaymentMethod
*/
public function setIsDeleted($isDeleted) {
$this->isDeleted = $isDeleted;
return $this;
}
/**
* Get isDeleted
*
* @return boolean
*/
public function getIsDeleted() {
return $this->isDeleted;
}
/**
* Constructor
*/
public function __construct() {
$this->itemsListComplaints = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add itemsListComplaint
*
* @param \App\Entity\ItemsListComplaint $itemsListComplaint
*
* @return PaymentMethod
*/
public function addItemsListComplaint(\App\Entity\ItemsListComplaint $itemsListComplaint) {
$this->itemsListComplaints[] = $itemsListComplaint;
return $this;
}
/**
* Remove itemsListComplaint
*
* @param \App\Entity\ItemsListComplaint $itemsListComplaint
*/
public function removeItemsListComplaint(\App\Entity\ItemsListComplaint $itemsListComplaint) {
$this->itemsListComplaints->removeElement($itemsListComplaint);
}
/**
* Get itemsListComplaints
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getItemsListComplaints() {
return $this->itemsListComplaints;
}
/**
* Add complaintX
*
* @param \App\Entity\ComplaintX $complaintX
*
* @return PaymentMethod
*/
public function addComplaintX(\App\Entity\ComplaintX $complaintX) {
$this->complaintXs[] = $complaintX;
return $this;
}
/**
* Remove complaintX
*
* @param \App\Entity\ComplaintX $complaintX
*/
public function removeComplaintX(\App\Entity\ComplaintX $complaintX) {
$this->complaintXs->removeElement($complaintX);
}
/**
* Get complaintXs
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getComplaintXs() {
return $this->complaintXs;
}
/**
* Add lossReport
*
* @param \App\Entity\LossReport $lossReport
*
* @return PaymentMethod
*/
public function addLossReport(\App\Entity\LossReport $lossReport) {
$this->lossReports[] = $lossReport;
return $this;
}
/**
* Remove lossReport
*
* @param \App\Entity\LossReport $lossReport
*/
public function removeLossReport(\App\Entity\LossReport $lossReport) {
$this->lossReports->removeElement($lossReport);
}
/**
* Get lossReports
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLossReports() {
return $this->lossReports;
}
}