Adds the foreign keys to the field.
@param DOMXPath $rootPath
@return TableMigration
502674
protected function addForeignKeys(DOMXPath $rootPath)
    {
        $fields = $this->getFields();
        $idMap = array_flip(array_map(function (MigrationField $field) {
            return $field->getId();
        }, $fields));

        /** @var MigrationField $field */
        foreach ($fields as $name => $field) {
            $usedId = $field->getId();
            $indexNodes = $this->getForeignKeysForField($field, $rootPath);

            if ($indexNodes && $indexNodes->length) {
                /** @var \DOMNode $indexNode */
                foreach ($indexNodes as $indexNode) {
                    $call = new ForeignKey();

                    $call
                        ->foreign($field->getName())
                        ->references('id')
                        ->on(
                            $rootPath->evaluate(
                                'string(.//link[@type="object" and @struct-name="db.mysql.Table" ' .
                                'and @key="referencedTable"])',
                                $indexNode
                            )
                        );

                    if ($rule = $rootPath->evaluate('string(./value[@key="deleteRule"])', $indexNode)) {
                        $call->onDelete(strtolower($rule));
                    } // if

                    if ($rule = $rootPath->evaluate('string(./value[@key="updateRule"])', $indexNode)) {
                        $call->onUpdate(strtolower($rule));
                    } // if

                    $call->isForMany((int)$rootPath->evaluate('number(./value[@key="many"])', $indexNode) === 1);
                } // foreach

                $this->addGenericCall($call);
            } // if
        } // foreach

        return $this;
    }
1208991
public function findOneClosestPageIdWithActiveTemplateByRootLine(array $rootLine)
    {
        $rootLinePageIds = [0];
        foreach ($rootLine as $rootLineItem) {
            $rootLinePageIds[] = (int)$rootLineItem['uid'];
        }

        $queryBuilder = $this->getQueryBuilder();

        $result = $queryBuilder
            ->select('uid', 'pid')
            ->from($this->table)
            ->where($queryBuilder->expr()->in('pid', $rootLinePageIds))
            ->execute()->fetch();

        return isset($result['pid']) ? $result['pid'] : 0;
    }
205627
public function addDataFixtures(array $fixturesPaths): Descriptor
    {
        if (!empty($fixturesPaths)) {
            foreach ($fixturesPaths as $path) {
                $this->dataFixtures->add($path);
            }
        }

        return $this;
    }
1215732
protected function createTree(&$keyParts, TreeNode $rootNode) : TreeNode
    {
        if (!count($keyParts)) {
            return $rootNode;
        }

        $newKey  = array_shift($keyParts);
        $newNode = new self($rootNode, $newKey, null, $rootNode->getKeyDelimiter());
        $rootNode->addChild($newNode);

        return $this->createTree($keyParts, $newNode);
    }
628159
protected function loadRepository($filepath)
	{
		if (!file_exists($filepath))
		{
			throw $this->createRepositoryException($filepath);
		}

		$dom = new DOMDocument;
		$dom->preserveWhiteSpace = false;
		if (!$dom->loadXML(file_get_contents($filepath), LIBXML_NOERROR))
		{
			throw $this->createRepositoryException($filepath);
		}

		return $dom;
	}
857879
public function dump($basepath)
    {
        foreach ($this->sitemapDumpers as $sitemapDumper) {
            if (is_array($this->languages)) {
                foreach ($this->languages as $language) {
                    $sitemapDumper->dump($basepath, $language);
                }
            } else {
                $sitemapDumper->dump($basepath);
            }
        }

        return $this;
    }
263703
public function addMigration(string $module, string $path)
    {
        $module = self::normalizeModule($module);
        if (isset($this->modules[$module]))
            throw new MigrationException("Duplicate module: " . $module);

        $instance = new Module($module, $path, $this->db);
        $this->modules[$module] = $instance;
        return $instance;
    }
14957
public function setOrigin($originIso, $originPath, $originLanguagePath)
	{
		$this->originIso = $originIso;
		$this->originPath = $originPath;
		$this->originLanguagePath = $originLanguagePath;
		$this->langkeyValidator->setOrigin($originIso, $originPath, $originLanguagePath);
		return $this;
	}
318543
public function requestPropertyComparisonStrategy(TreePath $treePath) {
		$queryPoint = $this->findSelectQueryPoint($treePath);
		$comparisonStrategy = null;
		if ($treePath->hasNext()) {
			$comparisonStrategy = $queryPoint->requestPropertyComparisonStrategy($treePath);
		} else {
			$comparisonStrategy = $queryPoint->requestComparisonStrategy();
		}
		
		if ($comparisonStrategy->getType() != ComparisonStrategy::TYPE_COLUMN) {
			throw new QueryConflictException('Property can not be compared in having clause: '
					. TreePath::prettyPropertyStr($treePath->getDones()));
		}
		
		return new ComparisonStrategy(new SelectColumnComparable(
				$comparisonStrategy->getColumnComparable(),
				$this->queryModel->getQueryItemSelect()));
	}
527237
public static Path getTablePath(Path rootPath, String table) {
        return new Path(rootPath, encode(table));
    }
455153
private function parseAggregations(\DOMXPath $xpath, \DOMNode $rootNode)
    {
        $aggs = [];

        foreach ($xpath->query(self::AGGREGATIONS_PATH, $rootNode) as $aggNode) {
            $bucketName   = $aggNode->getAttribute('name');
            $bucketConfig = [];

            foreach ($aggNode->attributes as $attribute) {
                $bucketConfig[$attribute->name] = $attribute->value;
            }
            $aggFilters = $this->parseAggregationFilters($xpath, $aggNode);
            if (!empty($aggFilters)) {
                $bucketConfig['filters'] = $aggFilters;
            }
            $bucketConfig['childBuckets'] = $this->parseAggregations($xpath, $aggNode);
            $bucketConfig['metrics'] = $this->parseMetrics($xpath, $aggNode);
            $bucketConfig['pipelines'] = $this->parsePipelines($xpath, $aggNode);
            $aggs[$bucketName] = $bucketConfig;
        }

        return $aggs;
    }
181239
public function addRootTable($table, $alias = null)
    {
        $this->rootTables[] = $tableObject = $this->createTable($table, $alias);
        is_callable($table) && $table($tableObject);

        return $tableObject;
    }
276674
private function addMonologSection(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('monolog')
                    ->canBeUnset()
                    ->children()
                        ->scalarNode('client')->isRequired()->end()
                        ->scalarNode('key')->isRequired()->end()
                        ->scalarNode('formatter')->end()
                    ->end()
                ->end()
            ->end();
    }
509212
protected function createRootElement($rootElement)
    {
        if (is_string($rootElement)) {
            $rootElementName = $rootElement ?: 'root';

            return $this->document->createElement($rootElementName);
        }

        $rootElementName = $rootElement['rootElementName'] ?? 'root';

        $element = $this->document->createElement($rootElementName);

        foreach ($rootElement as $key => $value) {
            if ($key !== '_attributes' && $key !== '@attributes') {
                continue;
            }

            $this->addAttributes($element, $rootElement[$key]);
        }

        return $element;
    }
58428
public function addForeignColumnName($foreignColumnName)
    {
        if (!is_string($foreignColumnName) || (strlen($foreignColumnName) <= 0)) {
            throw SchemaException::invalidForeignKeyForeignColumnName($this->getName());
        }

        $this->foreignColumnNames[] = $foreignColumnName;
    }
499421
final public function addForeignKey(ForeignKey $foreignKey): Column
    {
        if (array_key_exists($foreignKey->getName(), $this->foreignKeys)) {
            throw new InvalidArgumentException('Foreign key '.$foreignKey->getName().' already added.');
        }

        $this->foreignKeys[$foreignKey->getName()] = $foreignKey;

        return $this;
    }
1066188
public function addTranslationData($entity, $propertyPath, $data)
    {
        $metadata = $this->metadataCollection->getMetadata($entity);
        $property = $metadata->getProperty($propertyPath);
        $strategy = $this->strategyResolver->getStrategy($property->getStrategy());
        $strategy->addTranslationData($entity, $property, $data, $metadata);
    }