<?php

namespace App\System\Model;
use App\System\Basic\beModel;

class LanguageModel extends beModel {
    public $table = "be_languages";
    public $primary_key = "lid";
    //@ioncube.dk beEncrypt("be_diyocp","beGetLanguages") -> "850cdc9586ebf17991f0ac5c522a2b7d" RANDOM
    public static function beGetLanguages($select,$lid = 0){
        $languages = [];
        if($lid > 0){
            $languages = self::beSelect($select)->beWhere("lid",$lid)->beGet();
        }
        else{
            $languagelist = self::beSelect($select)->beWhere("lstatus",1)->beGetAll();
            foreach($languagelist as $language){
                $languages[$language["lid"]] = $language;
            }
        }
        return $languages;
    }
}

?>