src/Sulu/Bundle/DocumentManagerBundle/Bridge/DocumentInspector.php
public function getLocale($document)
    {
        if ($document instanceof LocaleBehavior) {
            return $document->getLocale();
        }

        if ($this->documentRegistry->hasDocument($document)) {
            return $this->documentRegistry->getLocaleForDocument($document);
        }

        return;
    }
public function getLocale($document)
    {
        if ($document instanceof LocaleBehavior) {
            return $document->getLocale();
        }

        if ($this->documentRegistry->hasDocument($document)) {
            return $this->documentRegistry->getLocaleForDocument($document);
        }

        return;
    }
public function getLocale ( $ document ) { if ( $ document instanceof LocaleBehavior ) { return $ document -> getLocale ( ) ; } if ( $ this -> documentRegistry -> hasDocument ( $ document ) ) { return $ this -> documentRegistry -> getLocaleForDocument ( $ document ) ; } return ; }
Return the locale for the given document or null
if the document is not managed.

@return string|null
Return the locale for the given document or null if the document is not managed .