本文整理汇总了PHP中Intacct\Xml\XMLWriter类的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter类的具体用法?PHP XMLWriter怎么用?PHP XMLWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XMLWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:33,代码来源:AttachmentsUpdate.php
示例2: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:37,代码来源:AttachmentsCreate.php
示例3: writeXml
/**
* Write the authentication block XML
*
* @param XMLWriter $xml
*/
public function writeXml(&$xml)
{
$xml->startElement('authentication');
$xml->writeElement('sessionid', $this->sessionId, true);
$xml->endElement();
//authentication
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:12,代码来源:SessionAuthentication.php
示例4: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:32,代码来源:ArAdjustmentSummaryCreate.php
示例5: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:13,代码来源:AdditionalParameter.php
示例6: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:13,代码来源:ApiSessionCreate.php
示例7: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:13,代码来源:ArPaymentItem.php
示例8: writeXmlImplicitCustomFields
/**
* @param XMLWriter $xml
*/
protected function writeXmlImplicitCustomFields(XMLWriter &$xml)
{
if (count($this->customFields) > 0) {
foreach ($this->customFields as $customFieldName => $customFieldValue) {
$xml->writeElement($customFieldName, $customFieldValue, true);
}
}
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:11,代码来源:CustomFieldsTrait.php
示例9: writeXml
/**
* Write the sortfield block XML
*
* @param XMLWriter $xml
*/
public function writeXml(XMLWriter &$xml)
{
$xml->startElement('sortfield');
$xml->writeAttribute('order', $this->getOrderBy());
$xml->text($this->getFieldName());
$xml->endElement();
//sortfield
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:13,代码来源:SortField.php
示例10: testNotEnoughFilters
/**
* @covers Intacct\Functions\Common\GetList\LogicalFilter::writeXml
* @expectedException InvalidArgumentException
* @expectedExceptionMessage Logical Filters count must be 2 or more
*/
public function testNotEnoughFilters()
{
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$filter = new LogicalFilter();
$filter->writeXml($xml);
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:LogicalFilterTest.php
示例11: testParamOverrides
/**
* @covers Intacct\Functions\AccountsReceivable\ArAdjustmentLineCreate::writeXml
*/
public function testParamOverrides()
{
$expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<lineitem>
<accountlabel>TestBill Account1</accountlabel>
<offsetglaccountno>93590253</offsetglaccountno>
<amount>76343.43</amount>
<memo>Just another memo</memo>
<locationid>Location1</locationid>
<departmentid>Department1</departmentid>
<key>Key1</key>
<totalpaid>23484.93</totalpaid>
<totaldue>0</totaldue>
<customfields>
<customfield>
<customfieldname>customfield1</customfieldname>
<customfieldvalue>customvalue1</customfieldvalue>
</customfield>
</customfields>
<projectid>Project1</projectid>
<customerid>Customer1</customerid>
<vendorid>Vendor1</vendorid>
<employeeid>Employee1</employeeid>
<itemid>Item1</itemid>
<classid>Class1</classid>
<warehouseid>Warehouse1</warehouseid>
</lineitem>
EOF;
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$line = new ArAdjustmentLineCreate();
$line->setAccountLabel('TestBill Account1');
$line->setOffsetGLAccountNumber('93590253');
$line->setTransactionAmount(76343.42999999999);
$line->setMemo('Just another memo');
$line->setKey('Key1');
$line->setTotalPaid(23484.93);
$line->setTotalDue(0.0);
$line->setLocationId('Location1');
$line->setDepartmentId('Department1');
$line->setProjectId('Project1');
$line->setCustomerId('Customer1');
$line->setVendorId('Vendor1');
$line->setEmployeeId('Employee1');
$line->setItemId('Item1');
$line->setClassId('Class1');
$line->setWarehouseId('Warehouse1');
$line->setCustomFields(['customfield1' => 'customvalue1']);
$line->writeXml($xml);
$this->assertXmlStringEqualsXmlString($expected, $xml->flush());
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:58,代码来源:ArAdjustmentLineCreateTest.php
示例12: testParamOverrides
/**
* @covers Intacct\Functions\Projects\TimesheetEntryCreate::writeXml
*/
public function testParamOverrides()
{
$expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<TIMESHEETENTRY>
<ENTRYDATE>06/30/2016</ENTRYDATE>
<QTY>1.75</QTY>
<DESCRIPTION>desc</DESCRIPTION>
<NOTES>my note</NOTES>
<TASKKEY>1234</TASKKEY>
<TIMETYPE>Salary</TIMETYPE>
<BILLABLE>true</BILLABLE>
<EXTBILLRATE>200</EXTBILLRATE>
<EXTCOSTRATE>175</EXTCOSTRATE>
<DEPARTMENTID>ADM</DEPARTMENTID>
<LOCATIONID>100</LOCATIONID>
<PROJECTID>P100</PROJECTID>
<CUSTOMERID>C100</CUSTOMERID>
<VENDORID>V100</VENDORID>
<ITEMID>I100</ITEMID>
<CLASSID>C200</CLASSID>
<CONTRACTID>C300</CONTRACTID>
<WAREHOUSEID>W100</WAREHOUSEID>
<customfield1>customvalue1</customfield1>
</TIMESHEETENTRY>
EOF;
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$line = new TimesheetEntryCreate();
$line->setEntryDate(new DateType('2016-06-30'));
$line->setQuantity(1.75);
$line->setDescription('desc');
$line->setNotes('my note');
$line->setTaskRecordNo(1234);
$line->setTimeTypeName('Salary');
$line->setBillable(true);
$line->setOverrideBillingRate(200.0);
$line->setOverrideLaborCostRate(175.0);
$line->setDepartmentId('ADM');
$line->setLocationId('100');
$line->setProjectId('P100');
$line->setCustomerId('C100');
$line->setVendorId('V100');
$line->setItemId('I100');
$line->setClassId('C200');
$line->setContractId('C300');
$line->setWarehouseId('W100');
$line->setCustomFields(['customfield1' => 'customvalue1']);
$line->writeXml($xml);
$this->assertXmlStringEqualsXmlString($expected, $xml->flush());
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:57,代码来源:TimesheetEntryCreateTest.php
示例13: testNoView
/**
* @covers Intacct\Functions\Common\ReadView::__construct
* @expectedException InvalidArgumentException
* @expectedExceptionMessage View Name is required for read view
*/
public function testNoView()
{
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$readView = new ReadView('unittest');
//$readView->setViewName('TestBill Date Runtime');
$readView->writeXml($xml);
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:16,代码来源:ReadViewTest.php
示例14: writeXml
/**
* Write the update block XML
*
* @param XMLWriter $xml
* @throw InvalidArgumentException
*/
public function writeXml(XMLWriter &$xml)
{
$xml->startElement('function');
$xml->writeAttribute('controlid', $this->getControlId());
$xml->startElement('update');
foreach ($this->getRecords() as $record) {
$record->writeXml($xml);
}
$xml->endElement();
//update
$xml->endElement();
//function
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:19,代码来源:Update.php
示例15: testParamOverrides
/**
* @covers Intacct\Functions\CashManagement\ChargeCardTransactionLineUpdate::writeXml
*/
public function testParamOverrides()
{
$expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<updateccpayitem line_num="3">
<accountlabel>TestBill Account1</accountlabel>
<description>Just another memo</description>
<paymentamount>76343.43</paymentamount>
<departmentid>Department1</departmentid>
<locationid>Location1</locationid>
<customerid>Customer1</customerid>
<vendorid>Vendor1</vendorid>
<employeeid>Employee1</employeeid>
<projectid>Project1</projectid>
<itemid>Item1</itemid>
<classid>Class1</classid>
<contractid>Contract1</contractid>
<warehouseid>Warehouse1</warehouseid>
<customfields>
<customfield>
<customfieldname>customfield1</customfieldname>
<customfieldvalue>customvalue1</customfieldvalue>
</customfield>
</customfields>
</updateccpayitem>
EOF;
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$line = new ChargeCardTransactionLineUpdate();
$line->setLineNo(3);
$line->setAccountLabel('TestBill Account1');
$line->setTransactionAmount(76343.42999999999);
$line->setMemo('Just another memo');
$line->setLocationId('Location1');
$line->setDepartmentId('Department1');
$line->setProjectId('Project1');
$line->setCustomerId('Customer1');
$line->setVendorId('Vendor1');
$line->setEmployeeId('Employee1');
$line->setItemId('Item1');
$line->setClassId('Class1');
$line->setContractId('Contract1');
$line->setWarehouseId('Warehouse1');
$line->setCustomFields(['customfield1' => 'customvalue1']);
$line->writeXml($xml);
$this->assertXmlStringEqualsXmlString($expected, $xml->flush());
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:53,代码来源:ChargeCardTransactionLineUpdateTest.php
示例16: testRequiredTitle
/**
* @covers Intacct\Functions\GeneralLedger\AccountCreate::writeXml
* @expectedException InvalidArgumentException
* @expectedExceptionMessage Title is required for create
*/
public function testRequiredTitle()
{
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$account = new AccountCreate('unittest');
$account->setAccountNo('1010');
//$account->setTitle('hello world');
$account->setAccountType('balancesheet');
$account->setNormalBalance('debit');
$account->setClosingType('non-closing account');
$account->writeXml($xml);
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:20,代码来源:AccountCreateTest.php
示例17: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:20,代码来源:ConsolidationEntity.php
示例18: testParamsOverrides
/**
* @covers Intacct\Functions\InventoryControl\TransactionSubtotalCreate::writeXml
*/
public function testParamsOverrides()
{
$expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<subtotal>
<description>Subtotal Description</description>
<total>4202</total>
<percentval>9.2</percentval>
<locationid>2355</locationid>
<departmentid>RCVNG</departmentid>
<projectid>FOW</projectid>
<customerid>CUST5893</customerid>
<vendorid>VEN53222</vendorid>
<employeeid>EM5925</employeeid>
<classid>CLS322</classid>
<itemid>I5266235</itemid>
<contractid>C23662</contractid>
<customfields>
<customfield>
<customfieldname>customfield1</customfieldname>
<customfieldvalue>customvalue1</customfieldvalue>
</customfield>
</customfields>
</subtotal>
EOF;
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$subtotal = new TransactionSubtotalCreate();
$subtotal->setDescription('Subtotal Description');
$subtotal->setTotal(4202);
$subtotal->setPercentageValue(9.199999999999999);
$subtotal->setLocationId('2355');
$subtotal->setDepartmentId('RCVNG');
$subtotal->setProjectId('FOW');
$subtotal->setCustomerId('CUST5893');
$subtotal->setVendorId('VEN53222');
$subtotal->setEmployeeId('EM5925');
$subtotal->setClassId('CLS322');
$subtotal->setItemId('I5266235');
$subtotal->setContractId('C23662');
$subtotal->setCustomFields(['customfield1' => 'customvalue1']);
$subtotal->writeXml($xml);
$this->assertXmlStringEqualsXmlString($expected, $xml->flush());
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:50,代码来源:TransactionSubtotalCreateTest.php
示例19: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:17,代码来源:AuditTrailRead.php
示例20: writeXml
/**
* 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
}
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:17,代码来源:Inspect.php
注:本文中的Intacct\Xml\XMLWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论