public function exists(array $data)
    {
        if (empty($data['product_id'])) {
            return false;
        }

        $product_id = $data['product_id'];
        unset($data['product_id']);
        $items = (array) $this->getList($data);

        foreach ($items as $item) {
            if ($item['product_id'] == $product_id) {
                return true;
            }
        }

        return false;
    }
public function exists(array $data)
    {
        if (empty($data['product_id'])) {
            return false;
        }

        $product_id = $data['product_id'];
        unset($data['product_id']);
        $items = (array) $this->getList($data);

        foreach ($items as $item) {
            if ($item['product_id'] == $product_id) {
                return true;
            }
        }

        return false;
    }
public function exists ( array $ data ) { if ( empty ( $ data [ 'product_id' ] ) ) { return false ; } $ product_id = $ data [ 'product_id' ] ; unset ( $ data [ 'product_id' ] ) ; $ items = ( array ) $ this -> getList ( $ data ) ; foreach ( $ items as $ item ) { if ( $ item [ 'product_id' ] == $ product_id ) { return true ; } } return false ; }
Whether a product ID already exists in the wishlist
@param array $data
@return boolean
Whether a product ID already exists in the wishlist