Search code examples
phppimcorepimcore-v5

Pimcore - Classificationstore add group to object


Does anyone knows how to add a Classificationstore Group to a DataObject?

I’ve created a custom Class (with a classificationstore in it). My plan is to use the classificationstore groups to define the object (attributes of the dataobject).

But i dont know how to add a predefines group to the dataobject …

$dataobject->setAttributes( //classificationstore group ) -> this doesnt work (Attributes is the name of the classificationstore in my class)

Thanks for help


Solution

  • The documentation about this subject is indeed not really clear, but you can do as followed:

    $dataobject->getAttributes()->setActiveGroups([$groupId=>true]);