protected createContentContext ( string $workspaceName, array $dimensions = [] ) : |
||
$workspaceName | string | Name of the workspace to set for the context |
$dimensions | array | Optional list of dimensions and their values which should be set |
return |
protected function createContentContext($workspaceName, array $dimensions = array())
{
$contextProperties = array('workspaceName' => $workspaceName, 'invisibleContentShown' => true, 'inaccessibleContentShown' => true);
if ($dimensions !== array()) {
$contextProperties['dimensions'] = $dimensions;
$contextProperties['targetDimensions'] = array_map(function ($dimensionValues) {
return array_shift($dimensionValues);
}, $dimensions);
}
return $this->_contextFactory->create($contextProperties);
}