src/Sulu/Bundle/ContactBundle/Contact/AbstractContactManager.php
public function setMainForCollection($arrayCollection)
    {
        if ($arrayCollection && !$arrayCollection->isEmpty() && !$this->hasMain($arrayCollection)) {
            $arrayCollection->first()->setMain(true);
        }
    }
public function setMainForCollection($arrayCollection)
    {
        if ($arrayCollection && !$arrayCollection->isEmpty() && !$this->hasMain($arrayCollection)) {
            $arrayCollection->first()->setMain(true);
        }
    }
public function setMainForCollection ( $ arrayCollection ) { if ( $ arrayCollection && ! $ arrayCollection -> isEmpty ( ) && ! $ this -> hasMain ( $ arrayCollection ) ) { $ arrayCollection -> first ( ) -> setMain ( true ) ; } }
sets the first element to main, if none is set.

@param $arrayCollection
sets the first element to main if none is set .