src/Entity/BankAccount.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(
  9.  *     repositoryClass="App\Repository\BankAccountRepository"
  10.  * )
  11.  * @ORM\Table(
  12.  *     name="bank_account",
  13.  *     options={"collate"="utf8_swedish_ci"}
  14.  * )
  15.  */
  16. class BankAccount implements EntityInterface
  17. {
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\Column(
  21.      *     type="integer"
  22.      * )
  23.      * @ORM\GeneratedValue(
  24.      *     strategy="AUTO"
  25.      * )
  26.      *
  27.      * @var int|null
  28.      */
  29.     protected ?int $id null;
  30.     /**
  31.      * @ORM\Column(
  32.      *     type="string",
  33.      *     length=100
  34.      * )
  35.      * @Assert\NotBlank
  36.      *
  37.      * @var string
  38.      */
  39.     protected string $bank;
  40.     /**
  41.      * @ORM\OneToMany(
  42.      *     targetEntity="Company",
  43.      *     mappedBy="bankAccount"
  44.      * )
  45.      *
  46.      * @var Collection<Company>
  47.      */
  48.     protected $companies;
  49.     /**
  50.      * @ORM\Column(
  51.      *     name="fivaldi_id",
  52.      *     type="integer"
  53.      * )
  54.      * @Assert\NotNull
  55.      * @Assert\Range(
  56.      *     min=0
  57.      * )
  58.      *
  59.      * @var int
  60.      */
  61.     protected int $fivaldiId;
  62.     /**
  63.      * @ORM\Column(
  64.      *     type="string",
  65.      *     length=100
  66.      * )
  67.      * @Assert\NotBlank
  68.      *
  69.      * @var string
  70.      */
  71.     protected string $name;
  72.     /**
  73.      * @ORM\Column(
  74.      *     type="string",
  75.      *     length=2000,
  76.      *     nullable=true
  77.      * )
  78.      *
  79.      * @var string|null
  80.      */
  81.     protected ?string $notes null;
  82.     /**
  83.      * @ORM\Column(
  84.      *     type="string",
  85.      *     length=50
  86.      * )
  87.      * @Assert\NotBlank
  88.      *
  89.      * @var string
  90.      */
  91.     protected string $number;
  92.     /**
  93.      * @ORM\Column(
  94.      *     type="string",
  95.      *     length=20
  96.      * )
  97.      * @Assert\NotBlank
  98.      *
  99.      * @var string
  100.      */
  101.     protected string $swift;
  102.     /**
  103.      * @param string $name
  104.      * @param int    $fivaldiId
  105.      * @param string $bank
  106.      * @param string $number
  107.      * @param string $swift
  108.      */
  109.     public function __construct(string $nameint $fivaldiIdstring $bankstring $numberstring $swift)
  110.     {
  111.         $this->name $name;
  112.         $this->fivaldiId $fivaldiId;
  113.         $this->bank $bank;
  114.         $this->number $number;
  115.         $this->swift $swift;
  116.         $this->companies = new ArrayCollection();
  117.     }
  118.     /**
  119.      * @return string
  120.      */
  121.     public function __toString(): string
  122.     {
  123.         return $this->name;
  124.     }
  125.     /**
  126.      * @return string
  127.      */
  128.     public function getBank(): string
  129.     {
  130.         return $this->bank;
  131.     }
  132.     /**
  133.      * @return Collection<Company>
  134.      */
  135.     public function getCompanies(): Collection
  136.     {
  137.         return $this->companies;
  138.     }
  139.     /**
  140.      * @return int
  141.      */
  142.     public function getFivaldiId(): int
  143.     {
  144.         return $this->fivaldiId;
  145.     }
  146.     /**
  147.      * @return int|null
  148.      */
  149.     public function getId(): ?int
  150.     {
  151.         return $this->id;
  152.     }
  153.     /**
  154.      * @return string
  155.      */
  156.     public function getName(): string
  157.     {
  158.         return $this->name;
  159.     }
  160.     /**
  161.      * @return null|string
  162.      */
  163.     public function getNotes(): ?string
  164.     {
  165.         return $this->notes;
  166.     }
  167.     /**
  168.      * @return string
  169.      */
  170.     public function getNumber(): string
  171.     {
  172.         return $this->number;
  173.     }
  174.     /**
  175.      * @return string
  176.      */
  177.     public function getSwift(): string
  178.     {
  179.         return $this->swift;
  180.     }
  181.     /**
  182.      * @param string $bank
  183.      */
  184.     public function setBank(string $bank)
  185.     {
  186.         $this->bank $bank;
  187.     }
  188.     /**
  189.      * @param int $fivaldiId
  190.      */
  191.     public function setFivaldiId(int $fivaldiId)
  192.     {
  193.         $this->fivaldiId $fivaldiId;
  194.     }
  195.     /**
  196.      * @param string $name
  197.      */
  198.     public function setName(string $name)
  199.     {
  200.         $this->name $name;
  201.     }
  202.     /**
  203.      * @param string|null $notes
  204.      */
  205.     public function setNotes(?string $notes)
  206.     {
  207.         $this->notes $notes;
  208.     }
  209.     /**
  210.      * @param string $number
  211.      */
  212.     public function setNumber(string $number)
  213.     {
  214.         $this->number $number;
  215.     }
  216.     /**
  217.      * @param string $swift
  218.      */
  219.     public function setSwift(string $swift)
  220.     {
  221.         $this->swift $swift;
  222.     }
  223. }