Scalr\Api\Service\User\V1beta0\Controller\Roles::describeVariablesAction PHP Method

describeVariablesAction() public method

Gets the list of the available Global Variables of the role
public describeVariablesAction ( integer $roleId ) : array
$roleId integer
return array
    public function describeVariablesAction($roleId)
    {
        $this->checkScopedPermissions('ROLES', 'MANAGE');
        $this->getRole($roleId, true);
        $globalVar = $this->getVariableInstance();
        $list = $globalVar->getValues($roleId);
        $foundRows = count($list);
        /* @var $adapter GlobalVariableAdapter */
        $adapter = $this->adapter('globalVariable');
        $data = [];
        $list = array_slice($list, $this->getPageOffset(), $this->getMaxResults());
        foreach ($list as $var) {
            $item = $adapter->convertData($var);
            $data[] = $item;
        }
        return $this->resultList($data, $foundRows);
    }