-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
DDC117Editor.php
65 lines (56 loc) · 1.56 KB
/
DDC117Editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
namespace Doctrine\Tests\Models\DDC117;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* @Entity
*/
class DDC117Editor
{
/**
* @var int
* @Id
* @Column(type="integer")
* @GeneratedValue
*/
public $id;
/**
* @var string|null
* @Column(type="string")
*/
public $name;
/**
* @psalm-var Collection<int, DDC117Translation>
* @ManyToMany(targetEntity="DDC117Translation", inversedBy="reviewedByEditors")
* @JoinTable(
* inverseJoinColumns={
* @JoinColumn(name="article_id", referencedColumnName="article_id"),
* @JoinColumn(name="language", referencedColumnName="language")
* },
* joinColumns={
* @JoinColumn(name="editor_id", referencedColumnName="id")
* }
* )
*/
public $reviewingTranslations;
/**
* @var DDC117Translation
* @ManyToOne(targetEntity="DDC117Translation", inversedBy="lastTranslatedBy")
* @JoinColumns({
* @JoinColumn(name="lt_article_id", referencedColumnName="article_id"),
* @JoinColumn(name="lt_language", referencedColumnName="language")
* })
*/
public $lastTranslation;
public function __construct(?string $name = '')
{
$this->name = $name;
$this->reviewingTranslations = new ArrayCollection();
}
public function addLastTranslation(DDC117Translation $t): void
{
$this->lastTranslation = $t;
$t->lastTranslatedBy[] = $this;
}
}