id); } /** * @return Meeting */ public function getMeeting() { return $this->meeting; } /** * @param Meeting $meeting * * @return $this */ public function setMeeting($meeting) { $this->meeting = $meeting; $this->meeting->getRegistrants()->add($this); return $this; } /** * @return User */ public function getUser() { return $this->user; } /** * @param User $user * * @return $this */ public function setUser($user) { $this->user = $user; return $this; } /** * @throws Exception * * @return MeetingRegistrantListItem */ public function getMeetingRegistrantListItem() { return $this->meetingRegistrantListItem; } /** * @param MeetingRegistrantListItem $meetingRegistrantListItem * * @throws Exception * * @return $this */ public function setMeetingRegistrantListItem($meetingRegistrantListItem) { if (!is_null($this->meeting) && $this->meeting->getId() != $meetingRegistrantListItem->id) { throw new Exception('RegistrantEntity meeting id differs from MeetingRegistrantListItem id'); } $this->meetingRegistrantListItem = $meetingRegistrantListItem; $this->computeFullName(); return $this; } public function computeFullName() { $this->fullName = api_get_person_name( $this->meetingRegistrant->first_name, $this->meetingRegistrant->last_name ); } public function getJoinUrl() { if (!$this->createdRegistration) { return ''; } return $this->createdRegistration->join_url; } /** * @throws Exception * * @return CreatedRegistration */ public function getCreatedRegistration() { return $this->createdRegistration; } /** * @param CreatedRegistration $createdRegistration * * @throws Exception * * @return $this */ public function setCreatedRegistration($createdRegistration) { if (null === $this->id) { $this->id = $createdRegistration->registrant_id; } elseif ($this->id != $createdRegistration->registrant_id) { throw new Exception('RegistrantEntity id differs from CreatedRegistration identifier'); } $this->createdRegistration = $createdRegistration; return $this; } /** * @throws Exception * * @return MeetingRegistrant */ public function getMeetingRegistrant() { return $this->meetingRegistrant; } /** * @throws Exception */ public function setMeetingRegistrant(API\RegistrantSchema $meetingRegistrant): Registrant { $this->meetingRegistrant = $meetingRegistrant; $this->computeFullName(); return $this; } /** * @ORM\PostLoad * * @throws Exception */ public function postLoad() { if (null !== $this->meetingRegistrantJson) { $this->meetingRegistrant = MeetingRegistrant::fromJson($this->meetingRegistrantJson); } if (null !== $this->createdRegistrationJson) { $this->createdRegistration = CreatedRegistration::fromJson($this->createdRegistrationJson); } if (null !== $this->meetingRegistrantListItemJson) { $this->meetingRegistrantListItem = MeetingRegistrantListItem::fromJson( $this->meetingRegistrantListItemJson ); } $this->computeFullName(); } /** * @ORM\PreFlush */ public function preFlush() { if (null !== $this->meetingRegistrant) { $this->meetingRegistrantJson = json_encode($this->meetingRegistrant); } if (null !== $this->createdRegistration) { $this->createdRegistrationJson = json_encode($this->createdRegistration); } if (null !== $this->meetingRegistrantListItem) { $this->meetingRegistrantListItemJson = json_encode($this->meetingRegistrantListItem); } } public function setSignature(Signature $signature): void { $this->signature = $signature; $signature->setRegistrant($this); } public function getSignature(): ?Signature { return $this->signature; } }