public function has($productId) { $products = $this->getData(); return isset($products[$productId]); }