public function setDeletedAt($v, $moveEntriesToParentCategory = null) { if (is_null($this->move_entries_to_parent_category)) { if (is_null($moveEntriesToParentCategory)) { $moveEntriesToParentCategory = $this->getParentId(); } $this->move_entries_to_parent_category = $moveEntriesToParentCategory; $this->loadChildsForSave(); foreach ($this->childs_for_save as $child) { $child->setDeletedAt($v, $moveEntriesToParentCategory); $child->save(); } } $this->setStatus(CategoryStatus::DELETED); parent::setDeletedAt($v); }
public function setDeletedAt($v) { $this->loadChildsForSave(); foreach ($this->childs_for_save as $child) { $child->setDeletedAt($v); } parent::setDeletedAt($v); $this->save(); }