| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- <?php
- namespace AppBundle\Entity\Bank;
- use AppBundle\Entity\AccessAndFunction\Access;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Entity\Person\Person;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Coordonnées bancaires des Person et Organization
- *
- * @Iri("http://schema.org/BankAccount")
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Bank\Repository\BankAccountRepository')]
- class BankAccount
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['bankaccount', 'access_details_person', 'organization_details', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $id;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Length(max: 255, maxMessage: 'invalid-max-length')]
- #[Groups(['bankaccount', 'access_details_person', 'organization_details_bankaccount', 'build_bills_access'])]
- private $bankName;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 11, nullable: true)]
- #[Assert\Bic(message: 'This is not a valid Business Identifier Code (BIC).')]
- #[Groups(['bankaccount', 'access_details_person', 'organization_details_bankaccount', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $bic;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Groups(['bankaccount'])]
- private $bicInvalid;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 34, nullable: true)]
- #[Assert\Iban(message: 'This is not a valid International Bank Account Number (IBAN).')]
- #[Groups(['bankaccount', 'access_details_person', 'organization_details_bankaccount', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $iban;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Groups(['bankaccount'])]
- private $ibanInvalid;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['bankaccount', 'access_details_person', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $holderIdDifferent = false;
- /**
- * 0 => jamais facturé, 1 => facturé 1 fois, 2 => facturé plusieurs fois
- * @var int
- */
- #[ORM\Column(type: 'integer', nullable: true, options: ['default' => 0])]
- #[Groups(['bankaccount', 'access_details_person', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $countInvoiced = 0;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['bankaccount', 'access_details_person', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $holder;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['bankaccount', 'access_details_person', 'sepa_debit_mandate_person', 'build_bills_access'])]
- private $principal = false;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Length(max: 255, maxMessage: 'invalid-max-length')]
- #[Groups(['bankaccount', 'access_details_person', 'build_bills_access'])]
- private $debitAddress;
- /**
- * @var Organization
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Organization\Organization', mappedBy: 'bankAccount', cascade: ['persist'])]
- private $organization;
- /**
- * @var Person
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Person\Person', mappedBy: 'bankAccount', cascade: ['persist'])]
- private $person;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 35, unique: true, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['bankaccount', 'access_details_person', 'sepa_debit_mandate_person', 'build_bills_access'])]
- #[Assert\Length(max: 35, maxMessage: 'invalid-max-length')]
- private $rum;
- /**
- * @var
- *
- * @Iri("https://schema.org/birthDate")
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date(message: 'invalid-date')]
- #[Groups(['bankaccount', 'access_details_person', 'build_bills_access'])]
- private $signatureDateSamplingMandate;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->organization = new \Doctrine\Common\Collections\ArrayCollection();
- $this->person = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Get organization
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getOrganization()
- {
- return $this->organization;
- }
- /**
- * Get person
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getPerson()
- {
- return $this->person;
- }
- /**
- * Sets bankName.
- *
- * @param string $bankName
- *
- * @return $this
- */
- public function setBankName($bankName)
- {
- $this->bankName = $bankName;
- return $this;
- }
- /**
- * Gets bankName.
- *
- * @return string
- */
- public function getBankName()
- {
- return $this->bankName;
- }
- /**
- * Sets bic.
- *
- * @param string $bic
- *
- * @return $this
- */
- public function setBic($bic)
- {
- $this->bic = $bic;
- if(!is_null($bic) && !is_null($this->getBicInvalid()))
- $this->setBicInvalid(NULL);
- return $this;
- }
- /**
- * Gets bic.
- *
- * @return string
- */
- public function getBic()
- {
- return $this->bic;
- }
- /**
- * Sets bic Invalid.
- *
- * @param string $bicInvalid
- *
- * @return $this
- */
- public function setBicInvalid($bicInvalid)
- {
- $this->bicInvalid = is_null($this->bic) ? $bicInvalid : NULL;
- return $this;
- }
- /**
- * Gets bic Invalid.
- *
- * @return string
- */
- public function getBicInvalid()
- {
- return $this->bicInvalid;
- }
- /**
- * Sets iban.
- *
- * @param string $iban
- *
- * @return $this
- */
- public function setIban($iban)
- {
- $this->iban = $iban;
- if(!is_null($iban) && !is_null($this->getIbanInvalid()))
- $this->setIbanInvalid(NULL);
- return $this;
- }
- /**
- * Gets iban.
- *
- * @return string
- */
- public function getIban()
- {
- return $this->iban;
- }
- /**
- * Sets ibanInvalid.
- *
- * @param string $ibanInvalid
- *
- * @return $this
- */
- public function setIbanInvalid($ibanInvalid)
- {
- $this->ibanInvalid = is_null($this->iban) ? $ibanInvalid : NULL;
- return $this;
- }
- /**
- * Gets ibanInvalid.
- *
- * @return string
- */
- public function getIbanInvalid()
- {
- return $this->ibanInvalid;
- }
- /**
- * Sets holder.
- *
- * @param string $holder
- *
- * @return $this
- */
- public function setHolder($holder)
- {
- $this->holder = $holder;
- return $this;
- }
- /**
- * Gets holder.
- *
- * @return string
- */
- public function getHolder()
- {
- return $this->holder;
- }
- /**
- * Sets principal.
- *
- * @param bool $principal
- *
- * @return $this
- */
- public function setPrincipal($principal)
- {
- $this->principal = $principal;
- return $this;
- }
- /**
- * Gets principal.
- *
- * @return bool
- */
- public function getPrincipal()
- {
- return $this->principal;
- }
- /**
- * Sets debitAddress.
- *
- * @param string $debitAddress
- *
- * @return $this
- */
- public function setDebitAddress($debitAddress)
- {
- $this->debitAddress = $debitAddress;
- return $this;
- }
- /**
- * Gets debitAddress.
- *
- * @return string
- */
- public function getDebitAddress()
- {
- return $this->debitAddress;
- }
- /**
- * Add organization
- *
- * @param \AppBundle\Entity\Organization\Organization $organization
- *
- * @return BankAccount
- */
- public function addOrganization(\AppBundle\Entity\Organization\Organization $organization)
- {
- $this->organization[] = $organization;
- return $this;
- }
- /**
- * Remove organization
- *
- * @param \AppBundle\Entity\Organization\Organization $organization
- */
- public function removeOrganization(\AppBundle\Entity\Organization\Organization $organization)
- {
- $this->organization->removeElement($organization);
- }
- /**
- * Add person
- *
- * @param \AppBundle\Entity\Person\Person $person
- *
- * @return BankAccount
- */
- public function addPerson(\AppBundle\Entity\Person\Person $person)
- {
- $this->person[] = $person;
- return $this;
- }
- /**
- * Remove person
- *
- * @param \AppBundle\Entity\Person\Person $person
- */
- public function removePerson(\AppBundle\Entity\Person\Person $person)
- {
- $this->person->removeElement($person);
- }
- /**
- * Get rum
- *
- * @return string
- */
- public function getRum()
- {
- return $this->rum;
- }
- /**
- * Set rum
- *
- * @param string $rum
- *
- * @return BankAccount
- */
- public function setRum($rum)
- {
- $this->rum = $rum;
- return $this;
- }
- /**
- * Set signatureDateSamplingMandate
- *
- * @param \DateTime $signatureDateSamplingMandate
- *
- * @return BankAccount
- */
- public function setSignatureDateSamplingMandate($signatureDateSamplingMandate)
- {
- $this->signatureDateSamplingMandate = $signatureDateSamplingMandate;
- return $this;
- }
- /**
- * Get signatureDateSamplingMandate
- *
- * @return \DateTime
- */
- public function getSignatureDateSamplingMandate()
- {
- return $this->signatureDateSamplingMandate ? $this->signatureDateSamplingMandate->format('Y-m-d') : $this->signatureDateSamplingMandate;
- }
- /**
- * Set holderIdDifferent
- *
- * @param boolean $holderIdDifferent
- *
- * @return BankAccount
- */
- public function setHolderIdDifferent($holderIdDifferent)
- {
- $this->holderIdDifferent = $holderIdDifferent;
- return $this;
- }
- /**
- * Get holderIdDifferent
- *
- * @return boolean
- */
- public function getHolderIdDifferent()
- {
- return $this->holderIdDifferent;
- }
- /**
- * Set countInvoiced
- *
- * @param integer $countInvoiced
- *
- * @return BankAccount
- */
- public function setCountInvoiced($countInvoiced)
- {
- $this->countInvoiced = $countInvoiced;
- return $this;
- }
- /**
- * Get countInvoiced
- *
- * @return integer
- */
- public function getCountInvoiced()
- {
- return $this->countInvoiced;
- }
- }
|