public function addProduct($dealId, array $data)
    {
        //if there is no product_id set throw error as it is a required field
        if (!isset($data['product_id'])) {
            throw new PipedriveMissingFieldError('You must include a "pdoruct_id" field when adding a product to a deal');
        }
        //if there is no item_price set throw error as it is a required field
        if (!isset($data['item_price'])) {
            throw new PipedriveMissingFieldError('You must include a "item_price" field when adding a product to a deal');
        }
        //if there is no quantity set throw error as it is a required field
        if (!isset($data['quantity'])) {
            throw new PipedriveMissingFieldError('You must include a "quantity" field when adding a product to a deal');
        }

        return $this->curl->post('deals/' . $dealId . '/products', $data);
    }
public function addProduct($dealId, array $data)
    {
        //if there is no product_id set throw error as it is a required field
        if (!isset($data['product_id'])) {
            throw new PipedriveMissingFieldError('You must include a "pdoruct_id" field when adding a product to a deal');
        }
        //if there is no item_price set throw error as it is a required field
        if (!isset($data['item_price'])) {
            throw new PipedriveMissingFieldError('You must include a "item_price" field when adding a product to a deal');
        }
        //if there is no quantity set throw error as it is a required field
        if (!isset($data['quantity'])) {
            throw new PipedriveMissingFieldError('You must include a "quantity" field when adding a product to a deal');
        }

        return $this->curl->post('deals/' . $dealId . '/products', $data);
    }
public function addProduct ( $ dealId , array $ data ) { //if there is no product_id set throw error as it is a required field if ( ! isset ( $ data [ 'product_id' ] ) ) { throw new PipedriveMissingFieldError ( 'You must include a "pdoruct_id" field when adding a product to a deal' ) ; } //if there is no item_price set throw error as it is a required field if ( ! isset ( $ data [ 'item_price' ] ) ) { throw new PipedriveMissingFieldError ( 'You must include a "item_price" field when adding a product to a deal' ) ; } //if there is no quantity set throw error as it is a required field if ( ! isset ( $ data [ 'quantity' ] ) ) { throw new PipedriveMissingFieldError ( 'You must include a "quantity" field when adding a product to a deal' ) ; } return $ this -> curl -> post ( 'deals/' . $ dealId . '/products' , $ data ) ; }
Adds a product to a deal

@param  int   $dealId deal id
@param  array $data deal and product detials
@return array returns detials of the deal-product
@throws PipedriveMissingFieldError
Adds a product to a deal