<?php


/**
 * Description of RDNS
 *
 * @author vitalii@modulesgarden.com
 */

namespace MGModule\DNSManager2\mgLibs\ModuleAPI;

use \MGModule\DNSManager2\mgLibs\custom\reverse\ReverseDNS;
use \MGModule\DNSManager2\models\custom\server\Repository as Repository2;


class ServerList extends Api
{
    
    public $data;
    
    

    public function get( )
    {
        $out = array();
        $servers = Repository2::factory()->get();
        foreach($servers as $server) {
            $out[] = array(
                'id' => $server->id,
                'name' => $server->name,
                'module' => $server->module,
                'status' => $server->status,
            );
        }
        
        return array('servers' => json_encode($out));
}
    
    
}
