Exemplo n.º 1
0
 /**
  * @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);
     }
 }
Exemplo n.º 2
0
 public function __clone()
 {
     $this->id = null;
     parent::__clone();
 }
Exemplo n.º 3
0
 public function __clone()
 {
     $this->leads = new ArrayCollection();
     $this->events = new ArrayCollection();
     $this->lists = new ArrayCollection();
     $this->forms = new ArrayCollection();
     $this->id = null;
     parent::__clone();
 }
Exemplo n.º 4
0
 /**
  * @param $prop
  * @param $val
  */
 protected function isChanged($prop, $val)
 {
     $getter = "get" . ucfirst($prop);
     $current = $this->{$getter}();
     parent::isChanged($prop, $val);
 }
Exemplo n.º 5
0
 /**
  * @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);
     }
 }