if ($setFirstVariantMain) { $data['variants'
][0
]['isMain'
] = true;
} $variants =
[];
if (isset($data['__options_variants'
]) &&
$data['__options_variants'
]['replace'
]) { $this->
removeArticleDetails($article);
} foreach ($data['variants'
] as $variantData) { if (isset($variantData['id'
])) { $variant =
$this->
getVariantResource()->
internalUpdate( $variantData['id'
],
$variantData,
$article );
} else { $variant = null;
// The number property can be set for two reasons.
// 1. Use the number as the identifier to update an existing variant
// 2. Use this number for the new variant
if (isset($variantData['number'
])) {