本文整理汇总了PHP中Intacct\Xml\XMLWriter::writeAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::writeAttribute方法的具体用法?PHP XMLWriter::writeAttribute怎么用?PHP XMLWriter::writeAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intacct\Xml\XMLWriter
的用法示例。
在下文中一共展示了XMLWriter::writeAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_customerchargecard');
if (!$this->getRecordNo()) {
throw new InvalidArgumentException('Record No is required for update');
}
$xml->writeAttribute('recordno', $this->getRecordNo(), true);
$xml->writeElement('exp_month', $this->getExpirationMonth());
$xml->writeElement('exp_year', $this->getExpirationYear());
$xml->writeElement('description', $this->getDescription());
if ($this->isActive() === true) {
$xml->writeElement('status', 'active');
} elseif ($this->isActive() === false) {
$xml->writeElement('status', 'inactive');
}
if ($this->getAddressLine1() || $this->getAddressLine2() || $this->getCity() || $this->getStateProvince() || $this->getZipPostalCode() || $this->getCountry()) {
$xml->startElement('mailaddress');
$xml->writeElement('address1', $this->getAddressLine1());
$xml->writeElement('address2', $this->getAddressLine2());
$xml->writeElement('city', $this->getCity());
$xml->writeElement('state', $this->getStateProvince());
$xml->writeElement('zip', $this->getZipPostalCode());
$xml->writeElement('country', $this->getCountry());
$xml->endElement();
//mailaddress
}
$xml->writeElement('defaultcard', $this->isDefaultCard());
$xml->writeElement('usebilltoaddr', $this->isBillToContactAddressUsedForVerification());
$xml->endElement();
//update_customerchargecard
$xml->endElement();
//function
}
示例2: 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
}
示例3: 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('delete_item');
if (!$this->getItemId()) {
throw new InvalidArgumentException('Item ID is required for delete');
}
$xml->writeAttribute('itemid', $this->getItemId());
$xml->endElement();
//delete_item
$xml->endElement();
//function
}
示例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('delete_expensetype');
if (!$this->getExpenseType()) {
throw new InvalidArgumentException('Expense Type is required for delete');
}
$xml->writeAttribute('expensetype', $this->getExpenseType());
$xml->endElement();
//delete_expensetype
$xml->endElement();
//function
}
示例5: 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('delete_supdocfolder');
if (!$this->getFolderName()) {
throw new InvalidArgumentException('Attachments Folder Name is required for delete');
}
$xml->writeAttribute('key', $this->getFolderName());
$xml->endElement();
//delete_supdocfolder
$xml->endElement();
//function
}
示例6: 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('delete_task');
if (!$this->getRecordNo()) {
throw new InvalidArgumentException('Task Record No is required for delete');
}
$xml->writeAttribute('key', $this->getRecordNo());
$xml->endElement();
//delete_task
$xml->endElement();
//function
}
示例7: 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('delete_statglaccount');
if (!$this->getAccountNo()) {
throw new InvalidArgumentException('Account No is required for delete');
}
$xml->writeAttribute('glaccountno', $this->getAccountNo());
$xml->endElement();
//delete_statglaccount
$xml->endElement();
//function
}
示例8: 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('delete_potransaction');
if (!$this->getDocumentId()) {
throw new InvalidArgumentException('Document ID is required for delete');
}
$xml->writeAttribute('key', $this->getDocumentId());
$xml->endElement();
//delete_potransaction
$xml->endElement();
//function
}
示例9: 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('delete_contact');
if (!$this->getContactName()) {
throw new InvalidArgumentException('Contact Name is required for delete');
}
$xml->writeAttribute('contactname', $this->getContactName());
$xml->endElement();
//delete_contact
$xml->endElement();
//function
}
示例10: 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');
$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
}
示例11: 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
}
示例12: 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');
$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
}
示例13: 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');
$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('SUPDOCID', $this->getAttachmentsId());
$xml->writeElement('STATE', $this->getAction());
$this->writeXmlImplicitCustomFields($xml);
$xml->startElement('ENTRIES');
if (count($this->getLines()) >= 1) {
foreach ($this->getLines() as $entry) {
$entry->writeXml($xml);
}
} else {
throw new InvalidArgumentException('Statistical Journal Entry must have at least 1 line');
}
$xml->endElement();
//ENTRIES
$xml->endElement();
//GLBATCH
$xml->endElement();
//create
$xml->endElement();
//function
}
示例14: 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');
$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
}
示例15: writeXml
/**
* 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
}