Something went wrong while setting issue due date.
Add a webservice method to add a value to multi-valuated attributes
Closed
Add a webservice method to add a value to multi-valuated attributes
Yesterday, I tested adding a member to an existing group. I used the following code:
$fdresult = $client->getfields($session_id, 'ogroup', 'cn=zfezfez,ou=groups,dc=xxx,dc=xxx');
$group_members = $fdresult['sections']['members']['attrs']['member']['value'];
$group_members[] = 'uid=newmember,ou=people,dc=xxx,dc=xxx';
$gdata['ogroup']['member']['value'] = $group_members;
$fdresult = $client->setfields($session_id, 'ogroup', 'cn=zfezfez,ou=groups,dc=xxx,dc=xxx', $gdata);
My concern with the above is the current system force you to retrieve the full object, add the entry to it and and send it back to the webservice.
Abviously, a better implementation would be to provide the ability to simply add a value without transmitting all the data, and get a error message in the value already exists for example. It's how you would do it with a LDIF file by the way.
The same is suggested for delete operations.
Cheers,
- Relations:
- relates fd#5302