public function getCustomerItemQuantity($code = null, $itemCode = null) {
		$subscription = $this->getCustomerSubscription($code);
		if (!$itemCode && count($subscription['items']) > 1) {
			throw new CheddarGetter_Response_Exception("This customer's subscription contains more than one item so you need to provide the code for the item you wish to get", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		$plan = $this->getCustomerPlan($code);
		if ($itemCode) {
			$item = $plan['items'][$itemCode];
			$itemQuantity = $subscription['items'][$itemCode];
		} else {
			$item = current($plan['items']);
			$itemQuantity = current($subscription['items']);
		}
		return array(
			'item' => $item,
			'quantity' => $itemQuantity
		);
	}
public function getCustomerItemQuantity($code = null, $itemCode = null) {
		$subscription = $this->getCustomerSubscription($code);
		if (!$itemCode && count($subscription['items']) > 1) {
			throw new CheddarGetter_Response_Exception("This customer's subscription contains more than one item so you need to provide the code for the item you wish to get", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		$plan = $this->getCustomerPlan($code);
		if ($itemCode) {
			$item = $plan['items'][$itemCode];
			$itemQuantity = $subscription['items'][$itemCode];
		} else {
			$item = current($plan['items']);
			$itemQuantity = current($subscription['items']);
		}
		return array(
			'item' => $item,
			'quantity' => $itemQuantity
		);
	}
public function getCustomerItemQuantity ( $ code = null , $ itemCode = null ) { $ subscription = $ this -> getCustomerSubscription ( $ code ) ; if ( ! $ itemCode && count ( $ subscription [ 'items' ] ) > 1 ) { throw new CheddarGetter_Response_Exception ( "This customer's subscription contains more than one item so you need to provide the code for the item you wish to get" , CheddarGetter_Response_Exception :: USAGE_INVALID ) ; } $ plan = $ this -> getCustomerPlan ( $ code ) ; if ( $ itemCode ) { $ item = $ plan [ 'items' ] [ $ itemCode ] ; $ itemQuantity = $ subscription [ 'items' ] [ $ itemCode ] ; } else { $ item = current ( $ plan [ 'items' ] ) ; $ itemQuantity = current ( $ subscription [ 'items' ] ) ; } return array ( 'item' => $ item , 'quantity' => $ itemQuantity ) ; }
Get an array of a customer's item quantity and quantity included

@param $code string your code for the plan - required if more than one plan is in the response
@param $itemCode your code for the item - required if more than one item is in the response
@throws CheddarGetter_Response_Exception if the response type is incompatible or if a $code is not provided and the response contains more than one customer or if a $itemCode is not provided and the plan contains more than one tracked item
@return array 2 keys: 'item' (item config for this plan) and 'quantity' the customer's current quantity usage
Get an array of a customer s item quantity and quantity included