PHP Класс Neos\ContentRepository\Domain\Model\Workspace

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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() защищенный Метод

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
Результат void

adjustShadowNodePath() защищенный Метод

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
Результат void

emitAfterNodePublishing() защищенный Метод

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
Результат void

emitBaseWorkspaceChanged() защищенный Метод

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
Результат void

emitBeforeNodePublishing() защищенный Метод

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
Результат void

findNodeDataInTargetWorkspace() защищенный Метод

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
Результат NodeData

getBaseWorkspace() публичный Метод

Returns the base workspace, if any
public getBaseWorkspace ( ) : Workspace
Результат Workspace

getBaseWorkspaces() публичный Метод

Returns all base workspaces, if any
public getBaseWorkspaces ( ) : Workspace[]
Результат Workspace[]

getDescription() публичный Метод

Returns the workspace description
public getDescription ( ) : string
Результат string

getName() публичный Метод

Returns the name of this workspace
public getName ( ) : string
Результат string Name of this workspace

getNodeCount() публичный Метод

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
Результат integer

getOwner() публичный Метод

Returns the workspace owner.
public getOwner ( ) : Neos\ContentRepository\Domain\Model\UserInterface
Результат Neos\ContentRepository\Domain\Model\UserInterface

getRootNodeData() публичный Метод

Returns the root node data of this workspace
public getRootNodeData ( ) : NodeData
Результат NodeData

getTitle() публичный Метод

Returns the workspace title
public getTitle ( ) : string
Результат string

handleShadowNodeData() защищенный Метод

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
Результат boolean false if no shadow node was found, true otherwise

initializeObject() публичный Метод

If this workspace is brand new, a root node is created automatically.
public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
Результат void

isInternalWorkspace() публичный Метод

Checks if this workspace is shared across all editors
public isInternalWorkspace ( ) : boolean
Результат boolean

isPersonalWorkspace() публичный Метод

Checks if this workspace is a user's personal workspace
public isPersonalWorkspace ( ) : boolean
Результат boolean

isPrivateWorkspace() публичный Метод

Checks if this workspace is shared only across users with access to internal workspaces, for example "reviewers"
public isPrivateWorkspace ( ) : boolean
Результат boolean

isPublicWorkspace() публичный Метод

Checks if this workspace is public to everyone, even without authentication
public isPublicWorkspace ( ) : boolean
Результат boolean

moveNodeVariantToTargetWorkspace() защищенный Метод

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
Результат void

publish() публичный Метод

The specified workspace must be a base workspace of this workspace.
public publish ( Workspace $targetWorkspace ) : void
$targetWorkspace Workspace The workspace to publish to
Результат void

publishNode() публичный Метод

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
Результат void

publishNodes() публичный Метод

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
Результат void

replaceNodeData() защищенный Метод

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
Результат void

setBaseWorkspace() публичный Метод

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
Результат void

setDescription() публичный Метод

Sets the workspace description
public setDescription ( string $description ) : void
$description string
Результат void

setOwner() публичный Метод

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() публичный Метод

Sets workspace title
public setTitle ( string $title ) : void
$title string
Результат void

verifyPublishingTargetWorkspace() защищенный Метод

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
Результат void

Описание свойств

$baseWorkspace защищенное свойство

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
Результат Workspace

$description защищенное свойство

An optional user-defined description
protected string $description
Результат string

$name защищенное свойство

protected string $name
Результат string

$nodeDataRepository защищенное свойство

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
Результат Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeService защищенное свойство

protected NodeServiceInterface,Neos\ContentRepository\Domain\Service $nodeService
Результат Neos\ContentRepository\Domain\Service\NodeServiceInterface

$now защищенное свойство

protected Now,Neos\Flow\Utility $now
Результат Neos\Flow\Utility\Now

$owner защищенное свойство

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
Результат string

$persistenceManager защищенное свойство

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

$publishingService защищенное свойство

protected PublishingServiceInterface,Neos\ContentRepository\Domain\Service $publishingService
Результат Neos\ContentRepository\Domain\Service\PublishingServiceInterface

$reflectionService защищенное свойство

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

$rootNodeData защищенное свойство

Root node data of this workspace
protected NodeData,Neos\ContentRepository\Domain\Model $rootNodeData
Результат NodeData

$title защищенное свойство

A user-defined, human-friendly title for this workspace
protected string $title
Результат string