id = $id; $this->title = $title; $this->shareTypeId = $shareTypeId; } public function isValidForCreation(): bool { return $this->title !== null && $this->shareTypeId !== null; } public static function fromBody(array $body): WishlistRequest { return new WishlistRequest( $body['id'] ?? null, $body['title'] ?? null, $body['shareTypeId'] ?? null ); } }