/** * @param $prop * @param $val */ protected function isChanged($prop, $val) { $getter = "get" . ucfirst($prop); $current = $this->{$getter}(); if ($prop == 'category' || $prop == 'list') { $currentId = $current ? $current->getId() : ''; $newId = $val ? $val->getId() : null; if ($currentId != $newId) { $this->changes[$prop] = array($currentId, $newId); } } else { parent::isChanged($prop, $val); } }
public function __clone() { $this->id = null; parent::__clone(); }
public function __clone() { $this->leads = new ArrayCollection(); $this->events = new ArrayCollection(); $this->lists = new ArrayCollection(); $this->forms = new ArrayCollection(); $this->id = null; parent::__clone(); }
/** * @param $prop * @param $val */ protected function isChanged($prop, $val) { $getter = "get" . ucfirst($prop); $current = $this->{$getter}(); parent::isChanged($prop, $val); }
/** * @param $prop * @param $val */ protected function isChanged($prop, $val) { $getter = 'get' . ucfirst($prop); $current = $this->{$getter}(); if ($prop == 'variantParent' || $prop == 'translationParent' || $prop == 'category') { $currentId = $current ? $current->getId() : ''; $newId = $val ? $val->getId() : null; if ($currentId != $newId) { $this->changes[$prop] = [$currentId, $newId]; } } else { parent::isChanged($prop, $val); } }