本文整理汇总了PHP中QuickBooks_Object::fromXML方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBooks_Object::fromXML方法的具体用法?PHP QuickBooks_Object::fromXML怎么用?PHP QuickBooks_Object::fromXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickBooks_Object
的用法示例。
在下文中一共展示了QuickBooks_Object::fromXML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromQBXML
/**
* Convert a qbXML string to a QuickBooks_Object_* object instance
*
* @param string $qbxml
* @param string $action_or_object
* @return QuickBooks_Object
*/
public static function fromQBXML($qbxml, $action_or_object = null)
{
$errnum = null;
$errmsg = null;
$Parser = new QuickBooks_XML_Parser($qbxml);
if ($Doc = $Parser->parse($errnum, $errmsg)) {
$XML = $Doc->getRoot();
return QuickBooks_Object::fromXML($XML, $action_or_object);
}
return false;
}
示例2: print_r
</SalesTaxCodeRef>
</SalesReceiptLineRet>
</SalesReceiptRet>';
// Convert the qbXML string to an object
$Object = QuickBooks_Object::fromQBXML($qbxml);
// Print the object
print_r($Object);
// Now, convert it back to qbXML, as an ADD
print $Object->asQBXML(QUICKBOOKS_ADD_SALESRECEIPT);
// If you already have it as an XML document, you can convert that too
$errnum = null;
$errmsg = null;
$Parser = new QuickBooks_XML_Parser($qbxml);
if ($Doc = $Parser->parse($errnum, $errmsg)) {
$Root = $Doc->getRoot();
$Object = QuickBooks_Object::fromXML($Root);
// Print it out
print_r($Object);
}
// Another test...
$qbxml = '
<CustomerRet>
<ListID>10006-1211236622</ListID>
<TimeCreated>2008-05-19T18:37:02-05:00</TimeCreated>
<TimeModified>2008-06-10T23:35:56-05:00</TimeModified>
<EditSequence>1213155356</EditSequence>
<Name>Keith Palmer</Name>
<FullName>Keith Palmer</FullName>
<IsActive>true</IsActive>
<Sublevel>0</Sublevel>
<FirstName>Keith</FirstName>
示例3: _objectFromXML
/**
*
*
*
*/
protected static function _objectFromXML($action, $XML)
{
return QuickBooks_Object::fromXML($XML, $action);
}