{@inheritdoc}

@api

@param string $attributeCode Code of the attribute
@param string $code Code of the attribute option

@return array
178050
public function getAttributeOption($attributeCode, $code): array
    {
        return $this->getFactory()
            ->createAkeneoPimAdapterFactory()
            ->createAttributeOptionApiAdapter()
            ->get($attributeCode, $code);
    }
859297
public function getSubfieldsWithCode ($code)
    {
        return array_filter($this->_subfields, function (Subfield $s) use ($code) { return $s->getCode() == $code; });
    }
272377
public static function getHierarchySiblings($code)
    {
        if ($code === '') {
            return [];
        }

        $parent = static::getHierarchyParent($code);
        $hierarchyField = static::getHierarchyField();
        return static::query()->whereStartsWith($hierarchyField, $parent, strlen($code))->values($hierarchyField);
    }
180631
private function getZoneMemberByCode($code)
    {
        $zoneMember = $this->zoneMemberRepository->findOneBy(['code' => $code]);
        Assert::notNull(
            $zoneMember,
            sprintf('Zone member with code %s does not exist.', $code)
        );

        return $zoneMember;
    }
193029
public function get($code) {
		if (!$this->responses->has($code)) {
			$this->responses->set($code, new Response($code));
		}

		return $this->responses->get($code);
	}
724205
public function item($code)
    {
        if( empty(Properties::$items) )
        {
            return false;
        }

        foreach( Properties::$items as $row )
        {
            if( ! is_array($code) )
            {
                $key = array_search($code, $row);
            }
            else
            {
                if( isset($row[key($code)]) && $row[key($code)] == current($code) )
                {
                    $key = $row;
                }
            }

            if( ! empty($key) )
            {
                return (object) $row;
            }
        }
    }
864653
public static function countryLanguageCodes($countryCode)
    {
        $localeCodes = Locale::countryLocaleCodes($countryCode);

        $list = [];
        foreach ($localeCodes as $localeCode) {
            $list[] = Locale::languageCode($localeCode);
        }

        return $list;
    }
323176
public function getAuthorizationCode($code)
    {
        $code = $this->getObjectByType('code_table',$code);

        return is_null($code) ? false : $code;
    }
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);
    }
115687
public function getByCode($code)
    {
        if (\is_scalar($code) && ! empty($code = trim($this->uppercaseAndSafeTransliterate($code)))) {
            foreach ($this->items as $auto_category) {
                if ($auto_category->getCode() === $code) {
                    return $auto_category;
                }
            }
        }
    }
587077
public function get($code)
    {
        $result = null;
        $this->hook->attach('language.get.before', $code, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $list = $this->getList();
        $result = isset($list[$code]) ? $list[$code] : array();

        $this->hook->attach('language.get.after', $code, $result, $this);
        return (array) $result;
    }
169852
public function remove($attributeCode, $value, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $method = 'remove'.ucfirst($attributeCode);
        if (method_exists($this, $method)) {
            return $this->$method($value, $context);
        }

        return $this->removeValueData($attribute, $value, $context);
    }
891022
public function getConfigurationEntityFromCode($code)
    {
        $dbConfiguration = IndexEngineIndexQuery::create()->findOneByCode($code);

        if (null === $dbConfiguration) {
            throw new InvalidArgumentException(sprintf("The index configuration code '%s' doesn't exist", $code));
        }

        return $this->getConfigurationEntityFromPropelEntity($dbConfiguration);
    }
206353
public static function sortConfigOptions(array &$options, $attribute_code) {
    $sorted_options = [];

    $query = \Drupal::database()->select('taxonomy_term_field_data', 'ttfd');
    $query->fields('ttfd', ['tid', 'weight']);
    $query->join('taxonomy_term__field_sku_attribute_code', 'ttfsac', 'ttfsac.entity_id = ttfd.tid');
    $query->join('taxonomy_term__field_sku_option_id', 'ttfsoi', 'ttfsoi.entity_id = ttfd.tid');
    $query->fields('ttfsoi', ['field_sku_option_id_value']);
    $query->condition('ttfd.vid', ProductOptionsManager::PRODUCT_OPTIONS_VOCABULARY);
    $query->condition('ttfsac.field_sku_attribute_code_value', $attribute_code);
    $query->condition('ttfsoi.field_sku_option_id_value', array_keys($options), 'IN');
    $query->distinct();
    $query->orderBy('weight', 'ASC');
    $tids = $query->execute()->fetchAllAssoc('tid');

    foreach ($tids as $tid => $values) {
      $sorted_options[$values->field_sku_option_id_value] = $options[$values->field_sku_option_id_value];
    }

    return $sorted_options;
  }
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;
    }
705126
public function getTokens($code)
    {
        if (! $oauthConfig = $this->client->getConfig("oauth2")) {
            throw new \Exception('OAuth2 authorisation not registered');
        }

        $tokens = $this->executeCommand('GetAuthToken',
            array_merge((array) $oauthConfig, array(
                    'code' => $code
                )
            ));

        return $tokens;
    }
1183505
public function getClassReflections($code)
    {
        $result = [];
        foreach ($this->getClassNames($code) as $className) {
            $result[$className] = new \ReflectionClass($className);
        }
        return $result;
    }