I got a function who gets all the labels out of the database and puts them into an array, but if I take the object to another function it will be NULL
private static $labels='blaat';
public function loadDatabaseLabels(){
$res=DB::query("SELECT * FROM labels");
$label_array=array();
while($row=mysqli_fetch_assoc($res)){
$label_array[$row['indicator']]=$row['text'];
}
$labels = new label();
$labels->labels=$label_array;
}
public function getLabel($indicator){
var_dump($labels->label);
}