Получает группу пользователей
@param $code int|string - id или код группы
@return array|bool
431722
public function getGroup($code) {
        $groupId = is_numeric($code) ? $code : \CGroup::GetIDByCode($code);

        if (empty($groupId)) {
            return false;
        }

        /* extract SECURITY_POLICY */
        $item = \CGroup::GetByID($groupId)->Fetch();
        if (empty($item)) {
            return false;
        }

        if (!empty($item['SECURITY_POLICY'])) {
            $item['SECURITY_POLICY'] = unserialize($item['SECURITY_POLICY']);
        }

        if ($item['ID'] == 1) {
            $item['STRING_ID'] = 'administrators';
        } elseif ($item['ID'] == 2) {
            $item['STRING_ID'] = 'everyone';
        }

        return $item;

    }
1271407
public static function __(string $code) : string
    {
        $t = self::getInstance();
        if (!isset($t->translations[$code])) {
            return $code;
        }
        return $t->translations[$code];
    }
1102935
protected function getStockItems( $code )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'stock' );

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

		return $manager->searchItems( $search );
	}
423441
public static function getReasonPhraseByCode($code)
    {
        if (isset(self::$codesDescription[$code])) {
            return self::$codesDescription[$code];
        }

        $group = self::getGroupFromCode($code);

        return self::getReasonPhraseByGroup($group);
    }
355719
protected function getTokenFields(string $code)
    {
        return [
            'client_id' => $this->clientId,
            'client_secret' => $this->clientSecret,
            'code' => $code,
            'redirect_uri' => $this->redirectUrl,
        ];
    }
923598
protected function checksum($code)
	{
		$chars = [
			'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
			'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
			'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
			'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'
		];

		$sum = 0;
		$clen = strlen($code);

		for ($i = 0; $i < $clen; ++$i) {
			$k = array_keys($chars, $code[$i]);
			$sum += $k[0];
		}

		$j = ($sum % 43);

		return $chars[$j];
	}
585766
protected function applyHandlersToCode($code) {
		foreach($this->codeCallbackHandlers as $callback) {
			call_user_func_array($callback, array(&$code));
		}
		return $code;
	}
749153
protected function friendlyServiceName($code)
    {
        $id = intval($code);
        $services = [
            intval(Service::PAC) => 'PAC',
            intval(Service::PAC_CONTRATO) => 'PAC',
            intval(Service::PAC_CONTRATO_04812) => 'PAC',
            intval(Service::PAC_CONTRATO_41068) => 'PAC',
            intval(Service::PAC_CONTRATO_41211) => 'PAC',
            intval(Service::SEDEX) => 'Sedex',
            intval(Service::SEDEX_CONTRATO) => 'Sedex',
            intval(Service::SEDEX_A_COBRAR) => 'Sedex a Cobrar',
            intval(Service::SEDEX_10) => 'Sedex 10',
            intval(Service::SEDEX_HOJE) => 'Sedex Hoje',
            intval(Service::SEDEX_CONTRATO_04316) => 'Sedex',
            intval(Service::SEDEX_CONTRATO_40096) => 'Sedex',
            intval(Service::SEDEX_CONTRATO_40436) => 'Sedex',
            intval(Service::SEDEX_CONTRATO_40444) => 'Sedex',
            intval(Service::SEDEX_CONTRATO_40568) => 'Sedex',
        ];

        if (array_key_exists($id, $services)) {
            return $services[$id];
        }

        return null;
    }
1287303
public function getCountryFromCode($code)
    {
        $code = strtoupper($code);
        $output = "Other";
        if (in_array($code, $this->countriesMapping)) {
            foreach ($this->countriesMapping as $country => $short) {
                if ($code == $short) {
                    $output = $country;
                    break;
                }
            }
        }

        return $output;
    }
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],
		];
	}
1226396
public static function codeToCollection(string $code) {
		$tokens = token_get_all($code);
		//prr($tokens,1,1);
		$tokenCollection = [];
		foreach($tokens as $token) {
			$entity = new TokenEntity();
			if(is_array($token)) {
				$entity->type = $token[0];
				$entity->value = $token[1];
				$entity->line = $token[2];
			} else {
				$entity->type = 0;
				$entity->value = $token;
				//$entity->line = $token[2];
			}
			$tokenCollection[] = $entity;
		}
		return $tokenCollection;
	}
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;
            }
        }
    }
568206
static public function getLabel($code)
    {
        static::isValid($code);

        switch ($code) {
            case static::EBP :
                return 'Euro Business Parcel';
            case static::GBP :
                return 'Global Business Parcel';
            case static::EP :
                return 'Express Parcel Guaranteed';
            case static::SHD :
                return 'Shop Delivery Service';
            case static::FDF :
                return 'Flex Delivery Service';
            case static::BP :
            default:
                return 'Business Parcel';
        }
    }
537605
protected function _getProductItem( $code )
	{
		$productManager = MShop_Factory::createManager( $this->_getContext(), 'product' );

		$search = $productManager->createSearch( true );
		$expr = array(
			$search->compare( '==', 'product.code', $code ),
			$search->getConditions(),
		);
		$search->setConditions( $search->combine( '&&', $expr ) );

		$result = $productManager->searchItems( $search, array( 'price', 'text' ) );

		if( ( $productItem = reset( $result ) ) === false )
		{
			$msg = sprintf( 'No product with code "%1$s" found', $code );
			throw new Controller_Frontend_Basket_Exception( $msg );
		}

		return $productItem;
	}
1279713
public function check($code)
    {
        $promocode = Promocode::byCode($code)->first();

        if ($promocode === null) {
            throw new InvalidPromocodeException;
        }

        if ($promocode->isExpired() || ($promocode->isDisposable() && $promocode->users()->exists())) {
            return false;
        }

        return $promocode;
    }
536078
public function find( $code )
	{
		return $this->manager->findItem( $code, $this->domains, 'product', null, true );
	}
76902
public function item($code) : Bool
    {
        if( empty(Properties::$items) )
        {
            return false;
        }

        $i = 0;

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

            $key = array_search($code, $row);

            if( ! empty($key) )
            {
                array_splice(Properties::$items, $i--, 1);
            }

            $i++;
        }

        return $this->driver->insert($this->key, Properties::$items);
    }