How to tag a Nuxeo document via nuxeo/nuxeo-php-client

84 Views Asked by At

i'm working with the dependency 'nuxeo/nuxeo-php-client' on a symfony project. I'm trying to add a tag to a Nuxeo document since 2 days. I'm success to set an attribut of string type but tags are in arrays type, the documentation is very small because it's a dependancy maintained by the community.

If someone know the syntaxe for set an attr like tags with an array, any help is welcome !

Thanks.

Syntaxe to set an attr of string type :

$this->client->automation('Document.Update')->param('properties','dc:title=Mon nouveau titre')->input($nuxeoDocument->getUid())->execute();
1

There are 1 best solutions below

0
On

You might find this answer relevant. It's using v1.5 but can be easily modified for 2.0+:

$answer = $client
  ->operation()
  ->input('doc:/default-domain/workspaces/Default Workspace')
  ->param('type', 'Article')
  ->param('name', 'doc01')
  ->param('properties', 'dc:title=doc01 article:exampleList=[{"field01":"val001","field02":"val002","field03":"val003"}]')
  ->execute('Document.Create');

Note: I haven't tested the code, I modified it directly here so there might be typos.