PHP Class Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector

TODO: Add feature to the document manager to map inspectors for each document class
Inheritance: extends Sulu\Component\DocumentManager\DocumentInspector
Show file Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\DocumentRegistry $documentRegistry, Sulu\Component\DocumentManager\PathSegmentRegistry $pathSegmentRegistry, Sulu\Component\DocumentManager\NamespaceRegistry $namespaceRegistry, Sulu\Component\DocumentManager\ProxyFactory $proxyFactory, Sulu\Component\DocumentManager\MetadataFactoryInterface $metadataFactory, Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface $structureFactory, PropertyEncoder $encoder, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager )
getConcreteLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array Return locales which are not shadows.
getContentPath ( Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior $document ) : string Return the path of the document in relation to the content root.
getLocale ( $document ) : string | null Return the locale for the given document or null if the document is not managed.
getLocales ( object $document ) : array Return the concrete localizations for the given document.
getLocalizationState ( object $document ) : string Return the localization state of the node.
getLocalizedUrlsForPage ( BasePageDocument $page ) : array Returns urls for given page for all locales in webspace.
getMetadata ( object $document ) : Sulu\Component\DocumentManager\Metadata Return the (DocumentManager) Metadata for the given document.
getOriginalLocale ( object $document ) : string Return the original (requested) locale for this document before any fallback logic was applied to it.
getPublishedLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array Return the published locales for the given document.
getShadowLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array Return the enabled shadow locales for the given document.
getStructureMetadata ( Sulu\Component\Content\Document\Behavior\StructureBehavior $document ) : StructureMetadata Return the structure for the given StructureBehavior implementing document.
getWebspace ( object $document ) : string Return the webspace name for the given document.

Private Methods

Method Description
extractWebspaceFromPath ( string $path ) : string Extracts webspace key from given path.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\DocumentRegistry $documentRegistry, Sulu\Component\DocumentManager\PathSegmentRegistry $pathSegmentRegistry, Sulu\Component\DocumentManager\NamespaceRegistry $namespaceRegistry, Sulu\Component\DocumentManager\ProxyFactory $proxyFactory, Sulu\Component\DocumentManager\MetadataFactoryInterface $metadataFactory, Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface $structureFactory, PropertyEncoder $encoder, Sulu\Component\Webspace\Manager\WebspaceManagerInterface $webspaceManager )
$documentRegistry Sulu\Component\DocumentManager\DocumentRegistry
$pathSegmentRegistry Sulu\Component\DocumentManager\PathSegmentRegistry
$namespaceRegistry Sulu\Component\DocumentManager\NamespaceRegistry
$proxyFactory Sulu\Component\DocumentManager\ProxyFactory
$metadataFactory Sulu\Component\DocumentManager\MetadataFactoryInterface
$structureFactory Sulu\Component\Content\Metadata\Factory\StructureMetadataFactoryInterface
$encoder PropertyEncoder
$webspaceManager Sulu\Component\Webspace\Manager\WebspaceManagerInterface

getConcreteLocales() public method

Return locales which are not shadows.
public getConcreteLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array
$document Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior
return array

getContentPath() public method

TODO: We need a better solution for retrieving webspace paths (the existing "session manager" is not a good solution).
public getContentPath ( Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior $document ) : string
$document Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior
return string

getLocale() public method

Return the locale for the given document or null if the document is not managed.
public getLocale ( $document ) : string | null
return string | null

getLocales() public method

Return the concrete localizations for the given document.
public getLocales ( object $document ) : array
$document object
return array

getLocalizationState() public method

Return the localization state of the node.
public getLocalizationState ( object $document ) : string
$document object
return string

getLocalizedUrlsForPage() public method

TODO: Implement a router service instead of this.
public getLocalizedUrlsForPage ( BasePageDocument $page ) : array
$page Sulu\Bundle\ContentBundle\Document\BasePageDocument
return array

getMetadata() public method

Return the (DocumentManager) Metadata for the given document.
public getMetadata ( object $document ) : Sulu\Component\DocumentManager\Metadata
$document object
return Sulu\Component\DocumentManager\Metadata

getOriginalLocale() public method

Return the original (requested) locale for this document before any fallback logic was applied to it.
public getOriginalLocale ( object $document ) : string
$document object
return string

getPublishedLocales() public method

Return the published locales for the given document.
public getPublishedLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array
$document Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior
return array

getShadowLocales() public method

Return the enabled shadow locales for the given document.
public getShadowLocales ( Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior $document ) : array
$document Sulu\Component\Content\Document\Behavior\ShadowLocaleBehavior
return array

getStructureMetadata() public method

Return the structure for the given StructureBehavior implementing document.
public getStructureMetadata ( Sulu\Component\Content\Document\Behavior\StructureBehavior $document ) : StructureMetadata
$document Sulu\Component\Content\Document\Behavior\StructureBehavior
return Sulu\Component\Content\Metadata\StructureMetadata

getWebspace() public method

Return the webspace name for the given document.
public getWebspace ( object $document ) : string
$document object
return string