Returns the product ID for the given code

@param string $code Product code
@param string|null $type Attribute type
@return string|null Product ID or null if not found
515359
public function get( $code, $type = null )
	{
		if( isset( $this->prodmap[$code] ) ) {
			return $this->prodmap[$code];
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

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

		$result = $manager->searchItems( $search );

		if( ( $item = reset( $result ) ) !== false )
		{
			$this->prodmap[$code] = $item->getId();
			return $this->prodmap[$code];
		}
	}
400547
public function setBarcode($code, $type) {
		$mode = explode(',', $type);
		switch (strtoupper($mode[0])) {
			case 'TEST': { // TEST MODE
				$this->barcode_array['num_rows'] = 5;
				$this->barcode_array['num_cols'] = 15;
				$this->barcode_array['bcode'] = array(
					array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1),
					array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0),
					array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0),
					array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0),
					array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0)
				);
				break;
			}
			default: {
				$this->barcode_array = false;
			}
		}
	}
393828
public static String getTypeCodeSignature(int typeCode) {
        String signature = Values.PRIMITIVE_TYPE_CODE_SIGS.get((byte) typeCode);
        return signature == null ? Values.SIG_JAVA_LANG_OBJECT : signature;
    }
1155898
private function retrieveProductTypeIdByKey($key)
    {
        if (!isset($this->productTypesMap[$key])) {
            return null;
        }

        return intval($this->productTypesMap[$key]);
    }
76232
protected function getTypeByCode($type)
    {
        switch ($type) {
            case self::BOOLEAN:
                return 'boolean';
            case self::INT:
                return 'int';
            case self::FLOAT:
                return 'float';
            case self::STRING:
                return 'string';
            case self::DATE:
                return 'date';
            case self::OBJECT:
                return 'object';
            case self::XML:
                return 'xml';
            case self::DATA:
                return 'data';
            case self::DATA_ARRAY:
                return 'array';

            default:
                return null;
        }
    }
186942
public CodeAttribute getCode()
  {
    for (int i = 0; i < _attributes.size(); i++) {
      Attribute attr = _attributes.get(i);

      if (attr instanceof CodeAttribute)
        return (CodeAttribute) attr;
    }

    return null;
  }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
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;
                }
            }
        }
    }
287466
public static function getDescription($code)
    {
        if (array_key_exists($code, self::$codes_to_string_map)) {
            return self::$codes_to_string_map[$code];
        } else {
            return false;
        }
    }
770425
public function get( $code, $type = null )
	{
		if( isset( $this->attributes[$code] ) && isset( $this->attributes[$code][$type] ) ) {
			return $this->attributes[$code][$type];
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' );

		$search = $manager->createSearch();
		$expr = array(
			$search->compare( '==', 'attribute.code', $code ),
			$search->compare( '==', 'attribute.type', $type ),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );

		$result = $manager->searchItems( $search );

		if( ( $item = reset( $result ) ) !== false )
		{
			$this->attributes[$code][$type] = $item;
			return $item;
		}
	}
86949
public function getManager($code)
    {
        if ($code instanceof ProductInterface) {
            $code = $this->getProductCode($code);

            if (!$code) {
                throw new \RuntimeException(sprintf('The class is not linked to a ProductManager!'));
            }
        }

        return $this->getProduct($code)->getManager();
    }
660137
public function getAuthorizationCode($code)
    {
        if (isset($this->authorizationCodes[$code])) {
            return $this->authorizationCodes[$code];
        }

        return null;
    }
563481
public function getAuthorizationCode($code)
    {
        $result = $this->client->getItem(array(
            "TableName"=> $this->config['code_table'],
            "Key" => array('authorization_code'   => array('S' => $code))
        ));
        if ($result->count()==0) {
            return false ;
        }
        $token = $this->dynamo2array($result);
        if (!array_key_exists("id_token", $token )) {
            $token['id_token'] = null;
        }
        $token['expires'] = strtotime($token['expires']);

        return $token;

    }
432075
public static function getCodeName( $typeCode )
	{
		// Maybe this should be: XmlTypeCode::$codeToTypeMap[ $typeCode ];
		$oClass = new \ReflectionClass( __CLASS__ );
		foreach ( $oClass->getConstants() as $key => $value )
		{
			if ( $value == $typeCode ) return $key;
		}

		return false;
	}
457435
public function loadAmastyGiftCard($code)
    {
        try {
            if (!$this->isAmastyGiftCardAvailable()) {
                return null;
            }

            $accountModel = $this->amastyAccountFactory->getInstance()
                ->create()
                ->loadByCode($code);
            return $accountModel && $accountModel->getId() ? $accountModel : null;
        } catch (\Exception $e) {
            return null;
        }
    }
1033806
private function getScopeIdByScopeCode($scopeType, $scopeCode)
    {
        $scopeId = 0;

        $scopesByCode = $this->getScopesByCode($scopeType);

        if (isset($scopesByCode[$scopeCode])) {
            $scope = $scopesByCode[$scopeCode];
            $scopeId = $scope->getId();
        }

        return $scopeId;
    }
841416
protected function UserGetGroupIdByCode($code)
    {
        $rsGroups = CGroup::GetList(($by = 'c_sort'), ($order = 'desc'), [
            'STRING_ID' => $code,
        ]);
        if ($ob = $rsGroups->Fetch()) {
            return $ob['ID'];
        } else {
            return null;
        }
    }