src/Sulu/Bundle/ContactBundle/Contact/AbstractContactManager.php
public function unsetMain($arrayCollection)
    {
        if ($arrayCollection && !$arrayCollection->isEmpty()) {
            return $arrayCollection->forAll(
                function($index, $entry) {
                    if (true === $entry->getMain()) {
                        $entry->setMain(false);

                        return false;
                    }

                    return true;
                }
            );
        }
    }
public function unsetMain($arrayCollection)
    {
        if ($arrayCollection && !$arrayCollection->isEmpty()) {
            return $arrayCollection->forAll(
                function($index, $entry) {
                    if (true === $entry->getMain()) {
                        $entry->setMain(false);

                        return false;
                    }

                    return true;
                }
            );
        }
    }
public function unsetMain ( $ arrayCollection ) { if ( $ arrayCollection && ! $ arrayCollection -> isEmpty ( ) ) { return $ arrayCollection -> forAll ( function ( $ index , $ entry ) { if ( true === $ entry -> getMain ( ) ) { $ entry -> setMain ( false ) ; return false ; } return true ; } ) ; } }
unsets main of all elements of an ArrayCollection | PersistanceCollection.

@param $arrayCollection

@return bool returns true if a element was unset
unsets main of all elements of an ArrayCollection | PersistanceCollection .