How to set a value of a "select" attribute


#1

hy ,
how to set a value of a “select” attribute ,
$marque is a object of a attribute of type “select”
$ligne[‘10’] is a string
there is my code :

$marque = $this->container->get(‘sylius.repository.product_attribute’)->findOneBy([‘code’ => ‘MARQUE’]);
$marqueValue = new ProductAttributeValue();
$marqueValue->setLocaleCode(‘fr_FR’);
$marqueValue->setAttribute($marque);
$marqueValue->setValue($ligne[‘10’]);
$product->addAttribute($marqueValue);