-
Notifications
You must be signed in to change notification settings - Fork 278
N°8891 - feat(DBObject): Add CopyIfNull() helper to copy attribute only if target is null #771
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
base: develop
Are you sure you want to change the base?
Conversation
|
Hey @favincen, thank you for your PR. It has been functional accepted - which is normal given the content of the documentation 😁 We'll review it from a technical point of view |
Co-authored-by: Thomas Casteleyn <[email protected]>
| return $this->Copy($sDestAttCode, $sSourceAttCode); | ||
| } | ||
| $this->SetIfNull($sDestAttCode, $this->Get($sSourceAttCode)); | ||
| return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to Combodo: Set() and Copy() do return true unconditionaly upon completion, but SetIfNul() do not return any value. Seems unconsistant to me.
So how do this new CopyIfNull() method should behave concerning returning value ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And should SetIfNull() be updated to return a boolean upon completion ?
Hipska
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc needs to be updated a bit, but over-all its ok
Base information
Objective (enhancement)
DBObject provides helpers like Set(), SetIfNul(), and Copy(), but misses CopyIfNull().
CopyIfNull() is documented and recommended by Combodo in its partners documentation, and is really useful for its purpose.
Documentation states a PR to add this helper would be welcomed, so here it is.
Proposed solution (bug and enhancement)
Add the missing helper method in iTop, as it is documented.
Checklist before requesting a review
Checklist of things to do before PR is ready to merge