ptut-vhost/build/api/module/ueController.php

45 lines
703 B
PHP
Raw Normal View History

<?php
/**
* Created by PhpStorm.
* User: lucas
* Date: 27/02/18
* Time: 16:19
*/
namespace api\module;
use database\core\Repo;
use database\repo\ue;
use error\core\Error;
use error\core\Err;
class ueController{
/* (1) Returns 1 or all UEs
*
* @code<String> [OPT] The UE code
*
* @return ues<array> The UE(s) data
*
---------------------------------------------------------*/
public static function get($args){
$code = null;
extract($args);
/* Get the ue repo */
/** @var ue $ue_repo */
$ue_repo = Repo::getRepo('ue');
/* (1) Get All ues or 1 by its code (if set) */
$fetched = $ue_repo->get($code);
/* (3) Return data */
return ['ues' => $fetched];
}
}