Skip to content
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

ModifyRequest xsi:nil="true" #19

Closed
TwinMist opened this issue Nov 1, 2018 · 3 comments
Closed

ModifyRequest xsi:nil="true" #19

TwinMist opened this issue Nov 1, 2018 · 3 comments

Comments

@TwinMist
Copy link

TwinMist commented Nov 1, 2018

Hi
On a Modify Request, how do you remove a value already set on the user
ie
how would you remove the email address from a user.
->setextension(null) or ->setextension(false) -
->setextension() , Too few arguments to function
all do not work.

thanks

@TwinMist TwinMist changed the title ModifyRequest ModifyRequest xsi:nil="true" Nov 2, 2018
@cwmiller
Copy link
Owner

cwmiller commented Nov 3, 2018

Good find, I'm not handling nillable types properly with the library. This is a bit of a problem since all properties are set to NULL by default and the XML serializer omits any field from the XML with a NULL value.

I'm working on a fix.

@TwinMist
Copy link
Author

TwinMist commented Nov 5, 2018

Hi, I see from the release not there is a fix. what value do you need to use in order to remove the current value?

thanks

@cwmiller
Copy link
Owner

cwmiller commented Nov 5, 2018

Be sure to use version 2.1.0. For any value you need to set to nil, use an instance of the Nil class.

use CWM\BroadWorksConnector\Ocip\Nil;
use CWM\BroadWorksConnector\Ocip\Models\UserModifyRequest17sp4;

...

$rq = (new UserModifyRequest17sp4())
    ->setUserId($userId)
    ->setExtension(new Nil());

This is a bit of a dirty workaround for now. The next major version will most likely do away with Nil and just treat NULL as nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants