88 lines
1.8 KiB
PHP
88 lines
1.8 KiB
PHP
<?php declare(strict_types = 1);
|
|
|
|
|
|
namespace App\Model\Database\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use App\Model\Database\Entity\Attributes\TId;
|
|
|
|
/**
|
|
* @ORM\Entity(repositoryClass="App\Model\Database\Repository\TranslationRepository")
|
|
* @ORM\Table(name="`translation`")
|
|
* @ORM\HasLifecycleCallbacks
|
|
*
|
|
* @property int $id
|
|
* @property Dictionary $dictionary
|
|
* @property Language $lang1
|
|
* @property Language $lang2
|
|
* @property int $direction
|
|
*/
|
|
class Translation extends AbstractEntity
|
|
{
|
|
|
|
use Tid;
|
|
|
|
public function __construct($dictionary,$lang1,$lang2,$lang_name1,$lang_name2,$direction)
|
|
{
|
|
$this->dictionary = $dictionary;
|
|
$this->lang1 = $lang1;
|
|
$this->lang2 = $lang2;
|
|
$this->lang_name1 = $lang_name1;
|
|
$this->lang_name2 = $lang_name2;
|
|
$this->direction = $direction;
|
|
}
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="App\Model\Database\Entity\Dictionary", inversedBy="translations")
|
|
*/
|
|
protected $dictionary;
|
|
|
|
public function getDictionary()
|
|
{
|
|
return $this->dictionary;
|
|
}
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="App\Model\Database\Entity\Language", inversedBy="translations1")
|
|
*/
|
|
protected $lang1;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="App\Model\Database\Entity\Language", inversedBy="translations2")
|
|
*/
|
|
protected $lang2;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $lang_name1;
|
|
|
|
public function getLangName1(): String
|
|
{
|
|
return $this->lang_name1;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $lang_name2;
|
|
|
|
public function getLangName2(): String
|
|
{
|
|
return $this->lang_name2;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(type="smallint")
|
|
*/
|
|
protected $direction;
|
|
|
|
public function getDirection() : int
|
|
{
|
|
return $this->direction;
|
|
}
|
|
|
|
}
|
|
|
|
?>
|