src/Entity/Gos/PaymentOptions.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\Gos\PaymentOptionsRepository")
  11.  * @ORM\HasLifecycleCallbacks()
  12.  * @Vich\Uploadable()
  13.  */
  14. class PaymentOptions
  15. {
  16.     /**
  17.      * @ORM\Id()
  18.      * @ORM\GeneratedValue()
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $paymentName;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="PaymentSystem", inversedBy="paymentOptions")
  28.      * @ORM\JoinColumn()
  29.      */
  30.     private $paymentSystem;
  31.     /**
  32.      * @Assert\File(
  33.      *     maxSize="1M",
  34.      *     mimeTypes={"image/png", "image/jpeg"}
  35.      * )
  36.      *
  37.      * @Vich\UploadableField(mapping="product_images", fileNameProperty="iconFileName")
  38.      *
  39.      * @var File
  40.      */
  41.     private $icon;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $iconFileName;
  46.     /**
  47.      * @ORM\Column(type="text", nullable=true)
  48.      */
  49.     private $information;
  50.     /**
  51.      * @ORM\Column(type="string", nullable=true)
  52.      */
  53.     private $linkToPaymentInstructions;
  54.     /**
  55.      * @ORM\ManyToMany(targetEntity="Country", inversedBy="paymentOptions")
  56.      * @ORM\JoinColumn()
  57.      */
  58.     private $country;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=true)
  61.      */
  62.     private $isAutoRedirect;
  63.     /**
  64.      * @ORM\Column(type="datetime")
  65.      */
  66.     private $createdAt;
  67.     /**
  68.      * @ORM\Column(type="datetime", nullable=true)
  69.      */
  70.     private $updatedAt;
  71.     /**
  72.      * @ORM\Column(type="text", nullable=true)
  73.      */
  74.     private $description;
  75.     /**
  76.      * @ORM\Column(type="integer", nullable=true)
  77.      */
  78.     private $position;
  79.     public function __construct()
  80.     {
  81.         $this->country = new ArrayCollection();
  82.     }
  83.     /** @ORM\PrePersist() */
  84.     public function onPrePersist()
  85.     {
  86.         $this->createdAt = new \DateTime();
  87.     }
  88.     /** @ORM\PreUpdate() */
  89.     public function onPreUpdate()
  90.     {
  91.         $this->updatedAt = new \DateTime();
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function setIcon(?File $image): self
  98.     {
  99.         $this->icon $image;
  100.         if ($image)
  101.         {
  102.             // It is required that at least one field changes if you are using doctrine
  103.             // otherwise the event listeners won't be called and the file is lost
  104.             $this->updatedAt = new \DateTimeImmutable();
  105.         }
  106.         return $this;
  107.     }
  108.     public function getIcon(): ?File
  109.     {
  110.         return $this->icon;
  111.     }
  112.     public function getIconFileName(): ?string
  113.     {
  114.         return $this->iconFileName;
  115.     }
  116.     public function setIconFileName(?string $iconFileName): self
  117.     {
  118.         $this->iconFileName $iconFileName;
  119.         return $this;
  120.     }
  121.     public function getInformation(): ?string
  122.     {
  123.         return $this->information;
  124.     }
  125.     public function setInformation(?string $information): self
  126.     {
  127.         $this->information $information;
  128.         return $this;
  129.     }
  130.     public function getCreatedAt(): ?\DateTimeInterface
  131.     {
  132.         return $this->createdAt;
  133.     }
  134.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  135.     {
  136.         $this->createdAt $createdAt;
  137.         return $this;
  138.     }
  139.     public function getUpdatedAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->updatedAt;
  142.     }
  143.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  144.     {
  145.         $this->updatedAt $updatedAt;
  146.         return $this;
  147.     }
  148.     public function getLinkToPaymentInstructions(): ?string
  149.     {
  150.         return $this->linkToPaymentInstructions;
  151.     }
  152.     public function setLinkToPaymentInstructions(?string $linkToPaymentInstructions): self
  153.     {
  154.         $this->linkToPaymentInstructions $linkToPaymentInstructions;
  155.         return $this;
  156.     }
  157.     /**
  158.      * @return Collection|Country[]
  159.      */
  160.     public function getCountry(): Collection
  161.     {
  162.         return $this->country;
  163.     }
  164.     public function addCountry(Country $country): self
  165.     {
  166.         if (!$this->country->contains($country)) {
  167.             $this->country[] = $country;
  168.         }
  169.         return $this;
  170.     }
  171.     public function removeCountry(Country $country): self
  172.     {
  173.         if ($this->country->contains($country)) {
  174.             $this->country->removeElement($country);
  175.         }
  176.         return $this;
  177.     }
  178.     public function getPaymentSystem(): ?PaymentSystem
  179.     {
  180.         return $this->paymentSystem;
  181.     }
  182.     public function setPaymentSystem(?PaymentSystem $paymentSystem): self
  183.     {
  184.         $this->paymentSystem $paymentSystem;
  185.         return $this;
  186.     }
  187.     public function getIsAutoRedirect(): ?bool
  188.     {
  189.         return $this->isAutoRedirect;
  190.     }
  191.     public function setIsAutoRedirect(?bool $isAutoRedirect): self
  192.     {
  193.         $this->isAutoRedirect $isAutoRedirect;
  194.         return $this;
  195.     }
  196.     public function getPaymentName(): ?string
  197.     {
  198.         return $this->paymentName;
  199.     }
  200.     public function setPaymentName(string $paymentName): self
  201.     {
  202.         $this->paymentName $paymentName;
  203.         return $this;
  204.     }
  205.     public function getDescription(): ?string
  206.     {
  207.         return $this->description;
  208.     }
  209.     public function setDescription(?string $description): self
  210.     {
  211.         $this->description $description;
  212.         return $this;
  213.     }
  214.     public function getPosition(): ?int
  215.     {
  216.         return $this->position;
  217.     }
  218.     public function setPosition(?int $position): self
  219.     {
  220.         $this->position $position;
  221.         return $this;
  222.     }
  223. }