original_string: public function add($related_product_id, $product_id)
      {
          $result = null;
          $this->hook->attach('product.related.add.before', $related_product_id, $product_id, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $this->db->insert('product_related', array('product_id' => $product_id, 'item_product_id' => $related_product_id));
          $this->db->insert('product_related', array('product_id' => $related_product_id, 'item_product_id' => $product_id));
  
          $this->hook->attach('product.related.add.after', $related_product_id, $product_id, $result, $this);
          return (bool) $result;
      }
code: public function add($related_product_id, $product_id)
      {
          $result = null;
          $this->hook->attach('product.related.add.before', $related_product_id, $product_id, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $this->db->insert('product_related', array('product_id' => $product_id, 'item_product_id' => $related_product_id));
          $this->db->insert('product_related', array('product_id' => $related_product_id, 'item_product_id' => $product_id));
  
          $this->hook->attach('product.related.add.after', $related_product_id, $product_id, $result, $this);
          return (bool) $result;
      }
code_tokens: public function add ( $ related_product_id , $ product_id ) { $ result = null ; $ this -> hook -> attach ( 'product.related.add.before' , $ related_product_id , $ product_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } $ this -> db -> insert ( 'product_related' , array ( 'product_id' => $ product_id , 'item_product_id' => $ related_product_id ) ) ; $ this -> db -> insert ( 'product_related' , array ( 'product_id' => $ related_product_id , 'item_product_id' => $ product_id ) ) ; $ this -> hook -> attach ( 'product.related.add.after' , $ related_product_id , $ product_id , $ result , $ this ) ; return ( bool ) $ result ; }
docstring: Adds product relations
  @param int $related_product_id
  @param int $product_id
  @return bool
docstring_tokens: Adds product relations