/**
* 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);
}