original_string: public function delete($product_id)
      {
          $result = null;
          $this->hook->attach('product.compare.delete.before', $product_id, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $compared = $this->getList();
  
          if (empty($compared)) {
              return false;
          }
  
          $product_ids = array_flip($compared);
          unset($product_ids[$product_id]);
  
          $result = $this->set(array_keys($product_ids));
          $this->hook->attach('product.compare.delete.after', $product_id, $result, $this);
          return (bool) $result;
      }
code: public function delete($product_id)
      {
          $result = null;
          $this->hook->attach('product.compare.delete.before', $product_id, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $compared = $this->getList();
  
          if (empty($compared)) {
              return false;
          }
  
          $product_ids = array_flip($compared);
          unset($product_ids[$product_id]);
  
          $result = $this->set(array_keys($product_ids));
          $this->hook->attach('product.compare.delete.after', $product_id, $result, $this);
          return (bool) $result;
      }
code_tokens: public function delete ( $ product_id ) { $ result = null ; $ this -> hook -> attach ( 'product.compare.delete.before' , $ product_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } $ compared = $ this -> getList ( ) ; if ( empty ( $ compared ) ) { return false ; } $ product_ids = array_flip ( $ compared ) ; unset ( $ product_ids [ $ product_id ] ) ; $ result = $ this -> set ( array_keys ( $ product_ids ) ) ; $ this -> hook -> attach ( 'product.compare.delete.after' , $ product_id , $ result , $ this ) ; return ( bool ) $ result ; }
docstring: Removes a products from comparison
  @param integer $product_id
  @return array|boolean
docstring_tokens: Removes a products from comparison