PHP Class Sulu\Component\Content\Document\Subscriber\ShadowCopyPropertiesSubscriber

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Mostra file Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$encoder Sulu\Component\DocumentManager\PropertyEncoder

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\PropertyEncoder $encoder )
copyFromShadow ( object $document, PHPCR\NodeInterface $node ) Copy tags and categories from base-locale to current locale.
copyShadowProperties ( Sulu\Component\DocumentManager\Event\AbstractMappingEvent $event ) Handles persist event of document manager.
copyToShadows ( object $document, PHPCR\NodeInterface $node ) Copy tags and categories from current locale to all shadowed pages with this locale as base-locale.
getSubscribedEvents ( )

Protected Methods

Method Description
supports ( $document )

Private Methods

Method Description
getCategories ( PHPCR\NodeInterface $node, $locale ) : array Returns categories of given node and locale.
getLocale ( $propertyName )
getNavigationContext ( PHPCR\NodeInterface $node, $locale ) : array Returns navigation context of given node and locale.
getTags ( PHPCR\NodeInterface $node, $locale ) : array Returns tags of given node and locale.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\PropertyEncoder $encoder )
$encoder Sulu\Component\DocumentManager\PropertyEncoder

copyFromShadow() public method

Copy tags and categories from base-locale to current locale.
public copyFromShadow ( object $document, PHPCR\NodeInterface $node )
$document object
$node PHPCR\NodeInterface

copyShadowProperties() public method

Handles persist event of document manager.
public copyShadowProperties ( Sulu\Component\DocumentManager\Event\AbstractMappingEvent $event )
$event Sulu\Component\DocumentManager\Event\AbstractMappingEvent

copyToShadows() public method

Copy tags and categories from current locale to all shadowed pages with this locale as base-locale.
public copyToShadows ( object $document, PHPCR\NodeInterface $node )
$document object
$node PHPCR\NodeInterface

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

supports() protected method

protected supports ( $document )

Property Details

$encoder protected_oe property

protected PropertyEncoder,Sulu\Component\DocumentManager $encoder
return Sulu\Component\DocumentManager\PropertyEncoder