/** * Decrement has item count * * @param CategoryEntity $category category object * @param int $amount decrease value * @return int affecting statement */ public function decrement(CategoryEntity $category, $amount = 1) { return $this->conn->table($this->table)->where('id', $category->id)->decrement('count', $amount); }