81 lines
1.5 KiB
PHP
81 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Model\Database\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use App\Model\Database\Entity\Attributes\TId;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
*/
|
|
class Dictionary extends AbstractEntity
|
|
{
|
|
|
|
use Tid;
|
|
|
|
public function __construct($name,$fullname)
|
|
{
|
|
$this->name = $name;
|
|
$this->fullName = $fullname;
|
|
$this->translations = new ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="App\Model\Database\Entity\Translation", mappedBy="dictionary", cascade={"persist"})
|
|
* @var Collection&iterable<Translation>
|
|
*/
|
|
protected Collection $translations;
|
|
|
|
public function getTranslations()
|
|
{
|
|
return $this->translations;
|
|
}
|
|
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Language", inversedBy="dictionaries1")
|
|
* @ORM\JoinColumn(name="lang1_id", referencedColumnName="id")
|
|
*/
|
|
protected ?Language $lang1;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Language", inversedBy="dictionaries2")
|
|
* @ORM\JoinColumn(name="lang2_id", referencedColumnName="id")
|
|
*/
|
|
protected ?Language $lang2;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $name;
|
|
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $fullName;
|
|
|
|
public function setLang1($lang1)
|
|
{
|
|
$this->lang1 = $lang1;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function setLang2($lang2)
|
|
{
|
|
$this->lang2 = $lang2;
|
|
|
|
return $this;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|