// Need to set the tax data directly for following price calculations which use the tax object of the article
if(isset($data['tax'])){ $article->setTax($data['tax']); }
// The mainDetail gets its initial value for lastStock from $article, so this has to be set beforehand
if(isset($data['lastStock'])){ $article->setLastStock((bool)$data['lastStock']); }