public function getNetworks($user = null)
    {
        if ($user == null) {
            $user = $this->container->get('security.context')->getToken()->getUser();
        }
        if ($user === 'anon.') {
            return (array());
        }
        $perimeters = $user->getCustomer()->getPerimeters();

        if (count($perimeters) == 0) {
            throw new \Exception(
                $this->translator->trans(
                    'controller.default.navigation.no_networks',
                    array(),
                    'exceptions'
                )
            );
        }

        return $perimeters;
    }
public function getNetworks($user = null)
    {
        if ($user == null) {
            $user = $this->container->get('security.context')->getToken()->getUser();
        }
        if ($user === 'anon.') {
            return (array());
        }
        $perimeters = $user->getCustomer()->getPerimeters();

        if (count($perimeters) == 0) {
            throw new \Exception(
                $this->translator->trans(
                    'controller.default.navigation.no_networks',
                    array(),
                    'exceptions'
                )
            );
        }

        return $perimeters;
    }
public function getNetworks ( $ user = null ) { if ( $ user == null ) { $ user = $ this -> container -> get ( 'security.context' ) -> getToken ( ) -> getUser ( ) ; } if ( $ user === 'anon.' ) { return ( array ( ) ) ; } $ perimeters = $ user -> getCustomer ( ) -> getPerimeters ( ) ; if ( count ( $ perimeters ) == 0 ) { throw new \ Exception ( $ this -> translator -> trans ( 'controller.default.navigation.no_networks' , array ( ) , 'exceptions' ) ) ; } return $ perimeters ; }
Retrieve current user networks
Retrieve current user networks