Neos\ContentRepository\Domain\Model\NodeInterface::getWorkspace PHP Метод

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

Returns the workspace this node is contained in
public getWorkspace ( ) : Workspace
Результат Workspace
    public function getWorkspace();

Usage Example

 /**
  * Matches if the selected node belongs to one of the given $workspaceNames
  *
  * Example: isInWorkspace(['live', 'user-admin']) matches if the selected node is in one of the workspaces "user-admin" or "live"
  *
  * @param array $workspaceNames An array of workspace names, e.g. ["live", "user-admin"]
  * @return boolean TRUE if the selected node matches the $workspaceNames, otherwise FALSE
  */
 public function isInWorkspace($workspaceNames)
 {
     if ($this->node === null) {
         return true;
     }
     return in_array($this->node->getWorkspace()->getName(), $workspaceNames);
 }
All Usage Examples Of Neos\ContentRepository\Domain\Model\NodeInterface::getWorkspace