public function delete($object) { // get database $db = $this->getDBO(); // update childrens parent category $query = "UPDATE " . $this->getTableName() . " SET parent=" . $object->parent . " WHERE parent=" . $object->id; $db->query($query); // delete category to item relations CategoryHelper::deleteCategoryItemRelations($object->id); return parent::delete($object); }