<?php
namespace App\Controllers;
use Config\Services;

class Getpluglocalrefs extends BaseController{
    private $dbHandle;

    public function index(){
        $this->dbHandle   = \Config\Database::connect();
        $dataToReturn = [];

        $R = $this->dbHandle->table('pluglocalrefs')->select('localref')->get();
        $A = $R->getResultArray();
        if(sizeof($A)>0){
            $dataToReturn['status'] = 0;
            $dataToReturn['load'] = $A;
        }else{
            $dataToReturn['status'] = 1;
        }

        return json_encode($dataToReturn, JSON_HEX_APOS | JSON_HEX_QUOT);
    }
}