src/Core/Link.php
public static function loadLinkInfo($link_id)
    {
        global $CFG, $PDOX, $CONTEXT;

        $cacheloc = 'lti_link';
        $row = Cache::check($cacheloc, $link_id);
        if ( $row != false ) return $row;
        $stmt = $PDOX->queryDie(
            "SELECT title FROM {$CFG->dbprefix}lti_link
                WHERE link_id = :LID AND context_id = :CID",
            array(":LID" => $link_id, ":CID" => $CONTEXT->id)
        );
        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        Cache::set($cacheloc, $link_id, $row);
        return $row;
    }
public static function loadLinkInfo($link_id)
    {
        global $CFG, $PDOX, $CONTEXT;

        $cacheloc = 'lti_link';
        $row = Cache::check($cacheloc, $link_id);
        if ( $row != false ) return $row;
        $stmt = $PDOX->queryDie(
            "SELECT title FROM {$CFG->dbprefix}lti_link
                WHERE link_id = :LID AND context_id = :CID",
            array(":LID" => $link_id, ":CID" => $CONTEXT->id)
        );
        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        Cache::set($cacheloc, $link_id, $row);
        return $row;
    }
public static function loadLinkInfo ( $ link_id ) { global $ CFG , $ PDOX , $ CONTEXT ; $ cacheloc = 'lti_link' ; $ row = Cache :: check ( $ cacheloc , $ link_id ) ; if ( $ row != false ) return $ row ; $ stmt = $ PDOX -> queryDie ( "SELECT title FROM {$CFG->dbprefix}lti_link
                WHERE link_id = :LID AND context_id = :CID" , array ( ":LID" => $ link_id , ":CID" => $ CONTEXT -> id ) ) ; $ row = $ stmt -> fetch ( \ PDO :: FETCH_ASSOC ) ; Cache :: set ( $ cacheloc , $ link_id , $ row ) ; return $ row ; }
Load link information for a different link than current

Make sure not to cross Context silos.

Returns a row or false.
Load link information for a different link than current