| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Core;
- use ApiPlatform\Core\Annotation\ApiResource;
- use App\Entity\Organization\Organization;
- use App\Repository\Core\BankAccountRepository;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Données bancaire d'une Person ou d'une Organization
- *
- * @ApiResource(
- * itemOperations={
- * "get"={"security"="is_granted('BANK_ACCOUNT_READ', object)"},
- * "put"={"security"="is_granted('BANK_ACCOUNT_EDIT', object)"},
- * }
- * )
- * @ORM\Entity(repositoryClass=BankAccountRepository::class)
- */
- class BankAccount
- {
- /**
- * @ORM\Id
- * @ORM\GeneratedValue
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- private $bankName;
- /**
- * @ORM\Column(type="string", length=11, nullable=true)
- * @Assert\Bic(
- * message="invalid_bic"
- * )
- */
- private $bic;
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- private $bicInvalid;
- /**
- * @ORM\Column(type="string", length=34, nullable=true)
- * @Assert\Iban(
- * message="invalid_iban"
- * )
- */
- private $iban;
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- private $ibanInvalid;
- /**
- * @ORM\Column(type="boolean", options={"default" : false})
- */
- private $holderIdDifferent = false;
- /**
- * 0 => jamais facturé, 1 => facturé 1 fois, 2 => facturé plusieurs fois
- * @ORM\Column(type="integer", options={"default" : 0})
- */
- private $countInvoiced;
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- private $holder;
- /**
- * @ORM\Column(type="boolean", options={"default" : false})
- * @Assert\NotNull
- */
- private $principal = false;
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- private $debitAddress;
- /**
- * @ORM\Column(type="string", length=35, nullable=true, unique=true)
- */
- private $rum;
- /**
- * @ORM\Column(type="date", nullable=true)
- */
- private $signatureDateSamplingMandate;
- /**
- * @ORM\ManyToMany(targetEntity=Organization::class, inversedBy="bankAccounts")
- * @ORM\JoinTable(name="organization_bankaccount")
- */
- private $organization;
- public function __construct()
- {
- $this->organization = new ArrayCollection();
- }
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getBankName(): ?string
- {
- return $this->bankName;
- }
- public function setBankName(?string $bankName): self
- {
- $this->bankName = $bankName;
- return $this;
- }
- public function getBic(): ?string
- {
- return $this->bic;
- }
- public function setBic(?string $bic): self
- {
- $this->bic = $bic;
- return $this;
- }
- public function getBicInvalid(): ?string
- {
- return $this->bicInvalid;
- }
- public function setBicInvalid(?string $bicInvalid): self
- {
- $this->bicInvalid = $bicInvalid;
- return $this;
- }
- public function getIban(): ?string
- {
- return $this->iban;
- }
- public function setIban(?string $iban): self
- {
- $this->iban = $iban;
- return $this;
- }
- public function getIbanInvalid(): ?string
- {
- return $this->ibanInvalid;
- }
- public function setIbanInvalid(?string $ibanInvalid): self
- {
- $this->ibanInvalid = $ibanInvalid;
- return $this;
- }
- public function getHolderIdDifferent(): ?bool
- {
- return $this->holderIdDifferent;
- }
- public function setHolderIdDifferent(bool $holderIdDifferent): self
- {
- $this->holderIdDifferent = $holderIdDifferent;
- return $this;
- }
- public function getCountInvoiced(): ?int
- {
- return $this->countInvoiced;
- }
- public function setCountInvoiced(int $countInvoiced): self
- {
- $this->countInvoiced = $countInvoiced;
- return $this;
- }
- public function getHolder(): ?string
- {
- return $this->holder;
- }
- public function setHolder(?string $holder): self
- {
- $this->holder = $holder;
- return $this;
- }
- public function getPrincipal(): ?bool
- {
- return $this->principal;
- }
- public function setPrincipal(bool $principal): self
- {
- $this->principal = $principal;
- return $this;
- }
- public function getDebitAddress(): ?string
- {
- return $this->debitAddress;
- }
- public function setDebitAddress(?string $debitAddress): self
- {
- $this->debitAddress = $debitAddress;
- return $this;
- }
- /**
- * @return Collection|Organization[]
- */
- public function getOrganization(): Collection
- {
- return $this->organization;
- }
- public function addOrganization(Organization $organization): self
- {
- if (!$this->organization->contains($organization)) {
- $this->organization[] = $organization;
- }
- return $this;
- }
- public function removeOrganization(Organization $organization): self
- {
- $this->organization->removeElement($organization);
- return $this;
- }
- public function getRum(): ?string
- {
- return $this->rum;
- }
- public function setRum(?string $rum): self
- {
- $this->rum = $rum;
- return $this;
- }
- public function getSignatureDateSamplingMandate(): ?\DateTimeInterface
- {
- return $this->signatureDateSamplingMandate;
- }
- public function setSignatureDateSamplingMandate(?\DateTimeInterface $signatureDateSamplingMandate): self
- {
- $this->signatureDateSamplingMandate = $signatureDateSamplingMandate;
- return $this;
- }
- }
|