<commit_before><?php
namespace Serverfireteam\Panel;

use Illuminate\Database\Eloquent\Model;

class Link extends Model {

    protected $fillable = ['url', 'display', 'show_menu'];

    protected $table = 'links';
    
    static $cache = [];
    public static function allCached($forceRefresh = false)
    {
        if (!isset(self::$cache['all']) || $forceRefresh) {
            self::$cache['all'] = Link::all();
        }
        return self::$cache['all'];
    }
    public static function returnUrls($forceRefresh = false) {
        if (!isset(self::$cache['all_urls']) || $forceRefresh) {
            $configs = Link::allCached($forceRefresh);
            self::$cache['all_urls'] =  $configs->pluck('url')->toArray();
        }
        return self::$cache['all_urls'];
    }
    public static function getMainUrls($forceRefresh = false){
        if (!isset(self::$cache['main_urls']) || $forceRefresh) {
            $configs = Link::where('main', '=', true)->get(['url']);
            self::$cache['main_urls'] = $configs->pluck('url')->toArray();
        }
        return self::$cache['main_urls'];
    }
    public function getAndSave($url, $label, $visibility){
        $this->url = $url;
        $this->display = $label;
        $this->show_menu = $visibility;
        $this->save();
    }
}<commit_msg>change function name in Link class<commit_after><?php
namespace Serverfireteam\Panel;

use Illuminate\Database\Eloquent\Model;

class Link extends Model {

    protected $fillable = ['url', 'display', 'show_menu'];

    protected $table = 'links';
    
    static $cache = [];
    public static function getAllLinks($forceRefresh = false) // allCached(
    {
        if (!isset(self::$cache['all']) || $forceRefresh) {
            self::$cache['all'] = Link::all();
        }
        return self::$cache['all'];
    }
    public static function getUrls($forceRefresh = false) // returnUrls(
    {
        if (!isset(self::$cache['all_urls']) || $forceRefresh) {
            $configs = Link::allCached($forceRefresh);
            self::$cache['all_urls'] =  $configs->pluck('url')->toArray();
        }
        return self::$cache['all_urls'];
    }
    public static function getMainUrls($forceRefresh = false)
    {
        if (!isset(self::$cache['main_urls']) || $forceRefresh) {
            $configs = Link::where('main', '=', true)->get(['url']);
            self::$cache['main_urls'] = $configs->pluck('url')->toArray();
        }
        return self::$cache['main_urls'];
    }
    public function addNewLink($url, $label, $visibility) // getAndSave(
    {
        $this->url = $url;
        $this->display = $label;
        $this->show_menu = $visibility;
        $this->save();
    }
}
{'fraction_non_alphanumeric': 0.1841328413284133, 'fraction_numerical': 0.0, 'mean_word_length': 2.8183098591549296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191738', 'n_tokens_mistral': 805, 'n_tokens_neox': 831, 'n_words': 152}