Get dependent structures

@return \Zork\Model\Structure\MapperAwareAbstract[]
778373
public function getDependentStructures()
    {
        $dependents = parent::getDependentStructures();

        if ( ! empty( $this->id ) && isset( $this->_seoUri ) )
        {
            $subdomainId = $this->getServiceLocator()
                                ->get( 'SiteInfo' )
                                ->getSubdomainId();

            $postfix  = 2;
            $baseUri  = $this->_seoUri;
            $uriModel = $this->getUriModel();
            $params   = array(
                'id' => empty( $this->_seoUriStructure ) ? null : $this->_seoUriStructure->id
            );

            while ( $uriModel->isSubdomainUriExists( $subdomainId,
                    $this->_seoUri, $params ) )
            {
                $this->_seoUri = $baseUri . '/' . ( $postfix++ );
            }

            if ( empty( $this->_seoUriStructure ) )
            {
                if ( ! empty( $this->_seoUri ) )
                {
                    $dependents[] = $this->getUriModel()
                                         ->create( array(
                                             'default'      => true,
                                             'contentId'    => $this->id,
                                             'subdomainId'  => $subdomainId,
                                             'uri'          => $this->_seoUri,
                                             'locale'       => $this->getMapper()
                                                                    ->getLocale(),
                                         ) );
                }
            }
            else if ( $this->_seoUriStructure->uri != $this->_seoUri )
            {
                $uri = $this->getUriModel()
                            ->findBySubdomainUri( $subdomainId, $this->_seoUri );

                if ( $uri && $uri->contentId == $this->id )
                {
                    $dependents[] = $uri->setDefault();
                }
                else
                {
                    $dependents[] = $this->_seoUriStructure
                                         ->setUri( $this->_seoUri );
                }
            }
        }

        return $dependents;
    }
600088
private function dependencyDefs()
    {
        return [
            Logger::class => function () {
                $level = $this->getCfgValue('deasilworks.log.level', 10);

                $gelfHandler = new GelfHandler(
                    new Publisher(
                        new UdpTransport(
                            $this->getCfgValue('deasilworks.log.host', '4klift-graylog'),
                            $this->getCfgValue('deasilworks.log.port', 12201)
                        )
                    ),
                    $level
                );

                $nullHandler = new NullHandler($level);

                $logger = new Logger($this->getCfgValue('deasilworks.log.name', '4klift'));

                $wfgh = new WhatFailureGroupHandler([
                    $gelfHandler,
                    $nullHandler,
                ]);

                $logger->pushHandler($wfgh);

                return $logger;
            },
            CFG::class => function () {
                return $this->config->getCfg();
            },
        ];
    }
909337
private function getDependencies()
    {
        $dependencies = [];

        foreach ($this->resolver->names() as $name) {
            $dependencies[$name] = $this->getDependenciesRecursive($name);
        }

        return $dependencies;
    }
574804
protected function getRelations()
    {
        // Based on Barryvdh\LaravelIdeHelper\Console\ModelsCommand::getPropertiesFromMethods().
        return collect(get_class_methods($this->model))
            ->reject(function ($methodName) {
                return method_exists(Model::class, $methodName);
            })
            ->filter(function ($methodName) {
                $methodCode = $this->getMethodCode($methodName);

                return collect([
                    'belongsTo',
                    'morphTo',
                    'morphOne',
                    'morphMany',
                    'belongsToMany',
                    'morphedByMany',
                ])->contains(function ($relationName) use ($methodCode) {
                    return stripos($methodCode, "\$this->$relationName(");
                });
            })
            ->map(function ($methodName) {
                return $this->model->$methodName();
            })
            ->filter(function ($relation) {
                return $relation instanceof Relation;
            })
            ->all();
    }
493334
public function getOrderedProcesses()
    {
        $graph = new DependencyGraph();
        $root = new DependencyGraphNode(self::ROOT_NODE_NAME);
        $graph->addRoot($root);

        $processes = $this->getProcesses();
        $nodes = [];
        foreach ($processes as $process) {
            $processName = $this->getProcessName($process);
            $node = new DependencyGraphNode($processName);
            $graph->addDependency($root, $node);
            $nodes[$processName] = [$process, $node];
        }

        foreach ($nodes as $processName => $nodeDescription) {
            list($process, $node) = $nodeDescription;
            if (!$process instanceof DependentChainProcessInterface) {
                $graph->addDependency($root, $node);
                continue;
            }

            foreach ($process->dependsOn() as $dependencyName) {
                if (!array_key_exists($dependencyName, $nodes)) {
                    throw new UnresolvedDependencyException(sprintf(
                        'Process "%s" is dependent of "%s" which is not found',
                        $processName,
                        $dependencyName
                    ));
                }

                if ($graph->addDependency($node, $nodes[$dependencyName][1]) instanceof Left) {
                    throw new CircularDependencyException(sprintf(
                        'Circular dependency found: %s already depends on %s',
                        $dependencyName, $processName
                    ));
                }
            }
        }

        return array_map(function ($nodeName) use ($nodes) {
            return $nodes[$nodeName][0];
        }, array_filter($graph->flatten(), function ($nodeName) {
            return $nodeName !== self::ROOT_NODE_NAME;
        }));
    }
786777
protected function orderByDependencies(array $dependencies): array
    {
        $ordered = [];
        $available = array_keys($dependencies);

        while (0 !== \count($dependencies)) {
            $success = $this->doResolve($dependencies, $ordered, $available);

            if (false === $success) {
                throw new UnresolvableDependenciesException(
                    "The dependencies order could not be resolved.\n".print_r($dependencies, true)
                );
            }
        }

        return $ordered;
    }
1157007
protected function getDependencyTemplateResources()
    {
        $templateResources = [];

        // Run through all component dependencies
        foreach ($this->dependencies as $dependency) {
            $templateResources[] = $this->objectManager->get($dependency)->getPreviewTemplateResources();
        }

        return $templateResources;
    }
592708
@PublicAPI(usage = ACCESS)
    public Set<Dependency> getDirectDependenciesToSelf() {
        ImmutableSet.Builder<Dependency> result = ImmutableSet.builder();
        result.addAll(dependenciesFromAccesses(getAccessesToSelf()));
        result.addAll(inheritanceDependenciesToSelf());
        result.addAll(fieldDependenciesToSelf());
        result.addAll(returnTypeDependenciesToSelf());
        result.addAll(methodParameterDependenciesToSelf());
        result.addAll(throwsDeclarationDependenciesToSelf());
        result.addAll(constructorParameterDependenciesToSelf());
        return result.build();
    }
184369
public function getConstructorGetters()
    {
        $getters = new BeanMethodCollection();

        foreach ($this->getConstructorParameters() as $param) {
            $getters[] = $this->getGetter($param->getName());
        }

        return $getters;
    }
1109301
public function getDependencies(): array
    {
        $dependencies = [];
        foreach ($this->config['dependencies'] as $dependency) {
            $dependencies[] = $this->wire($dependency);
        }

        return $dependencies;
    }
194056
public function resolve()
    {
        if ($this->dependencies->count() === 0) {
            return array();
        }

        $resolved = new ArrayObject();
        foreach ($this->findRootNodes() as $rootNode) {
            $this->innerResolve($rootNode, $resolved, new ArrayObject());
        }

        //all resolved?
        if ($resolved->count() !== count($this->nodes)) {
            throw new CircularDependencyException();
        }

        $resolvedElements = array_map(function (DependencyNode $node) {
            return $node->getElement();
        }, $resolved->getArrayCopy());

        return $resolvedElements;
    }
1028139
public function getImportsWithDependencies (array $imports)
    {
        $toLoad = [];

        foreach ($imports as $import)
        {
            $dependencies = $this->map[$import] ?? null;

            if (null !== $dependencies)
            {
                foreach ($dependencies as $dependency)
                {
                    $toLoad[$dependency] = true;
                }
            }
            else
            {
                $toLoad[$import] = true;
            }
        }

        return \array_keys($toLoad);
    }
826683
public function getRelations()
    {
        $bag = $this->getParameter('relations');

        if (!($bag instanceof Bag)) {
            $bag = new Bag();
        }

        $this->setParameter('relations', $bag);

        return $bag;
    }
1007918
protected function getDependencies()
    {
        if (null === $this->dependencies) {
            if (file_exists(sprintf('%s/dependencies.json', $this->paths->getThemeConfigDir()))) {
                $depsContent = file_get_contents(sprintf('%s/dependencies.json', $this->paths->getThemeConfigDir()));
            } else {
                $depsContent = file_get_contents(sprintf('%s/dependencies.json', $this->paths->getBaseConfigDir()));
            }
            $this->dependencies = json_decode($depsContent, true);
        }

        return $this->dependencies;
    }
149960
protected function getRelationsToProxy()
    {
        $proxies = [];
        $attributes = $this->getEntityAttributes();

        foreach ($this->entityMap->getNonEmbeddedRelationships() as $relation) {
            //foreach ($this->entityMap->getRelationships() as $relation) {

            if (!array_key_exists($relation, $attributes) || is_null($attributes[$relation])) {
                $proxies[] = $relation;
            }
        }

        return $proxies;
    }
516474
protected function resolveDependants(): array
    {
        $dependants = [];
        $modules = $this->manager->modules();

        foreach ($modules as $name => $module) {
            if ($name === $this->name) {
                continue;
            }
            $dependencies = $module->dependencies();
            if (isset($dependencies[$this->name])) {
                $dependants[$name] = $module;
            }
        }

        return $dependants;
    }
352511
public function getDependencies(Model $model, $depth = 0) {
        $dependencies = array();

        if ($depth >= 5) {
            return $dependencies;
        }

        foreach (array($model->hasOne, $model->hasMany, $model->hasAndBelongsToMany) as $assocGroup) {
            foreach ($assocGroup as $alias => $assoc) {
                // hasOne, hasMany
                if (isset($assoc['dependent']) && $assoc['dependent']) {
                    $class = $assoc['className'];

                // hasAndBelongsToMany
                } else if (isset($assoc['joinTable'])) {
                    $class = $assoc['with'];

                } else {
                    continue;
                }

                $dependencies[] = array(
                    'alias' => $alias,
                    'model' => $class,
                    'dependencies' => $this->getDependencies($this->introspect($class), ($depth + 1))
                );
            }
        }

        return $dependencies;
    }