Neos\Fusion\Core\Runtime::instantiateTypoScriptObject PHP Method

instantiateTypoScriptObject() protected method

Instantiates a TypoScript object specified by the given path and configuration
protected instantiateTypoScriptObject ( string $typoScriptPath, array $typoScriptConfiguration ) : AbstractTypoScriptObject
$typoScriptPath string Path to the configuration for this object instance
$typoScriptConfiguration array Configuration at the given path
return Neos\Fusion\TypoScriptObjects\AbstractTypoScriptObject
    protected function instantiateTypoScriptObject($typoScriptPath, $typoScriptConfiguration)
    {
        $typoScriptObjectType = $typoScriptConfiguration['__objectType'];
        $tsObjectClassName = isset($typoScriptConfiguration['__meta']['class']) ? $typoScriptConfiguration['__meta']['class'] : null;
        if (!preg_match('#<[^>]*>$#', $typoScriptPath)) {
            // Only add TypoScript object type to last path part if not already set
            $typoScriptPath .= '<' . $typoScriptObjectType . '>';
        }
        if (!class_exists($tsObjectClassName)) {
            throw new Exception(sprintf('The implementation class `%s` defined for TypoScript object of type `%s` does not exist.
				Maybe a typo in the `@class` property.', $tsObjectClassName, $typoScriptObjectType), 1347952109);
        }
        /** @var $typoScriptObject AbstractTypoScriptObject */
        $typoScriptObject = new $tsObjectClassName($this, $typoScriptPath, $typoScriptObjectType);
        if ($this->isArrayTypoScriptObject($typoScriptObject)) {
            /** @var $typoScriptObject AbstractArrayTypoScriptObject */
            if (isset($typoScriptConfiguration['__meta']['ignoreProperties'])) {
                $evaluatedIgnores = $this->evaluate($typoScriptPath . '/__meta/ignoreProperties', $typoScriptObject);
                $typoScriptObject->setIgnoreProperties(is_array($evaluatedIgnores) ? $evaluatedIgnores : array());
            }
            $this->setPropertiesOnTypoScriptObject($typoScriptObject, $typoScriptConfiguration);
        }
        return $typoScriptObject;
    }