We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2577e1 commit 69b1563Copy full SHA for 69b1563
src/Endpoints/Pages.php
@@ -58,6 +58,33 @@ public function createInDatabase(string $parentId, Page $page): Page
58
return new Page($response);
59
}
60
61
+ /**
62
+ * @return Page
63
+ */
64
+ public function createInPage(string $parentId, Page $page): Page
65
+ {
66
+ $postData = [];
67
+ $properties = [];
68
+
69
+ foreach ($page->getProperties() as $property) {
70
+ $properties[$property->getTitle()] = $property->getRawContent();
71
+ }
72
73
+ $postData["parent"] = ["page_id" => $parentId];
74
+ $postData["properties"] = $properties;
75
76
77
+ $response = $this
78
+ ->post(
79
+ $this->url(Endpoint::PAGES),
80
+ $postData
81
+ )
82
+ ->json();
83
84
+ return new Page($response);
85
86
87
88
89
/**
90
* @return array
0 commit comments