I want to change an attribute option label and store it with Akeneo 1.4.9, but I don't know which handlers/factories I should use.
I used MyAttributeOptionValueInterface->setLabel('new Label')
to change the label. How can I save the result in the database?
My idea:
AttributeInterface->removeOption(optionWithOldLabel)
)AttributeInterface->addOption(optionWithNewLabel)
)Is this the correct way? Any hints are welcome.
You can use object savers of the PIM: http://docs.akeneo.com/latest/cookbook/catalog/common/save.html?highlight=saver
And save your options like that:
$attributeOption->setLabel('My nice label');
$attributeOptionSaver = $this->getContainer()->get('pim_catalog.saver.attribute_option');
$attributeOptionSaver->save($attributeOption);
And you are good to go !