Form/Type/CenterType.php
private function prepareReachableCenterByUser()
    {
        $groupCenters = $this->user->getGroupCenters();
        
        foreach ($groupCenters as $groupCenter) {
            
            $center = $groupCenter->getCenter();
            
            if (!array_key_exists($center->getId(), 
                    $this->reachableCenters)) {
                $this->reachableCenters[$center->getId()] = $center;
            }
        }
    }
private function prepareReachableCenterByUser()
    {
        $groupCenters = $this->user->getGroupCenters();
        
        foreach ($groupCenters as $groupCenter) {
            
            $center = $groupCenter->getCenter();
            
            if (!array_key_exists($center->getId(), 
                    $this->reachableCenters)) {
                $this->reachableCenters[$center->getId()] = $center;
            }
        }
    }
private function prepareReachableCenterByUser ( ) { $ groupCenters = $ this -> user -> getGroupCenters ( ) ; foreach ( $ groupCenters as $ groupCenter ) { $ center = $ groupCenter -> getCenter ( ) ; if ( ! array_key_exists ( $ center -> getId ( ) , $ this -> reachableCenters ) ) { $ this -> reachableCenters [ $ center -> getId ( ) ] = $ center ; } } }
populate reachableCenters as an associative array where
keys are center.id and value are center entities.
populate reachableCenters as an associative array where keys are center . id and value are center entities .