/**
* Batch change workflow stage or current.
*
* @param integer $oldId The ID of the item copied from
* @param integer $newId The ID of the new item
*
* @return null
*
* @since 4.0.0
*/
public function workflowCleanupBatchMove($oldId, $newId)
{
// Trigger workflow plugins only if enable (will be triggered from parent class)
if ($this->workflowEnabled) {
$this->importWorkflowPlugins();
}
// We always need an association, so create one
$table = $this->getTable();
$table->load($newId);
$catKey = $table->getColumnAlias('catid');
$stage_id = $this->workflow->getDefaultStageByCategory($table->{$catKey});
if (empty($stage_id)) {
return;
}
$this->workflow->createAssociation((int) $newId, (int) $stage_id);
}