public function edit(Product $product) { $query = "Update products Set name = ?, categoryId = ?, price = ?, quantity = ?, editorId = ?\n WHERE products.id = ?"; $params = [$product->getName(), $product->getCategoryId(), $product->getPrice(), $product->getQuantity(), $product->getEditorId(), $product->getId()]; $this->db->query($query, $params); $result = $this->db->row(); return $result; }