QuickBooks/QBXML/Schema/Object.php
public function reorderPaths($unordered_paths, $allow_application_id = true, $allow_application_editsequence = true)
	{
		/*
		static $ordered_paths = array(
			0 => 'Name', 
			1 => 'FirstName', 
			2 => 'LastName',
			);
		*/
		
		$ordered_paths = $this->_reorderPathsPaths();
		
		$tmp = array();
		
		foreach ($ordered_paths as $key => $path)
		{
			if (in_array($path, $unordered_paths))
			{
				$tmp[$key] = $path;
			}
			/*else if (substr($path, -6) == 'ListID' and $allow_application_id)
			{
				// Modify and add:  (so that application IDs are supported and in the correct place)
				//	CustomerRef ListID tags 
				// modified to:
				//	CustomerRef APIApplicationID tags
				
				$parent = trim(substr($path, 0, -7));
				
				$apppath = trim($parent . ' ' . QUICKBOOKS_API_APPLICATIONID);
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}
			else if (substr($path, -5) == 'TxnID' and $allow_application_id)
			{
				$parent = trim(substr($path, 0, -6));
				
				$apppath = $parent . ' ' . QUICKBOOKS_API_APPLICATIONID;
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}
			else if ($path == 'EditSequence' and $allow_application_editsequence)
			{
				$apppath = QUICKBOOKS_API_APPLICATIONEDITSEQUENCE;
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}*/
			
			/*else if ($path == QUICKBOOKS_API_APPLICATIONID)
			{
				print('HERE!');
			}*/
		}
		
		return array_merge($tmp);
	}
public function reorderPaths($unordered_paths, $allow_application_id = true, $allow_application_editsequence = true)
	{
		/*
		static $ordered_paths = array(
			0 => 'Name', 
			1 => 'FirstName', 
			2 => 'LastName',
			);
		*/
		
		$ordered_paths = $this->_reorderPathsPaths();
		
		$tmp = array();
		
		foreach ($ordered_paths as $key => $path)
		{
			if (in_array($path, $unordered_paths))
			{
				$tmp[$key] = $path;
			}
			/*else if (substr($path, -6) == 'ListID' and $allow_application_id)
			{
				// Modify and add:  (so that application IDs are supported and in the correct place)
				//	CustomerRef ListID tags 
				// modified to:
				//	CustomerRef APIApplicationID tags
				
				$parent = trim(substr($path, 0, -7));
				
				$apppath = trim($parent . ' ' . QUICKBOOKS_API_APPLICATIONID);
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}
			else if (substr($path, -5) == 'TxnID' and $allow_application_id)
			{
				$parent = trim(substr($path, 0, -6));
				
				$apppath = $parent . ' ' . QUICKBOOKS_API_APPLICATIONID;
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}
			else if ($path == 'EditSequence' and $allow_application_editsequence)
			{
				$apppath = QUICKBOOKS_API_APPLICATIONEDITSEQUENCE;
				
				if (in_array($apppath, $unordered_paths))
				{
					$tmp[$key] = $apppath;
				}
			}*/
			
			/*else if ($path == QUICKBOOKS_API_APPLICATIONID)
			{
				print('HERE!');
			}*/
		}
		
		return array_merge($tmp);
	}
Re-order an array to match the schema order

@param array $unordered_paths
@param boolean $allow_application_id
@return array