122 lines
2.1 KiB
PHP
122 lines
2.1 KiB
PHP
<?php
|
|
|
|
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\TermRepository")
|
|
* @ORM\HasLifecycleCallbacks
|
|
* @ORM\Table(indexes={@ORM\Index(columns={"string1"}, flags={"fulltext"}),
|
|
@ORM\Index(columns={"string2"}, flags={"fulltext"})})
|
|
*/
|
|
class Term extends AbstractEntity
|
|
{
|
|
|
|
use Tid;
|
|
|
|
public function __construct(Dictionary $dictionary,$string)
|
|
{
|
|
$this->dictionary = $dictionary;
|
|
$this->string1 = $string;
|
|
}
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Dictionary", inversedBy="fullDict",cascade={"persist", "remove" })
|
|
*/
|
|
protected $dictionary;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $string1;
|
|
|
|
/**
|
|
* @ORM\Column(type="string")
|
|
*/
|
|
protected $string2;
|
|
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Suffix")
|
|
*/
|
|
protected $suffix1;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Suffix")
|
|
*/
|
|
protected $suffix2;
|
|
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="DictType")
|
|
*/
|
|
protected $type;
|
|
|
|
/**
|
|
* @ORM\ManyToMany(targetEntity="Pronunciation", inversedBy="terms")
|
|
* @ORM\JoinTable(name="terms_pronunciations")
|
|
*/
|
|
protected $pronunciations;
|
|
|
|
public function setType(DictType $type)
|
|
{
|
|
$this->type = $type;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(type="string",nullable=true)
|
|
*/
|
|
protected $member;
|
|
|
|
public function setMember($member)
|
|
{
|
|
$this->member = $member;
|
|
return $this;
|
|
}
|
|
|
|
public function getMember()
|
|
{
|
|
return $this->member;
|
|
}
|
|
|
|
/**
|
|
* @ORM\Column(type="smallint",nullable=true)
|
|
*/
|
|
protected $order2;
|
|
|
|
/**
|
|
* @ORM\Column(type="json_array",nullable=true)
|
|
*/
|
|
protected $flags;
|
|
|
|
public function getFlags()
|
|
{
|
|
return $this->flags;
|
|
}
|
|
|
|
public function setFlags($flags)
|
|
{
|
|
$this->flags = $flags;
|
|
return $this;
|
|
}
|
|
|
|
public function getOrder2()
|
|
{
|
|
return $this->order2;
|
|
}
|
|
|
|
public function setOrder2($order2)
|
|
{
|
|
$this->order2 = $order2;
|
|
return $this;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|