Returns the request configuration for the given product code.

@param string $code

@return array
543616
static public function getRequestConfig($code = Service::BP)
    {
        Service::isValid($code);

        $config = [
            static::T540  => ['Date expédition format AAAAMMJJ', true, 8],
            static::T530  => ['Poids format xx.xx', true, 5],
            static::T860  => ['Raison sociale destinataire', true, 35],
            static::T863  => ['Rue destinataire', true, 35],
            static::T861  => ['Complément 1 adresse destinataire', false, 35],
            static::T862  => ['Complément 2 adresse destinataire', false, 35],
            static::T330  => ['Code postal destinataire', true, 10],
            static::T864  => ['Ville Destinataire', true, 35],
            static::T100  => ['Pays Destinataire', true, 2],
            static::T8906 => ['Commentaires', false, 35],
            static::T871  => ['Téléphone Destinataire', false, 20],
            static::T859  => ['Votre référence destinataire', false, 20],
            static::T854  => ['Référence supplémentaire 1', false, 20],
            static::T8908 => ['Référence supplémentaire 2', false, 20],
            static::T1229 => ['Email destinataire', false, 100],
            static::T1230 => ['Portable', false, 20],
            static::T810  => ['Raison sociale Expéditeur', true, 35],
            static::T820  => ['Adresse expéditeur', true, 35],
            static::T821  => ['Pays Expéditeur', true, 2],
            static::T822  => ['Code postal Expéditeur', true, 10],
            static::T823  => ['Ville Expéditeur', true, 35],
            static::T8700 => ['Dépôt GLS Expéditeur', true, 6],
            static::T8915 => ['Code client GLS', true, 10],
            static::T8914 => ['Contact Id (compte sur lequel va être affecté le colis)', true, 10],
            static::T8904 => ['Quantième colis dans Expédition (présent sur l’étiquette physiquement)', true, 3],
            static::T8973 => ['Quantième colis dans Expédition (présent dans le code barre datamatrix)', true, 3],
            static::T8905 => ['Nombre total colis Expédition (présent sur l’étiquette physiquement)', true, 3],
            static::T8702 => ['Nombre total colis Expédition (présent dans le code barre datamatrix)', true, 3],
            static::T8975 => ['Référence Origine GLS', true, 1024],
            static::T082  => ['Constante : UNIQUENO Transmettre cette valeur que si le destinataire est en France', true, 1042],
            static::T090  => ['Constante : NOSAVE ', true, 1042],
        ];

        if ($code === Service::EBP) {
            // Spécificités livraisons Shop Delivery Service
            $config = array_replace($config, [
                static::T200  => ['Service Shod Delivery ("SHD")', true, 3],
                static::T750  => ['Libellé service ("ShopDelivery-Service")', true, 1024],
                static::T1229 => ['Adresse Email Destinataire', true, 100],
                static::T1230 => ['Tél mobile Destinataire', true, 20],
                static::T8237 => ['Identifiant Point relais', true, 10],
                static::T8904 => ['Quantième colis dans Expédition ("1")', true, 3],
                static::T8973 => ['Quantième colis dans Expédition ("1")', true, 3],
                static::T8905 => ['Nombre total colis Expédition ("1")', true, 3],
                static::T8702 => ['Nombre total colis Expédition ("1")', true, 3],
            ]);
        } else if ($code === Service::EP) {
            // Spécificités livraison Express Parcel Guaranteed
            $config = array_replace($config, [
                static::T200  => ['13:00 service ("T13")', true, 3],
                static::T206  => ['Produit Express Parcel Guaranteed ("EP")', true, 1024],
                static::T8904 => ['Quantième colis dans Expédition ("1")', true, 3],
                static::T8973 => ['Quantième colis dans Expédition ("1")', true, 3],
                static::T8905 => ['Nombre total colis Expédition ("1")', true, 3],
                static::T8702 => ['Nombre total colis Expédition ("1")', true, 3],
            ]);
        } else if ($code === Service::FDF) {
            // Spécificités livraison Flex Delivery Service
            $config = array_replace($config, [
                static::T200  => ['Service Flex Delivery Service ("FDF")', true, 3],
                static::T750  => ['Libellé service  ("Flex Delivery Service")', true, 1024],
                static::T1229 => ['Adresse Email Destinataire', true, 100],
                static::T1230 => ['Tél mobile Destinataire', true, 20],
            ]);
        }

        return $config;
    }
504808
private function getFuzzinessConfiguration($scopeCode)
    {
        $path = self::FUZZINESS_CONFIG_XML_PREFIX;

        $configuration = (bool) $this->getConfigValue($path . "/enable", $scopeCode);

        if ($configuration === true) {
            $configurationParams = [
                'value'        => $this->getConfigValue($path . "/value", $scopeCode),
                'prefixLength' => $this->getConfigValue($path . "/prefix_length", $scopeCode),
                'maxExpansion' => $this->getConfigValue($path . "/max_expansion", $scopeCode),
            ];

            $configuration = $this->createFuzzinessConfiguration($configurationParams);
        }

        return $configuration === false ? null : $configuration;
    }
138165
private static function parseRegion($code)
    {
        $lang = substr($code, 0, 2);
        $reg =  strtoupper(substr($code, 3, 2));
        $needle = "{$lang}-{$reg}";
        foreach (self::codes() as $code) {
            if ($code['code'] == $needle) {
                return [$reg, $code['description']];
            }
        }

        throw new UnknownLanguageCodeException(
            "The region code '{$code}'' is unknown."
        );
    }
630152
public function getByRegistrationToken($code)
    {
        $builder = $this->createQueryBuilder('u');

        return $builder
            ->where('u.registrationConfirmToken.id=:code')
            ->andWhere($builder->expr()->isNotNull('u.registrationConfirmToken.id'))
            ->setParameter('code', $code)
            ->setMaxResults(1)
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
206635
protected function getProducts( array $codes, array $domains )
	{
		$result = [];
		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.code', $codes ) );
		$search->setSlice( 0, count( $codes ) );

		foreach( $manager->searchItems( $search, $domains ) as $item ) {
			$result[$item->getCode()] = $item;
		}

		return $result;
	}
704602
protected function _getListTypeItem( $code )
	{
		$manager = MShop_Factory::createManager( $this->_getContext(), 'customer/list/type' );

		$search = $manager->createSearch( true );
		$search->setConditions( $search->compare( '==', 'customer.list.type.code', $code ) );
		$result = $manager->searchItems( $search );

		if( ( $item = reset( $result ) ) === false ) {
			throw new Controller_Jobs_Exception( sprintf( 'List type for domain "%1$s" and code "%2$s" not found', 'customer', $code ) );
		}

		return $item;
	}
125944
public function getAuthorizationCode($code)
    {
        if (!isset($this->authorizationCodes[$code])) {
            return false;
        }

        return array_merge(array(
            'authorization_code' => $code,
        ), $this->authorizationCodes[$code]);
    }
1194895
public function getByCode($code)
    {
        return $this->languages->filter(
            function ($language) use ($code) {
                return $language->code == $code;
            }
        )->first();
    }
536078
public function find( $code )
	{
		return $this->manager->findItem( $code, $this->domains, 'product', null, true );
	}
1332640
final public static function get_header_string(int $code) {
		if (!isset(self::$header_string[$code]))
			$code = 404;
		return [
			'code' => $code,
			'msg'  => self::$header_string[$code],
		];
	}
484287
protected function getGroupFormFieldConfig($code)
    {
        if (!$code) {
            return null;
        }

        $fields = array_get($this->groupDefinitions, $code.'.fields');

        if (!$fields) {
            return null;
        }

        return ['fields' => $fields];
    }
1100115
public static function authorize($code)
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return false;
        }

        $url = self::$clef_base_url."authorize";

        $postdata = http_build_query(array(
            'code'       => $code,
            'app_id'     => $config['app_id'],
            'app_secret' => $config['app_secret']
        ));

        $opts = array('http' => array(
            'method'  => 'POST',
            'header'  => 'Content-type: application/x-www-form-urlencoded',
            'content' => $postdata
        ));

        // get oauth code for the handshake
        $context  = stream_context_create($opts);
        $response = file_get_contents($url, false, $context);

        if ($response) {
            $response = json_decode($response, true);

            return $response;
        }

        return false;
    }
1366305
public function getFeatureByCode($code)
    {
        $feature = $this->features()->getEager()->first(function($item) use ($code) {
            return $item->code === $code;
        });

        if (is_null($feature)) {
            throw new InvalidPlanFeatureException($code);
        }

        return $feature;
    }
81791
public function tokenExchange($code)
        {
            $parameters = array(
                'client_id'     => $this->clientId,
                'client_secret' => $this->clientSecret,
                'code'          => $code,
            );

            return $this->request(
                $this->authUrl . 'token',
                $parameters
            );
        }
1343239
public static function get($code)
    {
        try {
            return static::getByAlpha2($code);
        } catch (OutOfBoundsException $e) {
            try {
                return static::getByAlpha3($code);
            } catch (OutOfBoundsException $e) {
                try {
                    return static::getByNumeric3($code);
                } catch (OutOfBoundsException $e) {
                    throw new OutOfBoundsException("The code \"{$code}\" is not listed in ISO 4217");
                }
            }
        }
    }
1224436
public function withCode($code)
    {
        $url = Config::get('url.login_with_code');
        $cookie = $this->getCookieOrNew();

        $param['__VIEWSTATE'] = true;
        $param['txtUserName'] = $this->username;
        $param['TextBox2'] = $this->password;
        $param['txtSecretCode'] = $code;
        $param['RadioButtonList1'] = '学生';
        $param['Button1'] = '';

        $response = $this->request('post', [$url, $param, ['cookies' => $cookie]]);
        $body = (string)$response->getBody();
        // Login success
        if (preg_match("/xs_main/", $body)) {
            return $cookie;
        }
        // Get the error
        $content = mb_convert_encoding($body, "utf-8", "gb2312");
        if (preg_match('/alert\((.*?)\)/', $content, $matches)) {
            throw new HttpException(trim($matches[1], '\'"'), 10004);
        }

        throw new HttpException("login failed!", 10003);
    }
65946
public static function getMessageByCode($code)
    {
        return isset(self::$_httpCodes[$code]) ? self::$_httpCodes[$code] : null;
    }