Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ServiceReferenceGraph.php

function ServiceReferenceGraph::connect

Connects 2 nodes together in the Graph.

File

vendor/symfony/dependency-injection/Compiler/ServiceReferenceGraph.php, line 77

Class

ServiceReferenceGraph
This is a directed graph of your services.

Namespace

Symfony\Component\DependencyInjection\Compiler

Code

public function connect(?string $sourceId, mixed $sourceValue, ?string $destId, mixed $destValue = null, ?Reference $reference = null, bool $lazy = false, bool $weak = false, bool $byConstructor = false) : void {
    if (null === $sourceId || null === $destId) {
        return;
    }
    $sourceNode = $this->createNode($sourceId, $sourceValue);
    $destNode = $this->createNode($destId, $destValue);
    $edge = new ServiceReferenceGraphEdge($sourceNode, $destNode, $reference, $lazy, $weak, $byConstructor);
    $sourceNode->addOutEdge($edge);
    $destNode->addInEdge($edge);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal