merge two projects together (only for maven projects).

@param string $group
@param string $artifact
@param string $child

@return array
438296
public function mergeGa($group, $artifact, $child)
    {
        return $this->request(sprintf('projects/%s/%s/merge_ga/%s', $group, $artifact, $child));
    }
844466
public function removeChild(GroupInterface $child)
    {
        if (!$this->hasChild($child)) {
            throw new \InvalidArgumentException('Trying to remove a non existing child group');
        }

        $this->children->removeElement($child);
    }
19033
public function addChild(Node $child) {
        array_push($this->children, $child);
        $child->setParent( $this );
    }
933108
public Iterable<MavenProjectModel> findByGroupArtifactVersion(String groupId, String artifactId, String version)
    {
        String key = generateMavenKey(groupId, artifactId, version);
        Iterable<MavenProjectModel> facet = this.findAllByProperty(MavenProjectModel.MAVEN_IDENTIFIER, key);

        return facet;
    }
856670
protected function joinSelectors($parent, $child) {
        $setSelf = false;
        $out = array();
        foreach ($child as $part) {
            $newPart = array();
            foreach ($part as $p) {
                if ($p == self::$selfSelector) {
                    $setSelf = true;
                    foreach ($parent as $i => $parentPart) {
                        if ($i > 0) {
                            $out[] = $newPart;
                            $newPart = array();
                        }

                        foreach ($parentPart as $pp) {
                            $newPart[] = $pp;
                        }
                    }
                } else {
                    $newPart[] = $p;
                }
            }

            $out[] = $newPart;
        }

        return $setSelf ? $out : array_merge($parent, $child);
    }
1157332
private MavenProjectModel getMavenProject(MavenProjectService mavenProjectService, String groupId, String artifactId, String version)
    {
        Iterable<MavenProjectModel> possibleProjects = mavenProjectService.findByGroupArtifactVersion(groupId, artifactId, version);
        MavenProjectModel project = null;
        for (MavenProjectModel possibleProject : possibleProjects)
        {
            if (possibleProject.getRootFileModel() != null)
            {
                return possibleProject;
            }
            else if (project == null)
            {
                project = possibleProject;
            }
        }
        return project;
    }
1303930
public static function groupUpdate(Api\GroupUpdate $groupUpdate)
    {
        $fields = [];

        if (null != $groupUpdate->getName()) {
            $fields['name'] = $groupUpdate->getName() === Api\Reset::reset()
                            ? null
                            : $groupUpdate->getName();
        }

        if (!empty($groupUpdate->getMemberInsertions())) {
            $fields['add'] = $groupUpdate->getMemberInsertions();
        }

        if (!empty($groupUpdate->getMemberRemovals())) {
            $fields['remove'] = $groupUpdate->getMemberRemovals();
        }

        if (!empty($groupUpdate->getChildGroupInsertions())) {
            $fields['child_groups_add']
                = $groupUpdate->getChildGroupInsertions();
        }

        if (!empty($groupUpdate->getChildGroupRemovals())) {
            $fields['child_groups_remove']
                = $groupUpdate->getChildGroupRemovals();
        }

        if (null != $groupUpdate->getAddFromGroup()) {
            $fields['add_from_group'] = $groupUpdate->getAddFromGroup();
        }

        if (null != $groupUpdate->getRemoveFromGroup()) {
            $fields['remove_from_group'] = $groupUpdate->getRemoveFromGroup();
        }

        if (null != $groupUpdate->getAutoUpdate()) {
            if ($groupUpdate->getAutoUpdate() === Api\Reset::reset()) {
                $fields['auto_update'] = null;
            } else {
                $fields['auto_update'] = Serialize::_groupAutoUpdateHelper(
                    $groupUpdate->getAutoUpdate()
                );
            }
        }

        return empty($fields) ? '{}' : Serialize::_toJson($fields);
    }
747323
public static function mergeGroup($new, $old)
	{
		$new['namespace'] = static::formatUsesPrefix($new, $old);

		$new['prefix'] = static::formatGroupPrefix($new, $old);

		if (isset($new['domain'])) unset($old['domain']);

		$new['where'] = array_merge(array_get($old, 'where', []), array_get($new, 'where', []));

		return array_merge_recursive(array_except($old, array('namespace', 'prefix', 'where')), $new);
	}
430020
public static function pathsToPublish($provider = null, $group = null)
	{
		if ($group && array_key_exists($group, static::$publishGroups))
		{
			return static::$publishGroups[$group];
		}

		if ($provider && array_key_exists($provider, static::$publishes))
		{
			return static::$publishes[$provider];
		}

		if ($group || $provider)
		{
			return [];
		}

		$paths = [];

		foreach (static::$publishes as $class => $publish)
		{
			$paths = array_merge($paths, $publish);
		}

		return $paths;
	}
809927
public static function pathsToPublish($provider = null, $group = null)
    {
        if (! is_null($paths = static::pathsForProviderOrGroup($provider, $group))) {
            return $paths;
        }

        return collect(static::$publishes)->reduce(function ($paths, $p) {
            return array_merge($paths, $p);
        }, []);
    }
1284102
protected function mergeSuggests(RootPackageInterface $root)
    {
        if ( ! empty($suggests = $this->getPackage()->getSuggests())) {
            static::unwrapIfNeeded($root, 'setSuggests')
                ->setSuggests(array_merge($root->getSuggests(), $suggests));
        }
    }
734380
public function edit(Group $group, $child = null)
    {
        return view('core::admin.edit')
            ->with([
                'model'       => $group,
                'permissions' => $group->permissions,
            ]);
    }
452551
public function merge(Projection $projection)
    {
        $mergeParts = $projection->parts;

        foreach ($this->parts as $thisKey => $thisPart) {
            foreach ($mergeParts as $foreignKey => $mergePart) {
                if ($thisPart->isOverlapping($mergePart)) {
                    if ($mergePart->getLength() < $thisPart->getLength()) {
                        unset($this->parts[$thisKey]);
                        continue 2;
                    }

                    unset($mergeParts[$foreignKey]);
                    continue;
                }
            }
        }

        $this->parts = array_merge($this->parts, $mergeParts);
    }
1051420
public function merge(MetadataInterface $metadata): void
    {
        parent::merge($metadata);

        $this->customRepositoryClassName = $this->customRepositoryClassName ?? $metadata->customRepositoryClassName;
        $this->collectionName = $this->collectionName ?? $metadata->collectionName;
        $this->identifier = $this->identifier ?? $metadata->identifier;
        $this->idGeneratorType = $this->idGeneratorType ?? $metadata->idGeneratorType;

        $this->eagerFieldNames = array_unique(array_merge($this->eagerFieldNames, $metadata->eagerFieldNames));
        sort($this->eagerFieldNames);
    }
1012064
static function processNodeCombiningChildren( $useComments, $php, $tpl, &$nodeChildren, &$resourceData, &$parentNode )
    {
        $newNodeChildren = array();
        $lastNode = false;
        foreach ( $nodeChildren as $node )
        {
            $newNode = false;
            if ( !isset( $node[0] ) )
                continue;
            $nodeType = $node[0];
            if ( $nodeType == eZTemplate::NODE_ROOT )
            {
                $children = $node[1];
                $newNode = array( $nodeType,
                                  false );
                if ( $children )
                {
                    eZTemplateCompiler::processNodeCombiningChildren( $useComments, $php, $tpl, $children, $resourceData, $newNode );
                }
            }
            else if ( $nodeType == eZTemplate::NODE_TEXT )
            {
                $text = $node[2];
                $placement = $node[3];

                $newNode = array( $nodeType,
                                  false,
                                  $text,
                                  $placement );
                eZTemplateCompiler::combineStaticNodes( $tpl, $resourceData, $lastNode, $newNode );
            }
            else if ( $nodeType == eZTemplate::NODE_VARIABLE )
            {
                $variableCustom = $node[1];
                $variableData = $node[2];
                $variablePlacement = $node[3];
                $variableParameters = false;
                $dataInspection = eZTemplateCompiler::inspectVariableData( $tpl,
                                                                           $variableData, $variablePlacement,
                                                                           $resourceData );
                $newNode = $node;
                $newNode[1] = $variableCustom;
                unset( $dataInspection );
                eZTemplateCompiler::combineStaticNodes( $tpl, $resourceData, $lastNode, $newNode );
            }
            else if ( $nodeType == eZTemplate::NODE_FUNCTION )
            {
                $functionChildren = $node[1];
                $functionName = $node[2];
                $functionParameters = $node[3];
                $functionPlacement = $node[4];

                $newNode = array( $nodeType,
                                  false,
                                  $functionName,
                                  $functionParameters,
                                  $functionPlacement );
                if ( isset( $node[5] ) )
                    $newNode[5] = $node[5];

                if ( is_array( $functionChildren ) )
                {
                    eZTemplateCompiler::processNodeCombiningChildren( $useComments, $php, $tpl,
                                                                          $functionChildren, $resourceData, $newNode );
                }

            }
            else
                $newNode = $node;
            if ( $lastNode != false )
            {
                $newNodeChildren[] = $lastNode;
                $lastNode = false;
            }
            if ( $newNode != false )
                $lastNode = $newNode;
        }
        if ( $lastNode != false )
        {
            $newNodeChildren[] = $lastNode;
            $lastNode = false;
        }
        $parentNode[1] = $newNodeChildren;
    }
316835
public static function addGroupContent(NodeInterface $node, Group $group) {
    // TODO Check if group plugin id exists.
    $plugin_id = 'group_node:' . $node->bundle();
    $group->addContent($node, $plugin_id, ['uid' => $node->getOwnerId()]);
  }
752259
public function merge($entity) {
    // add to merged
    if (!$this->merged->contains($entity)) {
      $this->merged->add($entity);
    }
    
    // remove from removed,detached
    // nicht remove from persisted
    if ($this->removed->contains($entity)) {
      $this->removed->removeElement($entity);
    }
    if ($this->detached->contains($entity)) {
      $this->detached->removeElement($entity);
    }
    
    if ($this->delegate) {
      return parent::persist($entity);
    }
  }