Add a group to a group.

@param string $parent The parent group name
@param string $child  The child group name

@return bool
325665
public function addGroup($parent, $child)
    {
        // Find the parent group's dn
        $parentDn = $this->dn($parent);

        $childDn = $this->dn($child);

        if ($parentDn && $childDn) {
            $add['member'] = $childDn;

            // Add the child to the parent group and return the result
            return $this->connection->modAdd($parentDn, $add);
        }

        return false;
    }
1270625
protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        switch ($absoluteNodeName) {
        case $this->lookupNamespace('media') . ':' . 'group':
            $mediaGroup = new Zend_Gdata_Media_Extension_MediaGroup();
            $mediaGroup->transferFromDOM($child);
            $this->_mediaGroup = $mediaGroup;
            break;
        default:
            parent::takeChildFromDOM($child);
            break;
        }
    }
1245339
public function addChild(AbstractNode $child)
    {
        $key = null;

        // check integrity
        if ($this->isAncestor($child->id())) {
            throw new CircularException('Can not add child. It is my ancestor.');
        }

        // check if child is itself
        if ($child->id() == $this->id) {
            throw new CircularException('Can not set itself as a child.');
        }

        if ($this->hasChildren()) {
            if (isset($this->children[$child->id()])) {
                // we already have this child
                return false;
            }
            $sibling                      = $this->lastChild();
            $key                          = $sibling->id();
            $this->children[$key]['next'] = $child->id();
        }

        // add the child
        $this->children[$child->id()] = [
            'node' => $child,
            'next' => null,
            'prev' => $key,
        ];

        // tell child I am the new parent
        $child->setParent($this);

        //clear any cache
        $this->clear();

        return true;
    }
851878
protected function _pushParent(&$parent)
    {
        $children    = &$this->_getElementChildren($parent);
        $pathSegment = $this->_getElementPathSegment(null, $parent);

        $this->_pushPathSegment($pathSegment);

        reset($children);
        array_unshift($this->parents, $children);
    }
198413
protected function joinSelectors($parent, $child, $selfParentSelectors = null)
    {
        $setSelf = false;
        $out = [];

        foreach ($child as $part) {
            $newPart = [];

            foreach ($part as $p) {
                if ($p === static::$selfSelector) {
                    $setSelf = true;

                    if (is_null($selfParentSelectors)) {
                        $selfParentSelectors = $parent;
                    }

                    foreach ($selfParentSelectors as $i => $parentPart) {
                        if ($i > 0) {
                            $out[] = $newPart;
                            $newPart = [];
                        }

                        foreach ($parentPart as $pp) {
                            if (is_array($pp)) {
                                $flatten = [];
                                array_walk_recursive($pp, function ($a) use (&$flatten) {
                                    $flatten[] = $a;
                                });
                                $pp = implode($flatten);
                            }
                            $newPart[] = $pp;
                        }
                    }
                } else {
                    $newPart[] = $p;
                }
            }

            $out[] = $newPart;
        }

        return $setSelf ? $out : array_merge($parent, $child);
    }
1152896
public function addGroup(ChildGroup $group)
    {
        if ($this->collGroups === null) {
            $this->initGroups();
        }

        if (!$this->getGroups()->contains($group)) {
            // only add it if the **same** object is not already associated
            $this->collGroups->push($group);
            $this->doAddGroup($group);
        }

        return $this;
    }
766882
protected function addChild($parent, $child)
    {
        if (is_string($parent)) {
            $parent = $this->findItem($parent);
        }

        if (is_string($child)) {
            $child = $this->findItem($child);
        }

        echo "    > adding $child->name as child to $parent->name ...";
        $time = microtime(true);
        $this->authManager->addChild($parent, $child);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }
969161
public function setParent(LeafRole $parent = null)
    {
        if ($parent && !$parent->getChildren()->contains($this)) {
            $parent->addChild($this);
        }
        $this->parent = $parent;

        return $this;
    }
145594
private function setParent(&$parent)
    {
        if (! is_null($parent)) {
            $this->parent = $parent;

            $this->parent->elements->add($this);
        }

        return $this;
    }
197627
public function setParent($parent){

            $this->parent = $parent;

            if($this->parentCallback){
                call_user_func($this->parentCallback);
            }

            return $this;

        }
1007506
public function addChild(Menu $child)
    {
        $this->children[$child->getOrder() . '--' . $child->getLabel()] = $child;

        return $this;
    }
718632
public function addChild(ManiaLink $child)
    {
        if (!in_array($child, $this->children, true)) {
            array_push($this->children, $child);
        }
        return $this;
    }
828007
public function canAddChild($parent, $child)
	{
		return \App::$domain->rbac->item->canAddChild($parent, $child);
	}
154887
public function setChild($parent, $child)
    {
        if (is_string($parent)) {
            $name   = $parent;
            $parent = $this->getItem($parent);
            if (is_null($parent)) {
                throw new Exception("Unknown parent:$name at setChild");
            }
        }
        if (is_string($child)) {
            $name  = $child;
            $child = $this->getItem($child);
            if (is_null($child)) {
                throw new Exception("Unknown child:$name at setChild");
            }
        }
        if (isset($this->children[$parent->name][$child->name])) {
            return false;
        }

        return $this->addChild($parent, $child);
    }
1218120
public function addChild(Node $child)
    {

        if (!isset($this->relations['children'])) {
            $this->relations['children'] = [];
        }

        $this->relations['children'][] = $child;
        return $this;
    }
858118
public function addChild(MenuNode $child)
    {
        $child->parent = $this;
        $this->children[] = $child;

        return $this;
    }
1137162
public function addParent(NodeInterface $parent, bool $setParentsChild = true): NodeInterface
    {
        if (!$this->supportsParent($parent)) {
            throw ParentTypeNotSupportedException::create($this, $parent);
        }

        $this->_parents[$parent->getId()] = $parent;

        if ($setParentsChild) {
            $parent->addChild($this, false);
        }

        $this->notifySubscribers(
            self::EVENT_ADD_PARENT,
            ['oldParents' => $this->_parents, 'newParent' => $parent, 'child' => $this]
        );

        return $this;
    }