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

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