Products can now be cloned

This commit is contained in:
Frank Schubert
2024-02-21 15:40:59 +01:00
parent 0c706f6a0c
commit de39dd6946
5 changed files with 108 additions and 1 deletions

View File

@@ -24,5 +24,25 @@ class ProductNetwork extends mfBaseModel {
return $this->$name;
}
public function __clone() {
$me = new User;
$me->loadMe();
$old_id = $this->id;
$this->id = null;
// 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 ProductNetwork $old_id");
}
}