-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set typehinted properties to initial null
#538
Comments
Hi Marijus Plančiūnas, Could you please explain where you found the code below?
Or, are you suggesting a feature for unsetting targeted ad units? Thanks, |
Hi @thangduo, Sorry, yes - it's a feature request, not necessarily for targetedAdUnits - but for all setters at entity classes in general. At the moment, if property is set, and is a type of array / collection, there is no way to unset it. As there was an upgrade pushed for setting general properties to null (#426, https://github.com/googleads/googleads-php-lib/releases/tag/33.0.0), it would be logical to upgrade structured properties to have this "feature" as well. Typehinted function arguments forbids it at the moment. Thanks! |
Hi Marijus, Thanks for making the feature request. We will consider it for a future release. We understand that this feature request would apply for a larger scale than just the Thanks, |
Hi again @thangduo, The real-world scenario would be modifying already existant line item targetings. Br, |
Hi Marijus, Thanks for providing more details about this feature request. Currently this feature is prioritized as P2 and will be considered in future releases of this client lib. I will leave this feature request open for now. For other readers of this thread, if this feature request is important for you, please add your comments regarding your use case. Thanks, |
Thank you Thang. |
Fixed with this release. |
This doesn't work:
Because it's typehinted as an array:
https://github.com/googleads/googleads-php-lib/blob/master/src/Google/AdsApi/AdManager/v201808/InventoryTargeting.php#L51
Suggestions:
public function setTargetedAdUnits(array $targetedAdUnits = null)
, orpublic function unsetTargetedAdUnits()
.The text was updated successfully, but these errors were encountered: