src/Factory/RequestBase.php
public function setInvoice($iInvoiceId)
    {
        //  Validate
        $oModel   = $this->oInvoiceModel;
        $oInvoice = $oModel->getById(
            $iInvoiceId,
            ['expand' => $oModel::EXPAND_ALL]
        );

        if (empty($oInvoice)) {
            throw new RequestException('Invalid invoice ID.');
        }

        $this->oInvoice = $oInvoice;
        return $this;
    }
public function setInvoice($iInvoiceId)
    {
        //  Validate
        $oModel   = $this->oInvoiceModel;
        $oInvoice = $oModel->getById(
            $iInvoiceId,
            ['expand' => $oModel::EXPAND_ALL]
        );

        if (empty($oInvoice)) {
            throw new RequestException('Invalid invoice ID.');
        }

        $this->oInvoice = $oInvoice;
        return $this;
    }
public function setInvoice ( $ iInvoiceId ) { //  Validate $ oModel = $ this -> oInvoiceModel ; $ oInvoice = $ oModel -> getById ( $ iInvoiceId , [ 'expand' => $ oModel :: EXPAND_ALL ] ) ; if ( empty ( $ oInvoice ) ) { throw new RequestException ( 'Invalid invoice ID.' ) ; } $ this -> oInvoice = $ oInvoice ; return $ this ; }
Set the invoice object

@param integer $iInvoiceId The invoice to use for the request

@return $this
@throws RequestException
Set the invoice object