@param string $code

@return null|AttributeValue
333592
public function getFirstValueByAttributeCode(string $code)
    {
        $attribute = $this->getAttributeByCode($code);
        if (is_null($attribute)) {
            return null;
        }

        if (empty($value = reset($attribute->values))) {
            return null;
        }

        return $value;
    }
65946
public static function getMessageByCode($code)
    {
        return isset(self::$_httpCodes[$code]) ? self::$_httpCodes[$code] : null;
    }
1190035
protected function getVerificationCode($code)
    {
        // Trim Code:
        
        $code = trim($code);
        
        // Detect HTML:
        
        if (stripos($code, '<meta') === 0) {
            
            // Extract Verification Code:
            
            preg_match('/content="(.+)"/', $code, $matches);
            
            // Update or Nullify:
            
            $code = isset($matches[1]) ? $matches[1] : null;
            
        }
        
        // Answer Code:
        
        return $code;
    }
998806
public static function findMainCode($codes)
    {
        foreach (static::mainCodes() as $code) {
            if (in_array($code, $codes)) {
                return $code;
            }
        }

        return null;
    }
835440
public function getChildrenValue($code, $row = [])
    {
        $number = $this->getChildrenColumnNumber($code);

        if ($number !== null)
        {
            return $row[$number];
        }

        return null;
    }
1194895
public function getByCode($code)
    {
        return $this->languages->filter(
            function ($language) use ($code) {
                return $language->code == $code;
            }
        )->first();
    }
698821
protected function &getAttributeValue(string $key)
    {
        if (isset($this->attributes[$key])) {

            return $this->attributes[ $key ];
        }

        $null = null;

        return $null;
    }
1070810
protected function getAttributeItem( $code, $type )
	{
		if( ( $item = $this->cache->get( $code, $type ) ) === null )
		{
			$manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' );

			$item = $manager->createItem();
			$item->setType( $type );
			$item->setDomain( 'product' );
			$item->setLabel( $code );
			$item->setCode( $code );
			$item->setStatus( 1 );

			$item = $manager->saveItem( $item );

			$this->cache->set( $item );
		}

		return $item;
	}
192260
protected function getLogLevel($code = null)
    {
        switch ($code) {
            case E_STRICT:
            case E_DEPRECATED:
            case E_USER_DEPRECATED:
                return LogLevel::INFO;
            
            case E_NOTICE:
            case E_USER_NOTICE:
                return LogLevel::NOTICE;
                
            case E_WARNING:
            case E_CORE_WARNING:
            case E_COMPILE_WARNING:
            case E_USER_WARNING:
                return LogLevel::WARNING;
            
            case E_PARSE:
            case E_CORE_ERROR:
            case E_COMPILE_ERROR:
                return LogLevel::CRITICAL;
            
            default:
                return LogLevel::ERROR;
        }
    }
108637
public function filter($code)
    {
        $elements = (array) $this->elements($code);

        foreach ((array) $elements as $element)
        {
            $original = (string) $element->nodeValue;

            $minified = $this->minify($original);

            $minified = preg_replace('/\s+/', ' ', $minified);

            $minified = $this->minify($minified);

            $code = str_replace($original, $minified, $code);
        }

        return $code;
    }
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;
    }
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;
                }
            }
        }
    }
1178415
def get_attribute(self, code, default=None):
        """"""
        try:
            return self.get(code=code).value
        except models.ObjectDoesNotExist:
            return default
882490
public function findByCode($code)
    {
        try {
            $qb = $this->createQueryBuilder('currency')
                ->andWhere('currency.code = :currencyCode')
                ->setParameter('currencyCode', $code);

            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
1073016
public function getSectionType($section, $code)
    {
        if (!isset($this->types[$section])) {
            return null;
        }

        $types = array_filter(
            $this->types[$section],
            function (ImageType $item) use ($code) {
                return strtolower($code) === strtolower($item->getCode());
            }
        );

        return array_values($types)[0];
    }
706350
public function getFieldByCode($code)
    {
        foreach ($this->_fields as $field) {
            if ($field instanceof FieldInterface) {
                if ($field->getCode() == $code) {
                    return $field;
                }
            }
        }

        return null;
    }
755738
protected function getAttributeValue($key)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }

        return null;
    }