@var string
@var string $code

@return int|null

@throws \marvin255\bxmigrate\migrate\Exception
340380
protected function UFGetIdByCode($entity, $code)
    {
        $rsData = CUserTypeEntity::GetList([], [
            'ENTITY_ID' => $entity,
            'FIELD_NAME' => $code,
        ]);
        if ($ob = $rsData->GetNext()) {
            return $ob['ID'];
        } else {
            return null;
        }
    }
1267400
protected function mapCodeToSeverity($code)
    {
        if (is_int($code) && $this->translator->translate('VAL:ERRLVL-'.$code)) {
            $severity = $this->translator->translate('VAL:ERRLVL-'.$code);
        } else {
             $severity = LogLevel::ERROR;
        }

        return $severity;
    }
929723
public function getIdByCode(string $code): int
    {
        // pokud existuje kod v
        if (isset($this->locales[$code]['id'])) {
            return $this->locales[$code]['id'];
        }
        // pokud existuje kod v aliasu
        if (isset($this->aliasLocale[$code])) {
            $this->locales[$this->aliasLocale[$code]]['id'];
        }
        // jinak pouzije defaultni jazyk
        return ($this->locales[$this->defaultLocale]['id'] ?? 0);
    }
788380
public static function getLanguageForCode($code)
    {
        $language = KlarnaLanguage::fromCode($code);

        if ($language === null) {
            throw new Klarna_UnknownLanguageException($code);
        }
        return $language;
    }
902130
public function sendError($code = 204, $vars = null)
    {
        static $errors = [];

        if (empty($errors)) {
            $errors = require(str_replace('Cli', 'Config', __DIR__) . DIRECTORY_SEPARATOR . 'Errors.php');
        }

        if (isset($errors[ $code ])) {
            $languageKey = $errors[ $code ];
        }

        $languageKey = strtoupper($code . '_' . $languageKey);

        $error = [
            'code'    => $code,
            'title'   => language()->getLine($languageKey . '_TITLE'),
            'message' => language()->getLine($languageKey . '_MESSAGE'),
        ];

        $this->statusCode = $code;
        $this->reasonPhrase = $error[ 'title' ];

        if (is_string($vars)) {
            $error[ 'message' ] = $vars;
        } elseif (is_array($vars)) {
            $error = array_merge($error, $vars);
        }

        $this->write(
            (new Format())
                ->setContextualClass(Format::DANGER)
                ->setString($error[ 'code' ] . ' - ' . $error[ 'title' ])
                ->setNewLinesAfter(1)
        );

        $this->write(
            (new Format())
                ->setString($error[ 'message' ])
                ->setNewLinesAfter(1)
        );

        exit(EXIT_ERROR);
    }
366722
public function get_string_from_code($code) {
		$errors = [
			self::ERR_GENERAL => 'General Error',
			self::ERR_BAD_REQUEST => 'Bad Request',
			self::ERR_UNAUTHORIZED => 'Unauthorized',
			self::ERR_FORBIDDEN => 'Forbidden',
			self::ERR_INTERNAL_ERROR => 'Internal Error',
			self::ERR_PRECONDITION_FAILED => 'Precondition Failed',
			self::ERR_RESOURCE_NOT_FOUND => 'Resource Not Found',
			self::ERR_INVALID_RESOURCE => 'Invalid Resource',
			self::ERR_NOT_IMPLEMENTED => 'Feature not implemented',
			self::ERR_DISABLED => 'Feature Disabled',
			self::ERR_NETWORKING_DISABLED => 'Networking is Disabled',
		];

		return (isset($errors[$code])) ? $errors[$code] : '';
	}
963741
public function execute($code = null) {

		if(null !== $code && false === ('-' . intval($code) == '-' . $code)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($code)), E_USER_ERROR);
		}

		$this -> setUrl();

		if(null !== $this -> seconds) {
			return Response :: addHeader('refresh', sprintf('%d;url=%s', $this -> seconds, $this -> url), $code);
		}

		Response :: addHeader('Location', $this -> url, $code);
	}
1271407
public static function __(string $code) : string
    {
        $t = self::getInstance();
        if (!isset($t->translations[$code])) {
            return $code;
        }
        return $t->translations[$code];
    }
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;

    }
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;
        }
    }
144945
public function getAttributeItem( $code )
	{
		$map = $this->_getAttributeMap();

		if( isset( $map[ $code ] ) ) {
			return $map[ $code ];
		}

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

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

        return null;
    }
560479
final private function checkExceptionOverride(int $code):int
    {
        if (file_exists(FEnv::get("framework.overrides")."Exceptions/views/$code".
                SmartyEngineTemplate::$viewExtention) &&
            FEnv::get("framework.env") == "prod") {
            return (1);
        }
        return (0);
    }
525999
public function exportGroup($code) {
        $item = $this->prepareExportGroup(
            $this->getGroup($code)
        );

        if (!empty($item['STRING_ID'])) {
            return $item;
        }

        $this->throwException(__METHOD__, 'code not found');
    }
59535
public function sendHttpCode($code = null)
    {
        if (func_num_args() == 0) {
            return $this->sendHttpCode;
        }

        if (!$code) {
            return $this->sendHttpCode = false;
        }

        if ($code === true) {
            $code = 500;
        }

        if ($code < 400 || 600 <= $code) {
            throw new InvalidArgumentException(
                 "Invalid status code '$code', must be 4xx or 5xx"
            );
        }

        return $this->sendHttpCode = $code;
    }
1114030
public static function getErrText($code)
    {
        if (isset(self::$errCode[$code])) {
            return self::$errCode[$code];
        }
        return false;
    }
1080536
public static function getMessageFromCode($code)
    {
        if (!array_key_exists($code, self::$responseCodes)) {
            throw new \Exception('The header code '.$code.' is not valid.');
        }

        return self::$responseCodes[$code];
    }