src/Entity/DeeplTranslationParam.php line 11

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. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\DeeplTranslationParamRepository")
  8.  */
  9. class DeeplTranslationParam
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $apiKey;
  21.     /**
  22.      * @var \Doctrine\Common\Collections\Collection
  23.      *
  24.      * @ORM\OneToMany(targetEntity="App\Entity\DeeplTranslationConfig", mappedBy="translationParam", cascade={"persist", "remove"})
  25.      */
  26.     private $deeplTranslationConfigs;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="deeplTranslationParams")
  29.      */
  30.     private $owner;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="deeplTranslationParams")
  33.      */
  34.     private $entity;
  35.     /**
  36.      * @ORM\Column(type="datetime", nullable=true)
  37.      */
  38.     private $createdAt;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true)
  41.      */
  42.     private $updatedAt;
  43.     /**
  44.      * @ORM\Column(type="integer", nullable=true)
  45.      */
  46.     private $state;
  47.     public function __construct()
  48.     {
  49.         $this->deeplTranslationConfigs = new ArrayCollection();
  50.     }
  51.     public function getId() : ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getApiKey() : ?string
  56.     {
  57.         return $this->apiKey;
  58.     }
  59.     public function setApiKey(?string $apiKey) : self
  60.     {
  61.         $this->apiKey $apiKey;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection|DeeplTranslationConfig[]
  66.      */
  67.     public function getDeeplTranslationConfigs() : Collection
  68.     {
  69.         return $this->deeplTranslationConfigs;
  70.     }
  71.     public function addDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig) : self
  72.     {
  73.         if (!$this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
  74.             $this->deeplTranslationConfigs[] = $deeplTranslationConfig;
  75.             $deeplTranslationConfig->setTranslationParam($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removeDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig) : self
  80.     {
  81.         if ($this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
  82.             $this->deeplTranslationConfigs->removeElement($deeplTranslationConfig);
  83.             // set the owning side to null (unless already changed)
  84.             if ($deeplTranslationConfig->getTranslationParam() === $this) {
  85.                 $deeplTranslationConfig->setTranslationParam(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     public function getOwner() : ?User
  91.     {
  92.         return $this->owner;
  93.     }
  94.     public function setOwner(?User $owner) : self
  95.     {
  96.         $this->owner $owner;
  97.         return $this;
  98.     }
  99.     public function getEntity() : ?DnsitEntity
  100.     {
  101.         return $this->entity;
  102.     }
  103.     public function setEntity(?DnsitEntity $entity) : self
  104.     {
  105.         $this->entity $entity;
  106.         return $this;
  107.     }
  108.     public function getCreatedAt() : ?\DateTimeInterface
  109.     {
  110.         return $this->createdAt;
  111.     }
  112.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  113.     {
  114.         $this->createdAt $createdAt;
  115.         return $this;
  116.     }
  117.     public function getUpdatedAt() : ?\DateTimeInterface
  118.     {
  119.         return $this->updatedAt;
  120.     }
  121.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  122.     {
  123.         $this->updatedAt $updatedAt;
  124.         return $this;
  125.     }
  126.     public function getState() : ?int
  127.     {
  128.         return $this->state;
  129.     }
  130.     public function setState(?int $state) : self
  131.     {
  132.         $this->state $state;
  133.         return $this;
  134.     }
  135. }