$v ) { if ( property_exists( $config_holder, $k ) ) { $config_holder->{$k} = $v; } elseif ( 'CRC_key' === $k ) { $config_holder->salt = $v; } elseif ( 'p24_testmod' === $k ) { $config_holder->p24_operation_mode = $v; } } return $config_holder; } /** * Get config for currency in object. * * @param string $currency The currency. * @return P24_Config_Accessor|null */ public static function load_settings( $currency ) { $common_options = get_option( self::OPTION_KEY_COMMON, array() ); if ( ! array_key_exists( 'enabled', $common_options ) ) { return null; } elseif ( 'yes' !== $common_options['enabled'] ) { return null; } $key = sprintf( self::OPTION_KEY_CURRENCY_TEMPLATE, $currency ); $array = get_option( $key, array() ); $config_holder = self::map_array_to_config_holder( $array ); return new P24_Config_Accessor( $currency, $config_holder ); } }