public function getCustomer($code = null) {
		if ($this->getResponseType() != 'customers') {
			throw new CheddarGetter_Response_Exception("Can't get a customer from a response doc that isn't of type 'customers'", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		if (!$code && $this->getElementsByTagName('customer')->length > 1) {
			throw new CheddarGetter_Response_Exception("This response contains more than one customer so you need to provide the code for the customer you wish to get", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		if (!$code) {
			return current($this->toArray());
		}
		$array = $this->toArray();
		return $array[$code];
	}
public function getCustomer($code = null) {
		if ($this->getResponseType() != 'customers') {
			throw new CheddarGetter_Response_Exception("Can't get a customer from a response doc that isn't of type 'customers'", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		if (!$code && $this->getElementsByTagName('customer')->length > 1) {
			throw new CheddarGetter_Response_Exception("This response contains more than one customer so you need to provide the code for the customer you wish to get", CheddarGetter_Response_Exception::USAGE_INVALID);
		}
		if (!$code) {
			return current($this->toArray());
		}
		$array = $this->toArray();
		return $array[$code];
	}
public function getCustomer ( $ code = null ) { if ( $ this -> getResponseType ( ) != 'customers' ) { throw new CheddarGetter_Response_Exception ( "Can't get a customer from a response doc that isn't of type 'customers'" , CheddarGetter_Response_Exception :: USAGE_INVALID ) ; } if ( ! $ code && $ this -> getElementsByTagName ( 'customer' ) -> length > 1 ) { throw new CheddarGetter_Response_Exception ( "This response contains more than one customer so you need to provide the code for the customer you wish to get" , CheddarGetter_Response_Exception :: USAGE_INVALID ) ; } if ( ! $ code ) { return current ( $ this -> toArray ( ) ) ; } $ array = $ this -> toArray ( ) ; return $ array [ $ code ] ; }
Get an array representation of a single customer node

@param $code string your code for the customer - required if more than one customer 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
@return array
Get an array representation of a single customer node