public function save(Application_Model_Product $product) { $data = array('id' => $product->id, 'name' => $product->name, 'category_id' => $product->getCategoryId(), 'price' => $product->price, 'file' => $product->file, 'image' => $product->image, 'description' => $product->description); if (null === ($id = $product->getId())) { unset($data['id']); $this->getDbTable()->insert($data); } else { $this->getDbTable()->update($data, array('id = ?' => $id)); } }