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 : 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
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;
}
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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