Logichook on copying bean ?

Hello everybody,

Is there a clean way within a before_save logichook to determine if the bean is being copied or "classically" modified ? 

I heritated such a code : 

if (!$arguments['isUpdate'] && preg_match('/picture_duplicateBeanId/', $_SERVER['QUERY_STRING'])){
	// $GLOBALS['log']->fatal("Copying an SLA Report :: ".$_SERVER['QUERY_STRING']);
    $split = explode('&',$_SERVER['QUERY_STRING']);
	$id = null;

    foreach($split as $k) {
		if (preg_match('/picture_duplicateBeanId/', $k)) {
            $aid = explode('=',$k);
            $id = $aid[1];
            continue;
		}
    }
}

The guy before me checked the query_string from the server global value, but is there a better way to do that ? 

Best regards and nice week to all :-)

Enes

Parents Reply Children
No Data