Products can now be cloned
This commit is contained in:
@@ -30,4 +30,28 @@ class ProductAttribute extends mfBaseModel {
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
public function __clone() {
|
||||
$me = new User;
|
||||
$me->loadMe();
|
||||
//var_dump($this);exit;
|
||||
$old_id = $this->id;
|
||||
$this->id = null;
|
||||
|
||||
// cleanup data
|
||||
unset($this->data->name);
|
||||
unset($this->data->type);
|
||||
unset($this->data->displayname);
|
||||
unset($this->data->description);
|
||||
$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 ProductAttribute $old_id");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user