protected function getCouponFieldValue($fieldName, $data, $defaultValue = null)
    {
        if (isset($data[self::COUPON_DATASET_NAME][$fieldName])) {
            return $this->checkCouponFieldValue(
                $fieldName,
                $data[self::COUPON_DATASET_NAME][$fieldName]
            );
        } elseif (null !== $defaultValue) {
            return $defaultValue;
        } else {
            throw new \InvalidArgumentException(sprintf("The coupon field name %s was not found in the coupon form", $fieldName));
        }
    }
protected function getCouponFieldValue($fieldName, $data, $defaultValue = null)
    {
        if (isset($data[self::COUPON_DATASET_NAME][$fieldName])) {
            return $this->checkCouponFieldValue(
                $fieldName,
                $data[self::COUPON_DATASET_NAME][$fieldName]
            );
        } elseif (null !== $defaultValue) {
            return $defaultValue;
        } else {
            throw new \InvalidArgumentException(sprintf("The coupon field name %s was not found in the coupon form", $fieldName));
        }
    }
protected function getCouponFieldValue ( $ fieldName , $ data , $ defaultValue = null ) { if ( isset ( $ data [ self :: COUPON_DATASET_NAME ] [ $ fieldName ] ) ) { return $ this -> checkCouponFieldValue ( $ fieldName , $ data [ self :: COUPON_DATASET_NAME ] [ $ fieldName ] ) ; } elseif ( null !== $ defaultValue ) { return $ defaultValue ; } else { throw new \ InvalidArgumentException ( sprintf ( "The coupon field name %s was not found in the coupon form" , $ fieldName ) ) ; } }
A helper to get the value of a standard field name

@param string $fieldName    the field name
@param array  $data         the input form data (e.g. $form->getData())
@param mixed  $defaultValue the default value if the field is not found.

@return mixed the input value, or the default one

@throws \InvalidArgumentException if the field is not found, and no default value has been defined.
A helper to get the value of a standard field name