Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeOperationsTrait::iHaveTheFollowingContentDimensions PHP Метод

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

    public function iHaveTheFollowingContentDimensions($table)
    {
        if ($this->isolated === true) {
            $this->callStepInSubProcess(__METHOD__, sprintf(' %s %s', escapeshellarg(\Neos\Flow\Tests\Functional\Command\TableNode::class), escapeshellarg(json_encode($table->getHash()))));
        } else {
            $dimensions = array();
            $presetsFound = false;
            foreach ($table->getHash() as $row) {
                $dimensions[$row['Identifier']] = array('default' => $row['Default']);
                $defaultPreset = '';
                if (isset($row['Presets'])) {
                    $presetsFound = true;
                    // parse a preset string like:
                    // preset1=dimensionValue1,dimensionValue2; preset2=dimensionValue3
                    $presetStrings = Arrays::trimExplode(';', $row['Presets']);
                    $presets = array();
                    foreach ($presetStrings as $presetString) {
                        list($presetName, $presetValues) = Arrays::trimExplode('=', $presetString);
                        $presets[$presetName] = array('values' => Arrays::trimExplode(',', $presetValues), 'uriSegment' => $presetName);
                        if ($defaultPreset === '') {
                            $defaultPreset = $presetName;
                        }
                    }
                    $dimensions[$row['Identifier']]['presets'] = $presets;
                    $dimensions[$row['Identifier']]['defaultPreset'] = $defaultPreset;
                }
            }
            $contentDimensionRepository = $this->getObjectManager()->get(\Neos\ContentRepository\Domain\Repository\ContentDimensionRepository::class);
            $contentDimensionRepository->setDimensionsConfiguration($dimensions);
            if ($presetsFound === true) {
                $contentDimensionPresetSource = $this->getObjectManager()->get(\Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface::class);
                $contentDimensionPresetSource->setConfiguration($dimensions);
            }
        }
    }