/**
  * Sets the options of the attribute
  *
  * @param string             $class
  * @param AttributeInterface $attribute
  * @param array              $optionsData
  */
 protected function setOptions($class, AttributeInterface $attribute, array $optionsData)
 {
     $this->doctrineCache->setReference($attribute);
     $optionClass = $this->optionManager->getAttributeOptionClass();
     foreach ($optionsData as $code => $optionData) {
         $optionData['attribute'] = $attribute->getCode();
         if (!isset($optionData['code'])) {
             $optionData['code'] = $code;
         }
         $option = $this->transformNestedEntity($class, 'options', $optionClass, $optionData);
         $attribute->addOption($option);
         $this->doctrineCache->setReference($option);
     }
 }