public function updateSku($code, $sku = null)
{
// Get the current SKU record if one isn't supplied
if (!$sku) {
$sku = $this->sku()->first();
}
/*
* If an SKU still doesn't exist after
* trying to find one, we'll create one
*/
if (!$sku) {
return $this->processSkuGeneration($this->getKey(), $code);
}
return $this->processSkuUpdate($sku, $code);
}