-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEntityInheritance_ChildEntityClass.php
More file actions
37 lines (30 loc) · 1.09 KB
/
EntityInheritance_ChildEntityClass.php
File metadata and controls
37 lines (30 loc) · 1.09 KB
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
<?php
namespace Webfactory\Bundle\PolyglotBundle\Tests\Fixtures\Entity\EntityInheritance;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Webfactory\Bundle\PolyglotBundle\Attribute as Polyglot;
use Webfactory\Bundle\PolyglotBundle\TranslatableInterface;
#[ORM\Entity]
class EntityInheritance_ChildEntityClass extends EntityInheritance_BaseEntityClass
{
#[Polyglot\Translatable]
#[ORM\Column(type: 'string')]
private TranslatableInterface|string|null $extraText = null;
#[Polyglot\TranslationCollection]
#[ORM\OneToMany(targetEntity: EntityInheritance_ChildEntityClassTranslation::class, mappedBy: 'entity')]
private Collection $extraTranslations;
public function __construct()
{
parent::__construct();
$this->extraTranslations = new ArrayCollection();
}
public function setExtra(TranslatableInterface $extraText): void
{
$this->extraText = $extraText;
}
public function getExtraText(): TranslatableInterface
{
return $this->extraText;
}
}