if (isset($data['esd'
])) { $data =
$this->
prepareEsdAssociation($data,
$variant);
} if (!
empty($data['number'
]) &&
$data['number'
] !==
$variant->
getNumber()) { // Number changed, hence make sure it does not already exist in another variant
$exists =
$this->
getContainer() ->
get(Connection::
class) ->
fetchColumn('SELECT id FROM s_articles_details WHERE ordernumber = ?',
[$data['number'
]]);
if ($exists) { throw new CustomValidationException(sprintf('A variant with the given order number "%s" already exists.',
$data['number'
]));
} } return $data;
} /**
* Resolves the passed images array for the current variant.
* An image can be assigned to a variant over a media id of an existing product image
* or over the link property which can contain a image link.
* This image will be added automatically to the product.
*
* @param array $data
*
* @throws CustomValidationException
*
* @return array
*/