<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity (repositoryClass="App\Repository\DeeplTranslationParamRepository")
*/
class DeeplTranslationParam
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $apiKey;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\DeeplTranslationConfig", mappedBy="translationParam", cascade={"persist", "remove"})
*/
private $deeplTranslationConfigs;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="deeplTranslationParams")
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="deeplTranslationParams")
*/
private $entity;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $state;
public function __construct()
{
$this->deeplTranslationConfigs = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getApiKey() : ?string
{
return $this->apiKey;
}
public function setApiKey(?string $apiKey) : self
{
$this->apiKey = $apiKey;
return $this;
}
/**
* @return Collection|DeeplTranslationConfig[]
*/
public function getDeeplTranslationConfigs() : Collection
{
return $this->deeplTranslationConfigs;
}
public function addDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig) : self
{
if (!$this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
$this->deeplTranslationConfigs[] = $deeplTranslationConfig;
$deeplTranslationConfig->setTranslationParam($this);
}
return $this;
}
public function removeDeeplTranslationConfig(DeeplTranslationConfig $deeplTranslationConfig) : self
{
if ($this->deeplTranslationConfigs->contains($deeplTranslationConfig)) {
$this->deeplTranslationConfigs->removeElement($deeplTranslationConfig);
// set the owning side to null (unless already changed)
if ($deeplTranslationConfig->getTranslationParam() === $this) {
$deeplTranslationConfig->setTranslationParam(null);
}
}
return $this;
}
public function getOwner() : ?User
{
return $this->owner;
}
public function setOwner(?User $owner) : self
{
$this->owner = $owner;
return $this;
}
public function getEntity() : ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity) : self
{
$this->entity = $entity;
return $this;
}
public function getCreatedAt() : ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt) : self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt() : ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState() : ?int
{
return $this->state;
}
public function setState(?int $state) : self
{
$this->state = $state;
return $this;
}
}