/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update_supdoc'); if (!$this->getAttachmentsId()) { throw new InvalidArgumentException('Attachments ID is required for update'); } $xml->writeElement('supdocid', $this->getAttachmentsId(), true); $xml->writeElement('supdocname', $this->getAttachmentsName()); $xml->writeElement('supdocfoldername', $this->getAttachmentFolderName()); $xml->writeElement('supdocdescription', $this->getDescription()); if (count($this->getFiles()) > 0) { $xml->startElement('attachments'); foreach ($this->getFiles() as $file) { if ($file instanceof AttachmentInterface) { $file->writeXml($xml); } } $xml->endElement(); //attachments } $xml->endElement(); //update_supdoc $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create'); $xml->startElement('TIMESHEET'); if (!$this->getEmployeeId()) { throw new InvalidArgumentException('Employee ID is required for create'); } $xml->writeElement('EMPLOYEEID', $this->getEmployeeId(), true); if (!$this->getBeginDate()) { throw new InvalidArgumentException('Begin Date is required for create'); } $xml->writeElement('BEGINDATE', $this->getBeginDate(), true); $xml->writeElement('DESCRIPTION', $this->getDescription()); $xml->writeElement('SUPDOCID', $this->getAttachmentsId()); $xml->writeElement('STATE', $this->getAction()); $xml->startElement('TIMESHEETENTRIES'); if (count($this->getEntries()) > 0) { foreach ($this->getEntries() as $entry) { $entry->writeXml($xml); } } else { throw new InvalidArgumentException('Timesheet must have at least 1 entry'); } $xml->endElement(); //TIMESHEETENTRIES $this->writeXmlImplicitCustomFields($xml); $xml->endElement(); //TIMESHEET $xml->endElement(); //create $xml->endElement(); //function }
/** * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('apply_arpayment'); if (!$this->getRecordNo()) { throw new InvalidArgumentException('Record No is required for apply'); } $xml->writeElement('arpaymentkey', $this->getRecordNo(), true); if (!$this->getReceivedDate()) { throw new InvalidArgumentException('Received Date is required for apply'); } $xml->startElement('paymentdate'); $xml->writeDateSplitElements($this->getReceivedDate(), true); $xml->endElement(); //paymentdate $xml->writeElement('batchkey', $this->getSummaryRecordNo()); $xml->writeElement('overpaylocid', $this->getOverpaymentLocationId()); $xml->writeElement('overpaydeptid', $this->getOverpaymentDepartmentId()); if (count($this->getApplyToTransactions()) > 0) { $xml->startElement('arpaymentitems'); foreach ($this->getApplyToTransactions() as $applyToTransaction) { $applyToTransaction->writeXml($xml); } $xml->endElement(); //arpaymentitems } $xml->endElement(); //apply_arpayment $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create_arpaymentbatch'); if (!$this->getTitle()) { throw new InvalidArgumentException('Title is required for create'); } $xml->writeElement('batchtitle', $this->getTitle(), true); if ($this->getUndepositedFundsGlAccountNo()) { $xml->writeElement('undepfundsacct', $this->getUndepositedFundsGlAccountNo()); } elseif ($this->getBankAccountId()) { $xml->writeElement('bankaccountid', $this->getBankAccountId()); } if (!$this->getGlPostingDate()) { throw new InvalidArgumentException('GL Posting Date is required for create'); } $xml->startElement('datecreated'); $xml->writeDateSplitElements($this->getGlPostingDate(), true); $xml->endElement(); //datecreated $xml->endElement(); //create_arpaymentbatch $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create_supdoc'); // Attachments ID is not required if auto-numbering is configured in module $xml->writeElement('supdocid', $this->getAttachmentsId(), true); // System sets value to 'Unnamed' if left null $xml->writeElement('supdocname', $this->getAttachmentsName(), true); if (!$this->getAttachmentFolderName()) { // System does not pick up user preferences for default folder // Nor does it pick up user's related employee default folder throw new InvalidArgumentException('Attachment Folder Name is required for create'); } $xml->writeElement('supdocfoldername', $this->getAttachmentFolderName(), true); $xml->writeElement('supdocdescription', $this->getDescription()); if (count($this->getFiles()) > 0) { $xml->startElement('attachments'); foreach ($this->getFiles() as $file) { if ($file instanceof AttachmentInterface) { $file->writeXml($xml); } } $xml->endElement(); //attachments } $xml->endElement(); //create_supdoc $xml->endElement(); //function }
/** * Write the arpaymentitem block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('arpaymentitem'); $xml->writeElement('invoicekey', $this->getApplyToRecordId(), true); $xml->writeElement('amount', $this->getAmountToApply(), true); $xml->endElement(); //arpaymentitem }
/** * Write the parameter block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('parameter'); $xml->writeElement('name', $this->getName(), true); $xml->writeElement('value', $this->getValue(), true); $xml->endElement(); //parameter }
/** * Write the paymentrequestitem block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('eppaymentrequestitem'); $xml->writeElement('key', $this->getApplyToRecordId(), true); $xml->writeElement('paymentamount', $this->getAmountToApply(), true); $xml->writeElement('credittoapply', $this->getCreditToApply()); $xml->endElement(); //eppaymentrequestitem }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('record_otherreceipt'); $xml->startElement('paymentdate'); $xml->writeDateSplitElements($this->getTransactionDate()); $xml->endElement(); //paymentdate $xml->writeElement('payee', $this->getPayer(), true); $xml->startElement('receiveddate'); $xml->writeDateSplitElements($this->getReceiptDate()); $xml->endElement(); //receiveddate $xml->writeElement('paymentmethod', $this->getPaymentMethod(), true); if ($this->getBankAccountId() || $this->getDepositDate()) { $xml->writeElement('bankaccountid', $this->getBankAccountId(), true); if ($this->getDepositDate()) { $xml->startElement('depositdate'); $xml->writeDateSplitElements($this->getDepositDate(), true); $xml->endElement(); //depositdate } } else { $xml->writeElement('undepglaccountno', $this->getUndepositedFundsGlAccountNo(), true); } $xml->writeElement('refid', $this->getTransactionNo()); $xml->writeElement('description', $this->getDescription()); $xml->writeElement('supdocid', $this->getAttachmentsId()); $xml->writeElement('currency', $this->getTransactionCurrency()); if ($this->getExchangeRateValue()) { $xml->writeElement('exchrate', $this->getExchangeRateValue()); } elseif ($this->getExchangeRateDate() || $this->getExchangeRateType()) { if ($this->getExchangeRateDate()) { $xml->startElement('exchratedate'); $xml->writeDateSplitElements($this->getExchangeRateDate(), true); $xml->endElement(); } $xml->writeElement('exchratetype', $this->getExchangeRateType(), true); } $this->writeXmlExplicitCustomFields($xml); $xml->startElement('receiptitems'); if (count($this->getLines()) > 0) { foreach ($this->getLines() as $line) { $line->writeXml($xml); } } else { throw new InvalidArgumentException('CM Other Receipt must have at least 1 line'); } $xml->endElement(); //receiptitems $xml->endElement(); //record_otherreceipt $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create'); $xml->startElement('GLBATCH'); $xml->writeElement('JOURNAL', $this->getJournalSymbol(), true); $xml->writeElement('BATCH_DATE', $this->getPostingDate(), true); $xml->writeElement('REVERSEDATE', $this->getReverseDate()); $xml->writeElement('BATCH_TITLE', $this->getDescription(), true); $xml->writeElement('HISTORY_COMMENT', $this->getHistoryComment()); $xml->writeElement('REFERENCENO', $this->getReferenceNumber()); $xml->writeElement('BASELOCATION_NO', $this->getSourceEntityId()); $xml->writeElement('SUPDOCID', $this->getAttachmentsId()); $xml->writeElement('STATE', $this->getAction()); $this->writeXmlImplicitCustomFields($xml); $xml->startElement('ENTRIES'); if (count($this->getLines()) >= 2) { foreach ($this->getLines() as $entry) { $entry->writeXml($xml); } } else { throw new InvalidArgumentException('Journal Entry must have at least 2 lines'); } $xml->endElement(); //ENTRIES $xml->endElement(); //GLBATCH $xml->endElement(); //create $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('getObjectTrail'); $xml->writeElement('object', $this->getObjectName(), true); $xml->writeElement('objectKey', $this->getObjectKey(), true); $xml->endElement(); //getObjectTrail $xml->endElement(); //function }
/** * Write the operation block XML * * @param XMLWriter $xml */ public function writeXml(&$xml) { $xml->startElement('authentication'); $xml->startElement('login'); $xml->writeElement('userid', $this->userId, true); $xml->writeElement('companyid', $this->companyId, true); $xml->writeElement('password', $this->password, true); $xml->endElement(); //login $xml->endElement(); //authentication }
/** * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('ictransitem'); $xml->writeElement('itemid', $this->getItemId(), true); $xml->writeElement('itemdesc', $this->getItemDescription()); $xml->writeElement('warehouseid', $this->getWarehouseId()); $xml->writeElement('quantity', $this->getQuantity(), true); $xml->writeElement('unit', $this->getUnit()); $xml->writeElement('cost', $this->getCost()); $xml->writeElement('locationid', $this->getLocationId()); $xml->writeElement('departmentid', $this->getDepartmentId()); if (count($this->getItemDetails()) > 0) { $xml->startElement('itemdetails'); foreach ($this->getItemDetails() as $itemDetail) { $itemDetail->writeXml($xml); } $xml->endElement(); //itemdetails } $this->writeXmlExplicitCustomFields($xml); $xml->writeElement('projectid', $this->getProjectId()); $xml->writeElement('customerid', $this->getCustomerId()); $xml->writeElement('vendorid', $this->getVendorId()); $xml->writeElement('employeeid', $this->getEmployeeId()); $xml->writeElement('classid', $this->getClassId()); $xml->writeElement('contractid', $this->getContractId()); $xml->endElement(); //ictransitem }
/** * Write the function block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('csnentity'); if (!$this->getEntityId()) { throw new InvalidArgumentException('Entity ID is required to consolidate an entity'); } $xml->writeElement('entityid', $this->getEntityId(), true); // Rates support up to 10 decimal places $bsRate = is_float($this->getEndingSpotRate()) ? number_format($this->getEndingSpotRate(), 10) : $this->getEndingSpotRate(); $waRate = is_float($this->getWeightedAverageRate()) ? number_format($this->getWeightedAverageRate(), 10) : $this->getWeightedAverageRate(); $xml->writeElement('bsrate', $bsRate); $xml->writeElement('warate', $waRate); $xml->endElement(); //csnentity }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('delete'); $xml->writeElement('object', 'WAREHOUSE'); if (!$this->getRecordNo()) { throw new InvalidArgumentException('Record No is required for delete'); } $xml->writeElement('keys', $this->getRecordNo()); $xml->endElement(); //delete $xml->endElement(); //function }
/** * Write the authentication block XML * * @param XMLWriter $xml */ public function writeXml(&$xml) { $xml->startElement('authentication'); $xml->writeElement('sessionid', $this->sessionId, true); $xml->endElement(); //authentication }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create_aradjustmentbatch'); if (!$this->getTitle()) { throw new InvalidArgumentException('Title is required for create'); } $xml->writeElement('batchtitle', $this->getTitle(), true); if (!$this->getGlPostingDate()) { throw new InvalidArgumentException('GL Posting Date is required for create'); } $xml->startElement('datecreated'); $xml->writeDateSplitElements($this->getGlPostingDate(), true); $xml->endElement(); //datecreated /*if (count($this->getApAdjustments()) > 0) { foreach ($this->getApAdjustments() as $apAdjustment) { $bill->writeXml($xml); } }*/ $xml->endElement(); //create_aradjustmentbatch $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update_supdocfolder'); if (!$this->getFolderName()) { throw new InvalidArgumentException('Attachments Folder Name is required for update'); } $xml->writeElement('supdocfoldername', $this->getFolderName(), true); $xml->writeElement('supdocfolderdescription', $this->getDescription()); $xml->writeElement('supdocparentfoldername', $this->getParentFolderName()); $xml->endElement(); //update_supdocfolder $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create'); $xml->startElement('WAREHOUSE'); if (!$this->getWarehouseId()) { throw new InvalidArgumentException('Warehouse ID is required for create'); } $xml->writeElement('WAREHOUSEID', $this->getWarehouseId(), true); if (!$this->getWarehouseName()) { throw new InvalidArgumentException('Warehouse Name is required for create'); } $xml->writeElement('NAME', $this->getWarehouseName(), true); if (!$this->getLocationId()) { throw new InvalidArgumentException('Location ID is required for create'); } $xml->startElement('LOC'); $xml->writeElement('LOCATIONID', $this->getLocationId(), true); $xml->endElement(); //LOC $xml->writeElement('MANAGERID', $this->getManagerEmployeeId()); $xml->writeElement('PARENTID', $this->getParentWarehouseId()); if ($this->getWarehouseContactName()) { $xml->startElement('CONTACTINFO'); $xml->writeElement('CONTACTNAME', $this->getWarehouseContactName()); $xml->endElement(); } if ($this->getShipToContactName()) { $xml->startElement('SHIPTO'); $xml->writeElement('CONTACTNAME', $this->getShipToContactName()); $xml->endElement(); } $xml->writeElement('USEDINGL', $this->isUsedInGeneralLedger()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } $this->writeXmlImplicitCustomFields($xml); $xml->endElement(); //WAREHOUSE $xml->endElement(); //create $xml->endElement(); //function }
/** * @param XMLWriter $xml */ protected function writeXmlImplicitCustomFields(XMLWriter &$xml) { if (count($this->customFields) > 0) { foreach ($this->customFields as $customFieldName => $customFieldValue) { $xml->writeElement($customFieldName, $customFieldValue, true); } } }
/** * Write the function block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->writeElement('getAPISession', null, true); $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create'); $xml->startElement('EEACCOUNTLABEL'); if (!$this->getExpenseType()) { throw new InvalidArgumentException('Expense Type is required for create'); } $xml->writeElement('ACCOUNTLABEL', $this->getExpenseType(), true); if (!$this->getDescription()) { throw new InvalidArgumentException('Description is required for create'); } $xml->writeElement('DESCRIPTION', $this->getDescription(), true); if (!$this->getGlAccountNo()) { throw new InvalidArgumentException('GL Account is required for create'); } $xml->writeElement('GLACCOUNTNO', $this->getGlAccountNo(), true); $xml->writeElement('OFFSETGLACCOUNTNO', $this->getOffsetGlAccountNo()); $xml->writeElement('ITEMID', $this->getItemId()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } $this->writeXmlImplicitCustomFields($xml); $xml->endElement(); //EEACCOUNTLABEL $xml->endElement(); //create $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update'); $xml->startElement('ALLOCATION'); if (!$this->getAllocationId()) { throw new InvalidArgumentException('Allocation ID is required for update'); } $xml->writeElement('ALLOCATIONID', $this->getAllocationId(), true); $xml->writeElement('TYPE', $this->getAllocateBy()); $xml->writeElement('DESCRIPTION', $this->getDescription()); $xml->writeElement('DOCNUMBER', $this->getDocumentNo()); $xml->writeElement('SUPDOCID', $this->getAttachmentsId()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } if (count($this->getLines()) > 0) { // Completely replaces any existing lines $xml->startElement('ALLOCATIONENTRIES'); foreach ($this->getLines() as $allocationLine) { $allocationLine->writeXml($xml); } $xml->endElement(); //ALLOCATIONENTRIES } $xml->endElement(); //ALLOCATION $xml->endElement(); //update $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update'); $xml->startElement('DEPARTMENT'); if (!$this->getDepartmentId()) { throw new InvalidArgumentException('Department ID is required for update'); } $xml->writeElement('DEPARTMENTID', $this->getDepartmentId(), true); $xml->writeElement('TITLE', $this->getDepartmentName()); $xml->writeElement('PARENTID', $this->getParentDepartmentId()); $xml->writeElement('SUPERVISORID', $this->getManagerEmployeeId()); $xml->writeElement('CUSTTITLE', $this->getDepartmentTitle()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } $this->writeXmlImplicitCustomFields($xml); $xml->endElement(); //DEPARTMENT $xml->endElement(); //update $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('create_reimbursementrequest'); if (!$this->getBankAccountId()) { throw new InvalidArgumentException('Bank Account ID is required for create reimbursement request'); } $xml->writeElement('bankaccountid', $this->getBankAccountId(), true); if (!$this->getEmployeeId()) { throw new InvalidArgumentException('Employee ID is required for create reimbursement request'); } $xml->writeElement('employeeid', $this->getEmployeeId(), true); $xml->writeElement('memo', $this->getMemo()); if (!$this->getPaymentMethod()) { throw new InvalidArgumentException('Payment Method is required for create reimbursement request'); } $xml->writeElement('paymentmethod', $this->getPaymentMethod(), true); if (!$this->getPaymentDate()) { throw new InvalidArgumentException('Payment Date is required for create reimbursement request'); } $xml->startElement('paymentdate'); $xml->writeDateSplitElements($this->getPaymentDate(), true); $xml->endElement(); //paymentdate $xml->writeElement('paymentoption', $this->getMergeOption()); if (count($this->getApplyToTransactions()) > 0) { $xml->startElement('eppaymentrequestitems'); foreach ($this->getApplyToTransactions() as $applyToTransaction) { $applyToTransaction->writeXml($xml); } $xml->endElement(); //eppaymentrequestitems } else { throw new InvalidArgumentException('EE Reimbursement Request must have at least 1 transaction to apply against'); } $xml->writeElement('documentnumber', $this->getDocumentNo()); $xml->writeElement('paymentdescription', $this->getMemo()); $xml->writeElement('paymentcontact', $this->getNotificationContactName()); $xml->endElement(); //create_reimbursementrequest $xml->endElement(); //function }
/** * Write the getUserPermissions block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('getUserPermissions'); $xml->writeElement('userId', $this->getUserId(), true); $xml->endElement(); //getUserPermissions $xml->endElement(); //function }
/** * Write the inspect block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('inspect'); $xml->writeAttribute('detail', $this->writeXmlShowDetail()); $xml->writeElement('object', $this->getObjectName(), true); $xml->endElement(); //inspect $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update'); $xml->startElement('APACCOUNTLABEL'); if (!$this->getAccountLabel()) { throw new InvalidArgumentException('Account Label is required for update'); } $xml->writeElement('ACCOUNTLABEL', $this->getAccountLabel(), true); $xml->writeElement('DESCRIPTION', $this->getDescription()); $xml->writeElement('GLACCOUNTNO', $this->getGlAccountNo()); $xml->writeElement('OFFSETGLACCOUNTNO', $this->getOffsetGlAccountNo()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } $xml->endElement(); //APACCOUNTLABEL $xml->endElement(); //update $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml * @throw InvalidArgumentException */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('update'); $xml->startElement('CLASS'); if (!$this->getClassId()) { throw new InvalidArgumentException('Class ID is required for update'); } $xml->writeElement('CLASSID', $this->getClassId(), true); $xml->writeElement('NAME', $this->getClassName()); $xml->writeElement('DESCRIPTION', $this->getDescription()); $xml->writeElement('PARENTID', $this->getParentClassId()); if ($this->isActive() === true) { $xml->writeElement('STATUS', 'active'); } elseif ($this->isActive() === false) { $xml->writeElement('STATUS', 'inactive'); } $this->writeXmlImplicitCustomFields($xml); $xml->endElement(); //CLASS $xml->endElement(); //update $xml->endElement(); //function }
/** * Write the function block XML * * @param XMLWriter $xml */ public function writeXml(XMLWriter &$xml) { $xml->startElement('function'); $xml->writeAttribute('controlid', $this->getControlId()); $xml->startElement('consolidate'); if (!$this->getReportingBookId()) { throw new InvalidArgumentException('Reporting Book ID is required to create consolidation'); } $xml->writeElement('bookid', $this->getReportingBookId(), true); if (!$this->getReportingPeriodName()) { throw new InvalidArgumentException('Reporting Period Name is required to create consolidation'); } $xml->writeElement('reportingperiodname', $this->getReportingPeriodName(), true); $xml->writeElement('offline', $this->isProcessOffline()); $xml->writeElement('updatesucceedingperiods', $this->isUpdateSucceedingPeriods()); $xml->writeElement('changesonly', $this->isChangesOnly()); $xml->writeElement('email', $this->getNotificationEmail()); if (count($this->getEntities()) > 0) { $xml->startElement('entities'); foreach ($this->getEntities() as $entity) { $entity->writeXml($xml); } $xml->endElement(); //entities } $xml->endElement(); //consolidate $xml->endElement(); //function }