I want to programmatically get all the values contained in a field of type category.
I am doing this on Elements::EVENT_AFTER_SAVE_ELEMENT
.
If I dump $event->element->getFieldValue('productTheme')
I get the field but I did't find how to go from there.
My final goal is to have the categories from the category field in an array (not all the categories in the category group, but only those selected in the field).