src/Sulu/Component/Content/Compat/LocalizationFinder.php
private function findAvailableParentLocalization(array $availableLocales, Localization $localization)
    {
        do {
            if (in_array($localization->getLocale(), $availableLocales)) {
                return $localization;
            }

            // try to load parent and stop if there is no parent
            $localization = $localization->getParent();
        } while (null != $localization);

        return;
    }
private function findAvailableParentLocalization(array $availableLocales, Localization $localization)
    {
        do {
            if (in_array($localization->getLocale(), $availableLocales)) {
                return $localization;
            }

            // try to load parent and stop if there is no parent
            $localization = $localization->getParent();
        } while (null != $localization);

        return;
    }
private function findAvailableParentLocalization ( array $ availableLocales , Localization $ localization ) { do { if ( in_array ( $ localization -> getLocale ( ) , $ availableLocales ) ) { return $ localization ; } // try to load parent and stop if there is no parent $ localization = $ localization -> getParent ( ) ; } while ( null != $ localization ) ; return ; }
Finds the next available parent-localization in which the node has a translation.

@param string[] $availableLocales
@param Localization $localization The localization to start the search for

@return null|Localization
Finds the next available parent - localization in which the node has a translation .