src/ServiceRuntime/Internal/XmlRoleEnvironmentDataDeserializer.php
private function _translateRoleInstances($instancesInfo)
    {
        $roleInstanceMap = [];

        $instances = Utilities::tryGetKeysChainValue(
            $instancesInfo,
            'Instances',
            'Instance'
        );

        if (!is_null($instances)) {
            if (array_key_exists('@attributes', $instances)) {
                $instances = [0 => $instances];
            }

            foreach ($instances as $instanceInfo) {
                $endpoints = $this->_translateRoleInstanceEndpoints(
                    $instanceInfo['Endpoints']['Endpoint']
                );

                $roleInstance = new RoleInstance(
                    $instanceInfo['@attributes']['id'],
                    $instanceInfo['@attributes']['faultDomain'],
                    $instanceInfo['@attributes']['updateDomain'],
                    $endpoints
                );

                $roleInstanceMap
                    [$instanceInfo['@attributes']['id']] = $roleInstance;
            }
        }

        return $roleInstanceMap;
    }
private function _translateRoleInstances($instancesInfo)
    {
        $roleInstanceMap = [];

        $instances = Utilities::tryGetKeysChainValue(
            $instancesInfo,
            'Instances',
            'Instance'
        );

        if (!is_null($instances)) {
            if (array_key_exists('@attributes', $instances)) {
                $instances = [0 => $instances];
            }

            foreach ($instances as $instanceInfo) {
                $endpoints = $this->_translateRoleInstanceEndpoints(
                    $instanceInfo['Endpoints']['Endpoint']
                );

                $roleInstance = new RoleInstance(
                    $instanceInfo['@attributes']['id'],
                    $instanceInfo['@attributes']['faultDomain'],
                    $instanceInfo['@attributes']['updateDomain'],
                    $endpoints
                );

                $roleInstanceMap
                    [$instanceInfo['@attributes']['id']] = $roleInstance;
            }
        }

        return $roleInstanceMap;
    }
private function _translateRoleInstances ( $ instancesInfo ) { $ roleInstanceMap = [ ] ; $ instances = Utilities :: tryGetKeysChainValue ( $ instancesInfo , 'Instances' , 'Instance' ) ; if ( ! is_null ( $ instances ) ) { if ( array_key_exists ( '@attributes' , $ instances ) ) { $ instances = [ 0 => $ instances ] ; } foreach ( $ instances as $ instanceInfo ) { $ endpoints = $ this -> _translateRoleInstanceEndpoints ( $ instanceInfo [ 'Endpoints' ] [ 'Endpoint' ] ) ; $ roleInstance = new RoleInstance ( $ instanceInfo [ '@attributes' ] [ 'id' ] , $ instanceInfo [ '@attributes' ] [ 'faultDomain' ] , $ instanceInfo [ '@attributes' ] [ 'updateDomain' ] , $ endpoints ) ; $ roleInstanceMap [ $ instanceInfo [ '@attributes' ] [ 'id' ] ] = $ roleInstance ; } } return $ roleInstanceMap ; }
Translates the role instances.

@param string $instancesInfo The instance info

@return RoleInstance[]
Translates the role instances .