UE code * * @return groups The list of groups for this UE * ---------------------------------------------------------*/ public static function get($args){ $code = ""; extract($args); /* Get the td repo */ /** @var td $td_repo */ $td_repo = Repo::getRepo('td'); /* (1) Try to fetch data */ $fetched = $td_repo->getGroups($code); /* (2) Manage error */ if( is_null($fetched) || !is_array($fetched) ) return ['error' => new Error(Err::RepoError)]; /* (3) Parse JSON list */ foreach($fetched as $f=>$v) $fetched[$f]['formations'] = json_decode($v['formations']); return ['groups' => $fetched]; } }