1 | <?php |
||
18 | class UserProfile |
||
19 | { |
||
20 | /** |
||
21 | * @ORM\Id() |
||
22 | * @ORM\GeneratedValue() |
||
23 | * @ORM\Column(type="integer") |
||
24 | */ |
||
25 | private $id; |
||
26 | |||
27 | /** |
||
28 | * @var $user User |
||
29 | * @ORM\OneToOne(targetEntity="App\Entity\User", inversedBy="profile") |
||
30 | * @ORM\JoinColumn(nullable=false) |
||
31 | */ |
||
32 | private $user; |
||
33 | |||
34 | /** |
||
35 | * @var $contacts UserProfileContacts[]|ArrayCollection |
||
36 | * @ORM\OneToMany(targetEntity="App\Entity\UserProfileContacts", mappedBy="contacts", cascade={"persist", "remove"}) |
||
37 | * @ORM\JoinColumn(nullable=true) |
||
38 | */ |
||
39 | private $contacts; |
||
40 | |||
41 | /** |
||
42 | * @ORM\Column(type="string", length=255, nullable=true) |
||
43 | */ |
||
44 | public $first_name; |
||
45 | |||
46 | /** |
||
47 | * @ORM\Column(type="string", length=255, nullable=true) |
||
48 | */ |
||
49 | public $last_name; |
||
50 | |||
51 | /** |
||
52 | * @ORM\Column(type="date", nullable=true) |
||
53 | */ |
||
54 | private $birth_date; |
||
55 | |||
56 | /** |
||
57 | * @ORM\Column(type="string", length=255, nullable=true) |
||
58 | */ |
||
59 | public $about; |
||
60 | |||
61 | /** |
||
62 | * @ORM\Column(type="string", length=255, nullable=true) |
||
63 | */ |
||
64 | public $public_email; |
||
65 | |||
66 | 22 | public function __construct(User $user) |
|
71 | |||
72 | /** |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 1 | public function getId() |
|
79 | |||
80 | /** |
||
81 | * @return User |
||
82 | */ |
||
83 | 1 | public function getUser(): User |
|
87 | |||
88 | /** |
||
89 | * @return mixed |
||
90 | */ |
||
91 | 2 | public function getBirthDate() |
|
95 | |||
96 | /** |
||
97 | * @param \DateTime $birth_date |
||
98 | * @return UserProfile |
||
99 | */ |
||
100 | 1 | public function setBirthDate(\DateTime $birth_date) |
|
105 | |||
106 | /** |
||
107 | * @return UserProfileContacts[]|ArrayCollection |
||
108 | */ |
||
109 | 2 | public function getContacts() |
|
113 | |||
114 | /** |
||
115 | * @param $name |
||
116 | * @param $url |
||
117 | * @return $this |
||
118 | */ |
||
119 | 1 | public function addContacts($name, $url) |
|
129 | } |