public function copy($data = null)
{
$this->triggerEvent('onBeforeCopy');
$this->{$this->idFieldName} = null;
if ($this->hasField('created_by')) {
$this->setFieldValue('created_by', null);
}
if ($this->hasField('modified_by')) {
$this->setFieldValue('modified_by', null);
}
if ($this->hasField('locked_by')) {
$this->setFieldValue('locked_by', null);
}
if ($this->hasField('created_on')) {
$this->setFieldValue('created_on', null);
}
if ($this->hasField('modified_on')) {
$this->setFieldValue('modified_on', null);
}
if ($this->hasField('locked_on')) {
$this->setFieldValue('locked_on', null);
}
$result = $this->save($data);
$this->triggerEvent('onAfterCopy', array(&$result));
return $result;
}