PHP Class Neos\ContentRepository\Domain\Model\Workspace

Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$baseWorkspace Workspace Content from the base workspace will shine through in this workspace as long as they are not modified in this workspace.
$description string An optional user-defined description
$name string
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeService Neos\ContentRepository\Domain\Service\NodeServiceInterface
$now Neos\Flow\Utility\Now
$owner string We can't use a real many-to-many relation here, because the User implementation will come from a different package (e.g. Neos) which ContentRepository does not depend on. This relation may be implemented with a target entity listener at a later stage, when we implemented support for it in Flow core. See also: http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/cookbook/resolve-target-entity-listener.html
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$publishingService Neos\ContentRepository\Domain\Service\PublishingServiceInterface
$reflectionService Neos\Flow\Reflection\ReflectionService
$rootNodeData NodeData Root node data of this workspace
$title string A user-defined, human-friendly title for this workspace

Méthodes publiques

Méthode Description
__construct ( string $name, Workspace $baseWorkspace = null, Neos\ContentRepository\Domain\Model\UserInterface $owner = null ) Constructs a new workspace
getBaseWorkspace ( ) : Workspace Returns the base workspace, if any
getBaseWorkspaces ( ) : Workspace[] Returns all base workspaces, if any
getDescription ( ) : string Returns the workspace description
getName ( ) : string Returns the name of this workspace
getNodeCount ( ) : integer Returns the number of nodes in this workspace.
getOwner ( ) : Neos\ContentRepository\Domain\Model\UserInterface Returns the workspace owner.
getRootNodeData ( ) : NodeData Returns the root node data of this workspace
getTitle ( ) : string Returns the workspace title
initializeObject ( integer $initializationCause ) : void Initializes this workspace.
isInternalWorkspace ( ) : boolean Checks if this workspace is shared across all editors
isPersonalWorkspace ( ) : boolean Checks if this workspace is a user's personal workspace
isPrivateWorkspace ( ) : boolean Checks if this workspace is shared only across users with access to internal workspaces, for example "reviewers"
isPublicWorkspace ( ) : boolean Checks if this workspace is public to everyone, even without authentication
publish ( Workspace $targetWorkspace ) : void Publishes the content of this workspace to another workspace.
publishNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void Publishes the given node to the target workspace.
publishNodes ( array $nodes, Workspace $targetWorkspace ) : void Publishes the given nodes to the target workspace.
setBaseWorkspace ( Workspace $baseWorkspace ) : void Sets the base workspace
setDescription ( string $description ) : void Sets the workspace description
setOwner ( Neos\ContentRepository\Domain\Model\UserInterface | string $user ) Returns the workspace owner.
setTitle ( string $title ) : void Sets workspace title

Méthodes protégées

Méthode Description
adjustShadowNodeData ( NodeData $shadowNodeData, NodeData $publishedNodeData, Workspace $targetWorkspace, NodeData $targetNodeData ) : void Adjust the given $shadowNodeData by removing it or moving it to the $targetWorkspace, as needed.
adjustShadowNodePath ( NodeData $shadowNodeData, $path, Workspace $targetWorkspace, array $dimensionValues ) : void Adjusts the path of $shadowNodeData to $path, if needed/possible.
emitAfterNodePublishing ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void Emits a signal when a node has been published.
emitBaseWorkspaceChanged ( Workspace $workspace, Workspace $oldBaseWorkspace = null, Workspace $newBaseWorkspace = null ) : void Emits a signal after the base workspace has been changed
emitBeforeNodePublishing ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void Emits a signal just before a node is being published
findNodeDataInTargetWorkspace ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : NodeData Returns the NodeData instance with the given identifier from the target workspace.
handleShadowNodeData ( NodeData $publishedNodeData, Workspace $targetWorkspace, NodeData $targetNodeData ) : boolean Look for a shadow node of $publishedNodeData either adjust or remove it based on $targetWorkspace if the shadow node is marked as removed.
moveNodeVariantToTargetWorkspace ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void Move the given node instance to the target workspace
replaceNodeData ( Neos\ContentRepository\Domain\Model\NodeInterface $node, NodeData $targetNodeData ) : void Replace the node data of a node instance with a given target node data
verifyPublishingTargetWorkspace ( Workspace $targetWorkspace ) : void Checks if the specified workspace is a base workspace of this workspace and if not, throws an exception

Method Details

__construct() public méthode

Constructs a new workspace
public __construct ( string $name, Workspace $baseWorkspace = null, Neos\ContentRepository\Domain\Model\UserInterface $owner = null )
$name string Name of this workspace
$baseWorkspace Workspace A workspace this workspace is based on (if any)
$owner Neos\ContentRepository\Domain\Model\UserInterface The user that created the workspace (if any, "system" workspaces have none)

adjustShadowNodeData() protected méthode

Adjust the given $shadowNodeData by removing it or moving it to the $targetWorkspace, as needed.
protected adjustShadowNodeData ( NodeData $shadowNodeData, NodeData $publishedNodeData, Workspace $targetWorkspace, NodeData $targetNodeData ) : void
$shadowNodeData NodeData
$publishedNodeData NodeData
$targetWorkspace Workspace
$targetNodeData NodeData
Résultat void

adjustShadowNodePath() protected méthode

If the $path is occupied in $targetWorkspace, the shadow is removed.
protected adjustShadowNodePath ( NodeData $shadowNodeData, $path, Workspace $targetWorkspace, array $dimensionValues ) : void
$shadowNodeData NodeData
$path
$targetWorkspace Workspace
$dimensionValues array
Résultat void

emitAfterNodePublishing() protected méthode

The signal emits the source node and target workspace, i.e. the node contains its source workspace.
protected emitAfterNodePublishing ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node that was published
$targetWorkspace Workspace The publishing target workspace
Résultat void

emitBaseWorkspaceChanged() protected méthode

Emits a signal after the base workspace has been changed
protected emitBaseWorkspaceChanged ( Workspace $workspace, Workspace $oldBaseWorkspace = null, Workspace $newBaseWorkspace = null ) : void
$workspace Workspace This workspace
$oldBaseWorkspace Workspace The workspace which was the base workspace before the change
$newBaseWorkspace Workspace The new base workspace
Résultat void

emitBeforeNodePublishing() protected méthode

The signal emits the source node and target workspace, i.e. the node contains its source workspace.
protected emitBeforeNodePublishing ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node to be published
$targetWorkspace Workspace The publishing target workspace
Résultat void

findNodeDataInTargetWorkspace() protected méthode

If no NodeData instance is found, null is returned.
protected findNodeDataInTargetWorkspace ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : NodeData
$node Neos\ContentRepository\Domain\Model\NodeInterface
$targetWorkspace Workspace
Résultat NodeData

getBaseWorkspace() public méthode

Returns the base workspace, if any
public getBaseWorkspace ( ) : Workspace
Résultat Workspace

getBaseWorkspaces() public méthode

Returns all base workspaces, if any
public getBaseWorkspaces ( ) : Workspace[]
Résultat Workspace[]

getDescription() public méthode

Returns the workspace description
public getDescription ( ) : string
Résultat string

getName() public méthode

Returns the name of this workspace
public getName ( ) : string
Résultat string Name of this workspace

getNodeCount() public méthode

If $includeBaseWorkspaces is enabled, also nodes of base workspaces are taken into account. If it is disabled (default) then the number of nodes is the actual number (+1) of changes related to its base workspaces. A node count of 1 means that no changes are pending in this workspace because a workspace always contains at least its Root Node.
public getNodeCount ( ) : integer
Résultat integer

getOwner() public méthode

Returns the workspace owner.
public getOwner ( ) : Neos\ContentRepository\Domain\Model\UserInterface
Résultat Neos\ContentRepository\Domain\Model\UserInterface

getRootNodeData() public méthode

Returns the root node data of this workspace
public getRootNodeData ( ) : NodeData
Résultat NodeData

getTitle() public méthode

Returns the workspace title
public getTitle ( ) : string
Résultat string

handleShadowNodeData() protected méthode

Look for a shadow node of $publishedNodeData either adjust or remove it based on $targetWorkspace if the shadow node is marked as removed.
protected handleShadowNodeData ( NodeData $publishedNodeData, Workspace $targetWorkspace, NodeData $targetNodeData ) : boolean
$publishedNodeData NodeData
$targetWorkspace Workspace
$targetNodeData NodeData
Résultat boolean false if no shadow node was found, true otherwise

initializeObject() public méthode

If this workspace is brand new, a root node is created automatically.
public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
Résultat void

isInternalWorkspace() public méthode

Checks if this workspace is shared across all editors
public isInternalWorkspace ( ) : boolean
Résultat boolean

isPersonalWorkspace() public méthode

Checks if this workspace is a user's personal workspace
public isPersonalWorkspace ( ) : boolean
Résultat boolean

isPrivateWorkspace() public méthode

Checks if this workspace is shared only across users with access to internal workspaces, for example "reviewers"
public isPrivateWorkspace ( ) : boolean
Résultat boolean

isPublicWorkspace() public méthode

Checks if this workspace is public to everyone, even without authentication
public isPublicWorkspace ( ) : boolean
Résultat boolean

moveNodeVariantToTargetWorkspace() protected méthode

If no target node variant (having the same dimension values) exists in the target workspace, the node that is published will be used as a new node variant in the target workspace.
protected moveNodeVariantToTargetWorkspace ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node to publish
$targetWorkspace Workspace The workspace to publish to
Résultat void

publish() public méthode

The specified workspace must be a base workspace of this workspace.
public publish ( Workspace $targetWorkspace ) : void
$targetWorkspace Workspace The workspace to publish to
Résultat void

publishNode() public méthode

The specified workspace must be a base workspace of this workspace.
public publishNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node to publish
$targetWorkspace Workspace The workspace to publish to
Résultat void

publishNodes() public méthode

The specified workspace must be a base workspace of this workspace.
public publishNodes ( array $nodes, Workspace $targetWorkspace ) : void
$nodes array
$targetWorkspace Workspace The workspace to publish to
Résultat void

replaceNodeData() protected méthode

The node data of the node that is published will be removed and the existing node data inside the target workspace is updated to the changes and will be injected into the node instance. If the node was marked as removed, both node data are removed.
protected replaceNodeData ( Neos\ContentRepository\Domain\Model\NodeInterface $node, NodeData $targetNodeData ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node instance with node data to be published
$targetNodeData NodeData The existing node data in the target workspace
Résultat void

setBaseWorkspace() public méthode

Note that this method is not part of the public API because further action is necessary for rebasing a workspace
public setBaseWorkspace ( Workspace $baseWorkspace ) : void
$baseWorkspace Workspace
Résultat void

setDescription() public méthode

Sets the workspace description
public setDescription ( string $description ) : void
$description string
Résultat void

setOwner() public méthode

Returns the workspace owner.
public setOwner ( Neos\ContentRepository\Domain\Model\UserInterface | string $user )
$user Neos\ContentRepository\Domain\Model\UserInterface | string The new user, or user's UUID

setTitle() public méthode

Sets workspace title
public setTitle ( string $title ) : void
$title string
Résultat void

verifyPublishingTargetWorkspace() protected méthode

Checks if the specified workspace is a base workspace of this workspace and if not, throws an exception
protected verifyPublishingTargetWorkspace ( Workspace $targetWorkspace ) : void
$targetWorkspace Workspace The publishing target workspace
Résultat void

Property Details

$baseWorkspace protected_oe property

Content from the base workspace will shine through in this workspace as long as they are not modified in this workspace.
protected Workspace,Neos\ContentRepository\Domain\Model $baseWorkspace
Résultat Workspace

$description protected_oe property

An optional user-defined description
protected string $description
Résultat string

$name protected_oe property

protected string $name
Résultat string

$nodeDataRepository protected_oe property

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
Résultat Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeService protected_oe property

protected NodeServiceInterface,Neos\ContentRepository\Domain\Service $nodeService
Résultat Neos\ContentRepository\Domain\Service\NodeServiceInterface

$now protected_oe property

protected Now,Neos\Flow\Utility $now
Résultat Neos\Flow\Utility\Now

$owner protected_oe property

We can't use a real many-to-many relation here, because the User implementation will come from a different package (e.g. Neos) which ContentRepository does not depend on. This relation may be implemented with a target entity listener at a later stage, when we implemented support for it in Flow core. See also: http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/cookbook/resolve-target-entity-listener.html
protected string $owner
Résultat string

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Résultat Neos\Flow\Persistence\PersistenceManagerInterface

$publishingService protected_oe property

protected PublishingServiceInterface,Neos\ContentRepository\Domain\Service $publishingService
Résultat Neos\ContentRepository\Domain\Service\PublishingServiceInterface

$reflectionService protected_oe property

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Résultat Neos\Flow\Reflection\ReflectionService

$rootNodeData protected_oe property

Root node data of this workspace
protected NodeData,Neos\ContentRepository\Domain\Model $rootNodeData
Résultat NodeData

$title protected_oe property

A user-defined, human-friendly title for this workspace
protected string $title
Résultat string