Neos\Fusion\Core\Parser::getParsedObjectPath PHP Метод

getParsedObjectPath() защищенный Метод

Parse an object path specified as a string and returns an array.
protected getParsedObjectPath ( string $objectPath ) : array
$objectPath string The object path to parse
Результат array An object path array
    protected function getParsedObjectPath($objectPath)
    {
        if (preg_match(self::SCAN_PATTERN_OBJECTPATH, $objectPath) === 1) {
            if ($objectPath[0] === '.') {
                $objectPath = $this->getCurrentObjectPathPrefix() . substr($objectPath, 1);
            }
            $objectPathArray = array();
            foreach (preg_split(self::SPLIT_PATTERN_OBJECTPATH, $objectPath) as $objectPathSegment) {
                if ($objectPathSegment[0] === '@') {
                    $objectPathArray[] = '__meta';
                    $metaProperty = substr($objectPathSegment, 1);
                    if ($metaProperty === 'override') {
                        $metaProperty = 'context';
                    }
                    $objectPathArray[] = $metaProperty;
                } elseif (preg_match(self::SCAN_PATTERN_OBJECTPATHSEGMENT_IS_PROTOTYPE, $objectPathSegment)) {
                    $objectPathArray[] = '__prototypes';
                    $unexpandedObjectType = substr($objectPathSegment, 10, -1);
                    $objectTypeParts = explode(':', $unexpandedObjectType);
                    if (!isset($objectTypeParts[1])) {
                        $fullyQualifiedObjectType = $this->objectTypeNamespaces['default'] . ':' . $objectTypeParts[0];
                    } elseif (isset($this->objectTypeNamespaces[$objectTypeParts[0]])) {
                        $fullyQualifiedObjectType = $this->objectTypeNamespaces[$objectTypeParts[0]] . ':' . $objectTypeParts[1];
                    } else {
                        $fullyQualifiedObjectType = $unexpandedObjectType;
                    }
                    $objectPathArray[] = $fullyQualifiedObjectType;
                } else {
                    $key = $objectPathSegment;
                    if (substr($key, 0, 2) === '__' && in_array($key, self::$reservedParseTreeKeys, true)) {
                        throw new Fusion\Exception(sprintf('Reversed key "%s" used in object path "%s".', $key, $objectPath), 1437065270);
                    }
                    $objectPathArray[] = $this->unquoteString($key);
                }
            }
        } else {
            throw new Fusion\Exception('Syntax error: Invalid object path "' . $objectPath . '".', 1180603499);
        }
        return $objectPathArray;
    }