original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Whether a product ID already exists in the wishlist
  @param array $data
  @return boolean
docstring_tokens: Whether a product ID already exists in the wishlist