cwmiller / broadworks-connector

Simple library for connecting to BroadWorks OCI-P API
MIT License
8 stars 5 forks source link

UserAddRequest17sp4 setdepartment #44

Closed TwinMist closed 5 years ago

TwinMist commented 5 years ago

Hi i am testing a upload of users, some of the users have the department field set and some dont. using the same request how would i code if the setdepartment is null? tried $departmentKey = (new GroupDepartmentKey()); if (!empty($data['Department'])) { $departmentKey->setServiceProviderId($data['serviceproviderid']); $departmentKey->setGroupId($data['groupid']); $departmentKey->setName($data['Department']); }

->setdepartment($departmentKey) but get a Field serviceProviderId is required on CWM\BroadWorksConnector\Ocip\Models\GroupDepartmentKey

also tried

if (!empty($data['Department'])) {
    $departmentKey->setName($data['Department']);
} else {
    $departmentKey->unsetName();
}

Field name is required on CWM\BroadWorksConnector\Ocip\Models\GroupDepartmentKey

many thanks

TwinMist commented 5 years ago

Hi. Are you able to assist on this. Many thanks

cwmiller commented 5 years ago

If the user is not part of a department, then just don't call setDepartment on the request