mariosimao / notion-sdk-php

A complete Notion SDK for PHP developers.
https://mariosimao.github.io/notion-sdk-php/
MIT License
150 stars 24 forks source link

Improve CreateEmpty method for Page Properties #346

Open ren0v opened 7 months ago

ren0v commented 7 months ago

Some Page Properties (Date, Email, Number, PhoneNumber, RichTextProperty, Select, Url) have a CreateEmpty method but other editable properties (Checkbox, Files, Multiselect, People, Relation, Status, Title) don't have such a method.

This PR is about

ren0v commented 7 months ago

What is the use case for createEmpty() with IDs? Is it to remove the data from a property? If yes, I think it would be better to have a new method, maybe clear()?

Not really removing the data from a property.

I'm running an app that sync some Notion databases with the app and the other way around. For that, I rely on the ids of the Notion database properties as the enduser can change the name of the property on Notion. When the enduser makes an update on the app, I need to sync the update on Notion. For that, I create a new empty property with the SDK and I need to set the right id (that is saved on the app database), then I use a changeXXX method to add the new content and then run the update request with the API.