src/Admin/Modules/Contract/Entity/ContractLeadConfig.php line 18

  1. <?php
  2. namespace App\Admin\Modules\Contract\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Gedmo\Translatable\Translatable;
  9. use App\Modules\User\Entity\User;
  10. /**
  11.  * @ORM\Table(name="contract_lead_config")
  12.  * @ORM\Entity(repositoryClass="App\Admin\Modules\Contract\Repository\ContractLeadConfigRepository")
  13.  * @Gedmo\TranslationEntity(class="App\Admin\Modules\Contract\Entity\ContractLeadConfigTranslation")
  14.  */
  15. class ContractLeadConfig implements Translatable
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(type="bigint", options={"unsigned"=true}))
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     protected $id;
  25.     
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="thread_name", type="string", length=255, nullable=false)
  30.      */
  31.     private $threadName;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="after_wdget_form_submit_message", type="text", length=65535, nullable=true)
  36.      * @Gedmo\Translatable
  37.      */
  38.     private $afterWdgetFormSubmitMessage;
  39.     
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="voucher_qr_code_external_url", type="string", length=1024, nullable=true)
  44.      */
  45.     private $voucherQRCodeExternalUrl;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(name="notify_email", type="string", length=255, nullable=true)
  50.      */
  51.     private $notifyEmail;
  52.     /**
  53.      * @var \App\Modules\User\Entity\User
  54.      *
  55.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")
  56.      * @ORM\JoinColumns({
  57.      *   @ORM\JoinColumn(name="id_admin_user", referencedColumnName="id", nullable=true, onDelete="CASCADE")
  58.      * })
  59.      */
  60.     private $adminUser;
  61.     
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="App\Admin\Modules\Contract\Entity\ContractLeadConfigParam", mappedBy="config", cascade={"persist"}, orphanRemoval=true)
  64.      * @ORM\OrderBy({"id"="ASC"})
  65.      */
  66.     private $params;
  67.     
  68.     /**
  69.      * @ORM\OneToMany(targetEntity="App\Admin\Modules\Contract\Entity\ContractLeadConfigFlag", mappedBy="config", cascade={"persist"}, orphanRemoval=true)
  70.      * @ORM\OrderBy({"id"="ASC"})
  71.      */
  72.     private $flags;
  73.     public function __construct()
  74.     {
  75.         $this->params = new ArrayCollection();
  76.         $this->flags = new ArrayCollection();
  77.     }
  78.     
  79.     public function __toString()
  80.     {
  81.         return $this->threadName;
  82.     }
  83.     public function getId(): ?string
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getAdminUser(): ?User
  88.     {
  89.         return $this->adminUser;
  90.     }
  91.     public function setAdminUser(?User $adminUser): self
  92.     {
  93.         $this->adminUser $adminUser;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, ContractLeadConfigParam>
  98.      */
  99.     public function getParams(): Collection
  100.     {
  101.         return $this->params;
  102.     }
  103.     public function addParam(ContractLeadConfigParam $param): self
  104.     {
  105.         if (!$this->params->contains($param)) {
  106.             $this->params->add($param);
  107.             $param->setConfig($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeParam(ContractLeadConfigParam $param): self
  112.     {
  113.         if ($this->params->removeElement($param)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($param->getConfig() === $this) {
  116.                 $param->setConfig(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, ContractLeadConfigFlag>
  123.      */
  124.     public function getFlags(): Collection
  125.     {
  126.         return $this->flags;
  127.     }
  128.     public function addFlag(ContractLeadConfigFlag $flag): self
  129.     {
  130.         if (!$this->flags->contains($flag)) {
  131.             $this->flags->add($flag);
  132.             $flag->setConfig($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeFlag(ContractLeadConfigFlag $flag): self
  137.     {
  138.         if ($this->flags->removeElement($flag)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($flag->getConfig() === $this) {
  141.                 $flag->setConfig(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     public function getAfterWdgetFormSubmitMessage(): ?string
  147.     {
  148.         return $this->afterWdgetFormSubmitMessage;
  149.     }
  150.     public function setAfterWdgetFormSubmitMessage(?string $afterWdgetFormSubmitMessage): self
  151.     {
  152.         $this->afterWdgetFormSubmitMessage $afterWdgetFormSubmitMessage;
  153.         return $this;
  154.     }
  155.     public function getThreadName(): ?string
  156.     {
  157.         return $this->threadName;
  158.     }
  159.     public function setThreadName(string $threadName): self
  160.     {
  161.         $this->threadName $threadName;
  162.         return $this;
  163.     }
  164.     public function getRedirectVoucherQRCodeToExternalUrl(): ?bool
  165.     {
  166.         return $this->redirectVoucherQRCodeToExternalUrl;
  167.     }
  168.     public function setRedirectVoucherQRCodeToExternalUrl(bool $redirectVoucherQRCodeToExternalUrl): self
  169.     {
  170.         $this->redirectVoucherQRCodeToExternalUrl $redirectVoucherQRCodeToExternalUrl;
  171.         return $this;
  172.     }
  173.     public function getVoucherQRCodeExternalUrl(): ?string
  174.     {
  175.         return $this->voucherQRCodeExternalUrl;
  176.     }
  177.     public function setVoucherQRCodeExternalUrl(?string $voucherQRCodeExternalUrl): self
  178.     {
  179.         $this->voucherQRCodeExternalUrl $voucherQRCodeExternalUrl;
  180.         return $this;
  181.     }
  182.     public function getNotifyEmail(): ?string
  183.     {
  184.         return $this->notifyEmail;
  185.     }
  186.     public function setNotifyEmail(?string $notifyEmail): self
  187.     {
  188.         $this->notifyEmail $notifyEmail;
  189.         return $this;
  190.     }
  191. }