public static function getByName(string $name, int $type = Search::ANY): string
    {
        self::loadData();
        $kbEntrys = self::getVariable($name);
        if (isset($kbEntrys->a)) {
            foreach ($kbEntrys->a as $kbEntry) {
                if ($type === Search::ANY) {
                    return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                } elseif ($type === Search::MYSQL) {
                    if ($kbEntry->t === Search::MYSQL) {
                        return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                    }
                } elseif ($type === Search::MARIADB) {
                    if ($kbEntry->t === Search::MARIADB) {
                        return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                    }
                }
            }
        }

        throw new KBException("$name does not exist for this type of documentation !");
    }
public static function getByName(string $name, int $type = Search::ANY): string
    {
        self::loadData();
        $kbEntrys = self::getVariable($name);
        if (isset($kbEntrys->a)) {
            foreach ($kbEntrys->a as $kbEntry) {
                if ($type === Search::ANY) {
                    return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                } elseif ($type === Search::MYSQL) {
                    if ($kbEntry->t === Search::MYSQL) {
                        return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                    }
                } elseif ($type === Search::MARIADB) {
                    if ($kbEntry->t === Search::MARIADB) {
                        return Search::$data->urls[$kbEntry->u]."#".$kbEntry->a;
                    }
                }
            }
        }

        throw new KBException("$name does not exist for this type of documentation !");
    }
public static function getByName ( string $ name , int $ type = Search :: ANY ) : string { self :: loadData ( ) ; $ kbEntrys = self :: getVariable ( $ name ) ; if ( isset ( $ kbEntrys -> a ) ) { foreach ( $ kbEntrys -> a as $ kbEntry ) { if ( $ type === Search :: ANY ) { return Search :: $ data -> urls [ $ kbEntry -> u ] . "#" . $ kbEntry -> a ; } elseif ( $ type === Search :: MYSQL ) { if ( $ kbEntry -> t === Search :: MYSQL ) { return Search :: $ data -> urls [ $ kbEntry -> u ] . "#" . $ kbEntry -> a ; } } elseif ( $ type === Search :: MARIADB ) { if ( $ kbEntry -> t === Search :: MARIADB ) { return Search :: $ data -> urls [ $ kbEntry -> u ] . "#" . $ kbEntry -> a ; } } } } throw new KBException ( "$name does not exist for this type of documentation !" ) ; }
get the first link to doc available

@param string $name Name of variable
@param int    $type (optional) Type of link Search::MYSQL/Search::MARIADB/Search::ANY
@return string
@throws KBException
get the first link to doc available