Products can now be cloned
This commit is contained in:
@@ -80,4 +80,27 @@ class Product extends mfBaseModel {
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
|
||||
public function __clone() {
|
||||
$me = new User;
|
||||
$me->loadMe();
|
||||
|
||||
$old_id = $this->id;
|
||||
$this->id = null;
|
||||
|
||||
$this->name .= " - Kopie";
|
||||
|
||||
// cleanup data
|
||||
$this->create_by = $me->id;
|
||||
$this->edit_by = $me->id;
|
||||
|
||||
$this->create = null;
|
||||
$this->edit = null;
|
||||
$this->saved = 0;
|
||||
$this->mode = "new";
|
||||
$this->_old_data = new StdClass();
|
||||
|
||||
$this->log->debug("Cloned Product $old_id");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user