public function getServiceInstanceByGroup($group)
    {
        $services = [];
        $services_map = static::services();

        foreach ($this->getServiceInstances() as $name => $info) {
            if (!isset($info['type']) || !isset($info['instance'])) {
                continue;
            }
            $type = $info['type'];

            if (!isset($services_map[$type])) {
                continue;
            }
            $classname = $services_map[$type];

            if ($group !== $classname::group()) {
                continue;
            }
            $services[$name] = $info['instance'];
        }

        return $services;
    }
public function getServiceInstanceByGroup($group)
    {
        $services = [];
        $services_map = static::services();

        foreach ($this->getServiceInstances() as $name => $info) {
            if (!isset($info['type']) || !isset($info['instance'])) {
                continue;
            }
            $type = $info['type'];

            if (!isset($services_map[$type])) {
                continue;
            }
            $classname = $services_map[$type];

            if ($group !== $classname::group()) {
                continue;
            }
            $services[$name] = $info['instance'];
        }

        return $services;
    }
public function getServiceInstanceByGroup ( $ group ) { $ services = [ ] ; $ services_map = static :: services ( ) ; foreach ( $ this -> getServiceInstances ( ) as $ name => $ info ) { if ( ! isset ( $ info [ 'type' ] ) || ! isset ( $ info [ 'instance' ] ) ) { continue ; } $ type = $ info [ 'type' ] ; if ( ! isset ( $ services_map [ $ type ] ) ) { continue ; } $ classname = $ services_map [ $ type ] ; if ( $ group !== $ classname :: group ( ) ) { continue ; } $ services [ $ name ] = $ info [ 'instance' ] ; } return $ services ; }
Get service instance by group.

@param $group
The service group name.

@return array
Get service instance by group .