QuickBooks/Utilities.php
static public function keyForObject($object)
	{
		// Make sure it's an object
		$object = QuickBooks_Utilities::actionToObject($object);
		
		switch ($object)
		{
			case QUICKBOOKS_OBJECT_BILLPAYMENTCREDITCARD:
			case QUICKBOOKS_OBJECT_INVENTORYADJUSTMENT:
			case QUICKBOOKS_OBJECT_BILLPAYMENTCHECK:
			case QUICKBOOKS_OBJECT_CREDITCARDCREDIT:
			case QUICKBOOKS_OBJECT_CREDITCARDCHARGE:
			case QUICKBOOKS_OBJECT_VEHICLEMILEAGE:
			case QUICKBOOKS_OBJECT_RECEIVEPAYMENT:
			case QUICKBOOKS_OBJECT_PURCHASEORDER:
			case QUICKBOOKS_OBJECT_TIMETRACKING:
			case QUICKBOOKS_OBJECT_SALESRECEIPT:
			case QUICKBOOKS_OBJECT_VENDORCREDIT:
			case QUICKBOOKS_OBJECT_JOURNALENTRY:
			case QUICKBOOKS_OBJECT_TRANSACTION:
			case QUICKBOOKS_OBJECT_ITEMRECEIPT:
			case QUICKBOOKS_OBJECT_CREDITMEMO:
			case QUICKBOOKS_OBJECT_SALESORDER:
			case QUICKBOOKS_OBJECT_BILLTOPAY:
			case QUICKBOOKS_OBJECT_ESTIMATE:
			case QUICKBOOKS_OBJECT_DEPOSIT:
			case QUICKBOOKS_OBJECT_INVOICE:
			case QUICKBOOKS_OBJECT_CHARGE:
			case QUICKBOOKS_OBJECT_CHECK:
			case QUICKBOOKS_OBJECT_BILL:
				return 'TxnID';
			case QUICKBOOKS_OBJECT_COMPANY:
				return 'CompanyName';
			default:
				return 'ListID';
		}
	}
static public function keyForObject($object)
	{
		// Make sure it's an object
		$object = QuickBooks_Utilities::actionToObject($object);
		
		switch ($object)
		{
			case QUICKBOOKS_OBJECT_BILLPAYMENTCREDITCARD:
			case QUICKBOOKS_OBJECT_INVENTORYADJUSTMENT:
			case QUICKBOOKS_OBJECT_BILLPAYMENTCHECK:
			case QUICKBOOKS_OBJECT_CREDITCARDCREDIT:
			case QUICKBOOKS_OBJECT_CREDITCARDCHARGE:
			case QUICKBOOKS_OBJECT_VEHICLEMILEAGE:
			case QUICKBOOKS_OBJECT_RECEIVEPAYMENT:
			case QUICKBOOKS_OBJECT_PURCHASEORDER:
			case QUICKBOOKS_OBJECT_TIMETRACKING:
			case QUICKBOOKS_OBJECT_SALESRECEIPT:
			case QUICKBOOKS_OBJECT_VENDORCREDIT:
			case QUICKBOOKS_OBJECT_JOURNALENTRY:
			case QUICKBOOKS_OBJECT_TRANSACTION:
			case QUICKBOOKS_OBJECT_ITEMRECEIPT:
			case QUICKBOOKS_OBJECT_CREDITMEMO:
			case QUICKBOOKS_OBJECT_SALESORDER:
			case QUICKBOOKS_OBJECT_BILLTOPAY:
			case QUICKBOOKS_OBJECT_ESTIMATE:
			case QUICKBOOKS_OBJECT_DEPOSIT:
			case QUICKBOOKS_OBJECT_INVOICE:
			case QUICKBOOKS_OBJECT_CHARGE:
			case QUICKBOOKS_OBJECT_CHECK:
			case QUICKBOOKS_OBJECT_BILL:
				return 'TxnID';
			case QUICKBOOKS_OBJECT_COMPANY:
				return 'CompanyName';
			default:
				return 'ListID';
		}
	}
Get the primary key within QuickBooks for this type of object (or this type of action)

<code>
// This prints "ListID"
print(QuickBooks_Utilities::keyForObject(QUICKBOOKS_OBJECT_CUSTOMER));

// This prints "TxnID"  (this method also works for actions)
print(QuickBooks_Utilities::keyForObject(QUICKBOOKS_ADD_INVOICE));
</code>

@param string $object		An object or action type
@return string