1 | <?php |
||
2 | |||
3 | namespace Zenstruck\Foundry\Tests\Fixtures\Entity; |
||
4 | |||
5 | use Doctrine\ORM\Mapping as ORM; |
||
6 | |||
7 | /** |
||
8 | * @ORM\Entity |
||
9 | * @ORM\Table(name="contacts") |
||
10 | */ |
||
11 | class Contact |
||
12 | { |
||
13 | /** |
||
14 | * @ORM\Id |
||
15 | * @ORM\GeneratedValue |
||
16 | * @ORM\Column(type="integer") |
||
17 | */ |
||
18 | private $id; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
19 | |||
20 | /** |
||
21 | * @ORM\Column(type="string") |
||
22 | */ |
||
23 | private $name; |
||
24 | |||
25 | /** |
||
26 | * @ORM\Embedded("Address") |
||
27 | */ |
||
28 | private $address; |
||
29 | |||
30 | public function __construct($name) |
||
31 | { |
||
32 | $this->name = $name; |
||
33 | $this->address = new Address(); |
||
34 | } |
||
35 | |||
36 | public function getName() |
||
37 | { |
||
38 | return $this->name; |
||
39 | } |
||
40 | |||
41 | public function getAddress(): Address |
||
42 | { |
||
43 | return $this->address; |
||
44 | } |
||
45 | |||
46 | public function setAddress(Address $address): void |
||
47 | { |
||
48 | $this->address = $address; |
||
49 | } |
||
50 | } |
||
51 |