src/Model/Page.php
public function getRecursiveTranslations(&$translationsArray)
    {
        // find all possible translations
        if (!$this->getTranslations()->isEmpty()) {
            foreach ($this->getTranslations() as $translation) {
                if ($translation) {
                    // if we already meet you stop and go on with the next
                    $translationsArray[$translation->getLocale()] = $translation;
                    $translation->getRecursiveTranslations($translationsArray);
                }
            }
        }

        // find all possible originals
        if (!$this->getOriginals()->isEmpty()) {
            foreach ($this->getOriginals() as $translation) {
                // if we already meet you stop and go on with the next
                if (array_key_exists($translation->getLocale(), $translationsArray)) {
                    return;
                }
                $translationsArray[$translation->getLocale()] = $translation;
                $translation->getRecursiveTranslations($translationsArray);
            }
        }
    }
public function getRecursiveTranslations(&$translationsArray)
    {
        // find all possible translations
        if (!$this->getTranslations()->isEmpty()) {
            foreach ($this->getTranslations() as $translation) {
                if ($translation) {
                    // if we already meet you stop and go on with the next
                    $translationsArray[$translation->getLocale()] = $translation;
                    $translation->getRecursiveTranslations($translationsArray);
                }
            }
        }

        // find all possible originals
        if (!$this->getOriginals()->isEmpty()) {
            foreach ($this->getOriginals() as $translation) {
                // if we already meet you stop and go on with the next
                if (array_key_exists($translation->getLocale(), $translationsArray)) {
                    return;
                }
                $translationsArray[$translation->getLocale()] = $translation;
                $translation->getRecursiveTranslations($translationsArray);
            }
        }
    }
public function getRecursiveTranslations ( & $ translationsArray ) { // find all possible translations if ( ! $ this -> getTranslations ( ) -> isEmpty ( ) ) { foreach ( $ this -> getTranslations ( ) as $ translation ) { if ( $ translation ) { // if we already meet you stop and go on with the next $ translationsArray [ $ translation -> getLocale ( ) ] = $ translation ; $ translation -> getRecursiveTranslations ( $ translationsArray ) ; } } } // find all possible originals if ( ! $ this -> getOriginals ( ) -> isEmpty ( ) ) { foreach ( $ this -> getOriginals ( ) as $ translation ) { // if we already meet you stop and go on with the next if ( array_key_exists ( $ translation -> getLocale ( ) , $ translationsArray ) ) { return ; } $ translationsArray [ $ translation -> getLocale ( ) ] = $ translation ; $ translation -> getRecursiveTranslations ( $ translationsArray ) ; } } }
Recursively search for all possible translations of this page, either originals
of this page, translations of this page or translations of the original of this page.

@param array $translationsArray

@return array
Recursively search for all possible translations of this page either originals of this page translations of this page or translations of the original of this page .