Resolves all Reference Objects in this object and replaces them with their resolution.
@throws exceptions\UnresolvableReferenceException in case resolving a reference fails.
763045
public function resolveReferences(ReferenceContext $context = null)
    {
        foreach ($this->_properties as $property => $value) {
            if ($value instanceof Reference) {
                $this->_properties[$property] = $value->resolve($context);
            } elseif ($value instanceof SpecObjectInterface) {
                $value->resolveReferences($context);
            } elseif (is_array($value)) {
                foreach ($value as $k => $item) {
                    if ($item instanceof Reference) {
                        $this->_properties[$property][$k] = $item->resolve($context);
                    } elseif ($item instanceof SpecObjectInterface) {
                        $item->resolveReferences($context);
                    }
                }
            }
        }
    }
1231369
public function clear()
    {
        $this->id = null;
        $this->code = null;
        $this->en = null;
        $this->de = null;
        $this->alreadyInSave = false;
        $this->alreadyInValidation = false;
        $this->alreadyInClearAllReferencesDeep = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
137937
public void reset()
    {
        if (_refs != null) {
            _refs.clear();
            _refCount = 0;
        }

        _classRefs.clear();
        _typeRefs = null;
        _offset = 0;
        _isPacket = false;
        _isUnshared = false;
    }
1258056
public function clear()
    {
        if (null !== $this->aSkillRelatedByPartId) {
            $this->aSkillRelatedByPartId->removePart($this);
        }
        if (null !== $this->aSkillRelatedByCompositeId) {
            $this->aSkillRelatedByCompositeId->removeComposite($this);
        }
        $this->part_id = null;
        $this->composite_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
841498
public function resolve($reference, $class)
    {
        $result = $reference;

        while ($result instanceof Reference) {
            $result = $result->resolve(function ($data) use($result, $class) {
                return $this->serializer->denormalize($data, $class, 'json', [
                    'document-origin' => (string) $result->getMergedUri()->withFragment('')
                ]);
            });
        }

        return $result;
    }
263129
private function resolveReference(Reference $reference)
    {
        if (!ExternalReference::isValid($reference)) {
            return $reference;
        }

        return $this->transformReferenceToDefinition(new ExternalReference($reference));
    }
987581
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->resolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $possibleIds = $this->getSuitableIds($value, $fixtureSet, $context);
        $id = Base::randomElement($possibleIds);
        if (null === $id) {
            throw UnresolvableValueExceptionFactory::createForNoFixtureOrObjectMatchingThePattern($value);
        }

        return $this->resolver->resolve(
            new FixtureReferenceValue($id),
            $fixture,
            $fixtureSet,
            $scope,
            $context
        );
    }
1044774
private void resolveDependencies(final Object reference) {
        final Class<?> superclass = reference.getClass().getSuperclass().getSuperclass(); // Proxy -> Orig -> Super

        resolveSuperclassFieldDependencies(reference, superclass);
        resolveCurrentclassFieldDependencies(reference);
    }
97855
public function resolve($reference)
    {
        if (empty($reference)) {
            return $reference;
        }

        if ($this->isResolvableAnonymousReference($reference)) {
            return $this->resolveAnonymousReference($reference);
        }

        return $this->resolveInternal($reference);
    }
633338
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->resolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $context->markAsNeedsCompleteGeneration();
        $fixtureReferenceResult = $this->resolver->resolve($value->getReference(), $fixture, $fixtureSet, $scope, $context);
        $context->unmarkAsNeedsCompleteGeneration();

        /** @var ResolvedFixtureSet $fixtureSet */
        list($instance, $fixtureSet) = [$fixtureReferenceResult->getValue(), $fixtureReferenceResult->getSet()];

        try {
            $propertyValue = $this->propertyAccessor->getValue($instance, $value->getProperty());
        } catch (SymfonyNoSuchPropertyException $exception) {
            throw NoSuchPropertyExceptionFactory::createForFixture($fixture, $value, 0, $exception);
        } catch (\Exception $exception) {
            throw UnresolvableValueExceptionFactory::create($value, 0, $exception);
        }

        return new ResolvedValueWithFixtureSet(
            $propertyValue,
            $fixtureSet
        );
    }
1110704
protected function createResolverFunction()
    {
        $resolver = $this->resolver;

        return function () use ($resolver) {
            $args = func_get_args();
            if (is_callable($resolver)) {
                return call_user_func_array($resolver, $args);
            } else {
                if ($resolver instanceof OperationResolver) {
                    return call_user_func_array([$resolver, 'resolve'], $args);
                } else {
                    throw new \Exception(sprintf(
                        '%s resolver must be a closure or implement %s',
                        __CLASS__,
                        OperationResolver::class
                    ));
                }
            }
        };
    }
111198
protected function resolveInline(
        UriInterface $referenceUri,
        Value\ReferenceValue $reference
    ) {
        $scopeMap = $pointer = null;
        foreach (array_reverse($this->scopeMapStack()) as $scopeMap) {
            $pointer = $scopeMap->pointerByUri($referenceUri);
            if (null !== $pointer) {
                break;
            }
        }
        if (null === $pointer) {
            return null;
        }

        $this->pushScopeMap($scopeMap);
        $value = $scopeMap->value()->accept($this);
        $this->popScopeMap();

        $value = $this->pointerResolver()->resolve($pointer, $value);
        if (null === $value) {
            throw new Exception\UndefinedReferenceException(
                $reference,
                $this->currentBaseUri()
            );
        }

        return $value;
    }
1339346
def resolving(self, ref):
        
        # print u"resol_scope: %s, ref: %s" % (self.resolution_scope, ref)
        full_uri = urljoin(self.resolution_scope, ref)
        uri, fragment = urldefrag(full_uri)
        if not uri:
            uri = self.base_uri

        if uri in self.store:
            document = self.store[uri]
        else:
            if (uri.startswith(u"file") or uri.startswith(u"File")):
                try:
                    document = self.resolve_local(full_uri, self.resolution_scope, ref)
                except Exception as exc:
                    raise RefResolutionError(exc)
            else:

                try:
                    document = self.resolve_remote(uri)
                except Exception as exc:
                    raise RefResolutionError(exc)

        old_base_uri, self.base_uri = self.base_uri, uri
        try:
            with self.in_scope(uri):
                yield self.resolve_fragment(document, fragment)
        finally:
            self.base_uri = old_base_uri
788741
public function getResolverHandler(): ResolverHandler
    {
        if (is_null(self::$globalResolverHandler)) {
            //this should be the only place where
            //a hard coded dependancy exists
            self::$globalResolverHandler = new ResolverHandler();
        }

        if (is_null($this->resolverHandler)) {
            $this->resolverHandler = self::$globalResolverHandler;
        }

        return $this->resolverHandler;
    }
966578
public function resolveReferences(ReferenceContext $context = null)
    {
        foreach ($this->_paths as $key => $path) {
            if ($path === null) {
                continue;
            }
            $path->resolveReferences($context);
        }
    }
354869
public void resolveReferences() {
        // Resolve annotations to their definitions
        Map<String, AnnotationDefinition> defs = getDefinitionMap();
        final List<Annotation> annos = new ArrayList<Annotation>();

        // Get all the annotation used by the document's statement groups
        for (final StatementGroup sg : statementGroups) {
            annos.addAll(sg.getAllAnnotations());
        }

        // Resolve the references
        for (final Annotation a : annos) {
            AnnotationDefinition ad = a.getDefinition();
            // Skip annotations without definitions
            if (ad == null) {
                continue;
            }

            final String id = ad.getId();
            AnnotationDefinition documentDefinition = defs.get(id);

            // BEL document annotations must reference valid definitions...
            assert documentDefinition != null;
            // ... so sanity check that for now.

            // Resolve the reference to the instance
            a.setDefinition(documentDefinition);
        }

        // Resolve parameters to their namespaces
        Map<String, Namespace> nspcs = getNamespaceMap();
        final List<Parameter> params = new ArrayList<Parameter>();

        // Get all the parameters within the document
        for (final StatementGroup sg : statementGroups) {
            params.addAll(sg.getAllParameters());
        }

        // Get the default namespace if present
        final Namespace defaultNS = nspcs.get(DEFAULT_NAMESPACE_PREFIX);

        // Resolve the references
        for (final Parameter av : params) {
            Namespace ns = av.getNamespace();

            // Skip parameters without namespaces
            if (ns == null) {
                if (defaultNS != null) {
                    av.setNamespace(defaultNS);
                }
                continue;
            }

            final String prefix = ns.getPrefix();
            Namespace documentNamespace = nspcs.get(prefix);

            // BEL document parameters must reference valid namespaces...
            assert documentNamespace != null;
            // ... so sanity check that for now.

            // Resolve the reference to the instance
            av.setNamespace(documentNamespace);
        }
    }
1130733
function resolveRef(schemaObj, resolvedValues) {
            // the array store referenced value
            var refVal = schemaObj.refVal;
            // the map store full ref id and index of the referenced value in refVal
            // example: { 'test#definitions/option' : 1, 'test#definitions/repo' : 2 }
            var refs = schemaObj.refs;
            // the map to store schema value with sub reference
            var subRefs = {};

            _.forEach(refs, function (index, refId) {
                // if reference id already resolved then continue the loop
                if (refId in resolvedValues) {
                    return true; // continue
                }

                var refValue = refVal[index];
                // if no further nested reference, add to resolved map
                if (_.isEmpty(refValue.refs)) {
                    resolvedValues[refId] = refValue;
                    return true;
                }

                // add schema value with sub reference to map to resolve later
                subRefs[refId] = refValue;
            });

            // resolve sub reference recursively
            _.forEach(subRefs, function (subRef, refId) {
                resolvedValues[refId] = 1;
                resolvedValues[refId] = resolveRef(subRef, resolvedValues);
            });

            return schemaObj.schema;
        }