/** * After versioning for tx_commerce_products, this also * 1) copies the Attributes (flex and mm) * 2) copies the Articles and keeps their relations * * @param string $table Tablename on which the swap happens * @param int $id Id of the LIVE Version to swap * @param int $swapWith Id of the Offline Version to swap with * @param int $swapIntoWorkspace If set, swaps online into workspace * instead of publishing out of workspace. * * @return void */ public function processSwap_postProcessSwap($table, $id, $swapWith, $swapIntoWorkspace) { if ('tx_commerce_products' == $table) { $copy = !is_null($swapIntoWorkspace); // give Attributes from swapWith to id Tx_Commerce_Utility_BackendUtility::swapProductAttributes($swapWith, $id, $copy); // give Articles from swapWith to id Tx_Commerce_Utility_BackendUtility::swapProductArticles($swapWith, $id, $copy); } }