src/Kunstmaan/NodeBundle/Repository/NodeTranslationRepository.php
public function hasParentNodeTranslationsForLanguage(
        NodeTranslation $nodeTranslation,
        $language
    ) {
        $parentNode = $nodeTranslation->getNode()->getParent();
        if ($parentNode !== null) {
            $parentNodeTranslation = $parentNode->getNodeTranslation(
                $language,
                true
            );
            if ($parentNodeTranslation !== null) {
                return $this->hasParentNodeTranslationsForLanguage(
                    $parentNodeTranslation,
                    $language
                );
            } else {
                return false;
            }
        }

        return true;
    }
public function hasParentNodeTranslationsForLanguage(
        NodeTranslation $nodeTranslation,
        $language
    ) {
        $parentNode = $nodeTranslation->getNode()->getParent();
        if ($parentNode !== null) {
            $parentNodeTranslation = $parentNode->getNodeTranslation(
                $language,
                true
            );
            if ($parentNodeTranslation !== null) {
                return $this->hasParentNodeTranslationsForLanguage(
                    $parentNodeTranslation,
                    $language
                );
            } else {
                return false;
            }
        }

        return true;
    }
public function hasParentNodeTranslationsForLanguage ( NodeTranslation $ nodeTranslation , $ language ) { $ parentNode = $ nodeTranslation -> getNode ( ) -> getParent ( ) ; if ( $ parentNode !== null ) { $ parentNodeTranslation = $ parentNode -> getNodeTranslation ( $ language , true ) ; if ( $ parentNodeTranslation !== null ) { return $ this -> hasParentNodeTranslationsForLanguage ( $ parentNodeTranslation , $ language ) ; } else { return false ; } } return true ; }
Test if all parents of the specified NodeTranslation have a node
translation for the specified language

@param NodeTranslation $nodeTranslation The node translation
@param string          $language        The locale

@return bool
Test if all parents of the specified NodeTranslation have a node translation for the specified language