我想更改一个属性选项标签,并将其存储在Akeneo1.4.9中,但我不知道应该使用哪些处理程序/工厂。
我用MyAttributeOptionValueInterface->setLabel('new Label')来更改标签。如何将结果保存在数据库中?
我的想法:
AttributeInterface->removeOption(optionWithOldLabel))中删除旧选项AttributeInterface->addOption(optionWithNewLabel))这样做对吗?任何提示都欢迎。
发布于 2015-11-19 15:46:57
您可以使用PIM:http://docs.akeneo.com/latest/cookbook/catalog/common/save.html?highlight=saver的对象保护程序。
像这样保存你的选择:
$attributeOption->setLabel('My nice label');
$attributeOptionSaver = $this->getContainer()->get('pim_catalog.saver.attribute_option');
$attributeOptionSaver->save($attributeOption);你可以走了!
https://stackoverflow.com/questions/33807940
复制相似问题