public function delete($product_id)
    {
        $result = null;
        $this->hook->attach('product.related.delete.before', $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        foreach (array('product_id', 'item_product_id') as $field) {
            if (!$this->db->delete('product_related', array($field => $product_id))) {
                return false;
            }
        }

        $this->hook->attach('product.related.delete.after', $product_id, $result, $this);
        return (bool) $result;
    }
public function delete($product_id)
    {
        $result = null;
        $this->hook->attach('product.related.delete.before', $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        foreach (array('product_id', 'item_product_id') as $field) {
            if (!$this->db->delete('product_related', array($field => $product_id))) {
                return false;
            }
        }

        $this->hook->attach('product.related.delete.after', $product_id, $result, $this);
        return (bool) $result;
    }
public function delete ( $ product_id ) { $ result = null ; $ this -> hook -> attach ( 'product.related.delete.before' , $ product_id , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } foreach ( array ( 'product_id' , 'item_product_id' ) as $ field ) { if ( ! $ this -> db -> delete ( 'product_related' , array ( $ field => $ product_id ) ) ) { return false ; } } $ this -> hook -> attach ( 'product.related.delete.after' , $ product_id , $ result , $ this ) ; return ( bool ) $ result ; }
Deletes product relations
@param int $product_id
@return bool
Deletes product relations