QuickBooks/IPP/Service.php
protected function _findById($Context, $realmID, $resource, $IDType, $xml_or_IDType = '', $query = null)
	{
		$IPP = $Context->IPP();

		$flavor = $IPP->flavor();

		if (!$xml_or_IDType)
		{
			if ($flavor == QuickBooks_IPP_IDS::FLAVOR_DESKTOP)
			{
				$parse = QuickBooks_IPP_IDS::parseIDType($IDType);

				$xml_or_IDType = '';
				$xml_or_IDType .= '<?xml version="1.0" encoding="UTF-8"?>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '<' . $resource . 'Query xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intuit.com/sb/cdm/' . $IPP->version() . '">' . QUICKBOOKS_CRLF;

				if ($resource == QuickBooks_IPP_IDS::RESOURCE_CUSTOMER)
				{
					$xml_or_IDType .= '<CustomFieldEnable>true</CustomFieldEnable>';
				}

				if ($query)
				{
					$xml_or_IDType .= $query;
				}

				$xml_or_IDType .= '	<' . QuickBooks_IPP_IDS::resourceToKeyType($resource) . 'Set>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '		<Id idDomain="' . $parse['domain'] . '">' . $parse['ID'] . '</Id>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '	</' . QuickBooks_IPP_IDS::resourceToKeyType($resource) . 'Set>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '</' . $resource . 'Query>';
			}
			else if ($flavor == QuickBooks_IPP_IDS::FLAVOR_ONLINE)
			{
				$xml_or_IDType = $IDType;
			}
		}

		$return = $IPP->IDS($Context, $realmID, $resource, QuickBooks_IPP_IDS::OPTYPE_FINDBYID, $xml_or_IDType);
		$this->_setLastRequestResponse($Context->lastRequest(), $Context->lastResponse());
		$this->_setLastDebug($Context->lastDebug());

		if (count($return))
		{
			return $return[0];
		}

		return null;
	}
protected function _findById($Context, $realmID, $resource, $IDType, $xml_or_IDType = '', $query = null)
	{
		$IPP = $Context->IPP();

		$flavor = $IPP->flavor();

		if (!$xml_or_IDType)
		{
			if ($flavor == QuickBooks_IPP_IDS::FLAVOR_DESKTOP)
			{
				$parse = QuickBooks_IPP_IDS::parseIDType($IDType);

				$xml_or_IDType = '';
				$xml_or_IDType .= '<?xml version="1.0" encoding="UTF-8"?>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '<' . $resource . 'Query xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intuit.com/sb/cdm/' . $IPP->version() . '">' . QUICKBOOKS_CRLF;

				if ($resource == QuickBooks_IPP_IDS::RESOURCE_CUSTOMER)
				{
					$xml_or_IDType .= '<CustomFieldEnable>true</CustomFieldEnable>';
				}

				if ($query)
				{
					$xml_or_IDType .= $query;
				}

				$xml_or_IDType .= '	<' . QuickBooks_IPP_IDS::resourceToKeyType($resource) . 'Set>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '		<Id idDomain="' . $parse['domain'] . '">' . $parse['ID'] . '</Id>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '	</' . QuickBooks_IPP_IDS::resourceToKeyType($resource) . 'Set>' . QUICKBOOKS_CRLF;
				$xml_or_IDType .= '</' . $resource . 'Query>';
			}
			else if ($flavor == QuickBooks_IPP_IDS::FLAVOR_ONLINE)
			{
				$xml_or_IDType = $IDType;
			}
		}

		$return = $IPP->IDS($Context, $realmID, $resource, QuickBooks_IPP_IDS::OPTYPE_FINDBYID, $xml_or_IDType);
		$this->_setLastRequestResponse($Context->lastRequest(), $Context->lastResponse());
		$this->_setLastDebug($Context->lastDebug());

		if (count($return))
		{
			return $return[0];
		}

		return null;
	}
Find a record by ID number