public static function getShortLink ($fullLink)
        {
            $prefix = 'http://' . SITE_SERVER_NAME . '/';

            $rsShortLink = \CBXShortUri::GetList (
                [],
                [
                    'URI' => $fullLink,
                ]
            );

            if ($shortLink = $rsShortLink->Fetch ())
            {
                return $prefix . $shortLink['SHORT_URI'];
            }

            $shortLink = \CBXShortUri::GenerateShortUri ();

            $id = \CBXShortUri::Add (
                [
                    'URI'       => $fullLink,
                    'SHORT_URI' => $shortLink,
                    'STATUS'    => '301',
                ]
            );

            if ($id)
            {
                return $prefix . $shortLink;
            }
        }
public static function getShortLink ($fullLink)
        {
            $prefix = 'http://' . SITE_SERVER_NAME . '/';

            $rsShortLink = \CBXShortUri::GetList (
                [],
                [
                    'URI' => $fullLink,
                ]
            );

            if ($shortLink = $rsShortLink->Fetch ())
            {
                return $prefix . $shortLink['SHORT_URI'];
            }

            $shortLink = \CBXShortUri::GenerateShortUri ();

            $id = \CBXShortUri::Add (
                [
                    'URI'       => $fullLink,
                    'SHORT_URI' => $shortLink,
                    'STATUS'    => '301',
                ]
            );

            if ($id)
            {
                return $prefix . $shortLink;
            }
        }
public static function getShortLink ( $ fullLink ) { $ prefix = 'http://' . SITE_SERVER_NAME . '/' ; $ rsShortLink = \ CBXShortUri :: GetList ( [ ] , [ 'URI' => $ fullLink , ] ) ; if ( $ shortLink = $ rsShortLink -> Fetch ( ) ) { return $ prefix . $ shortLink [ 'SHORT_URI' ] ; } $ shortLink = \ CBXShortUri :: GenerateShortUri ( ) ; $ id = \ CBXShortUri :: Add ( [ 'URI' => $ fullLink , 'SHORT_URI' => $ shortLink , 'STATUS' => '301' , ] ) ; if ( $ id ) { return $ prefix . $ shortLink ; } }
Returns short link

@param string $fullLink

@return string
Returns short link