Name === null){ $this->Name = $this->FirstName . ' ' . $this->LastName; } return $this->Name; } public function Create(): void{ $uuid = Uuid::uuid4(); $this->Uuid = $uuid->toString(); try{ Db::Query('insert into Users (Email, Name, Uuid, Timestamp) values (?, ?, ?, utc_timestamp());', [$this->Email, $this->Name, $this->Uuid]); } catch(PDOException $ex){ if($ex->errorInfo[1] == 1062){ // Duplicate unique key; email already in use throw new Exceptions\UserExistsException(); } else{ throw $ex; } } $this->UserId = Db::GetLastInsertedId(); } }