Used to link a child object to its parent and vice-versa after a add_link operation
490976
def link_child_to_parent(operation)
    child_collection = operation.klass.send("#{operation.klass_name}") || []
    child_collection << operation.child_klass
    operation.klass.send("#{operation.klass_name}=", child_collection)

    # Attach the parent to the child
    parent_meta = @class_metadata[operation.klass.class.to_s][operation.klass_name]
    child_meta = @class_metadata[operation.child_klass.class.to_s]
    # Find the matching relationship on the child object
    child_properties = Helpers.normalize_to_hash(
        child_meta.select { |k, prop|
          prop.nav_prop &&
              prop.association.relationship == parent_meta.association.relationship })

    child_property_to_set = child_properties.keys.first # There should be only one match
    # TODO: Handle many to many scenarios where the child property is an enumerable
    operation.child_klass.send("#{child_property_to_set}=", operation.klass)
  end
1340226
function(obj, objDict) {
	    var parent = objDict[ obj.parentPath ];
	    if (parent) {
		if (parent.Substates == undefined)
		    parent.Substates = [];
		parent.Substates.push( obj );
	    }
	}
1326298
def linkToWithActiveTab(self, childItem, parentItem):
        
        return self.linkTo(parentItem.storeID) + '/' + self.toWebID(childItem)
1109736
def add_child(self, frame, after=None):
        '''
        
        '''
        frame.remove_from_parent()
        frame.parent = self
        if after is None:
            self._children.append(frame)
        else:
            index = self._children.index(after) + 1
            self._children.insert(index, frame)

        self._invalidate_time_caches()
145109
def link_in(self, other, preserve=False):
        
        if preserve:
            other = other.clone()
        link_modules(self, other)
213050
function(operation, childNode, extra) {
			var data,
				modifyChild = this.tree.options.modifyChild;

			if (modifyChild) {
				if (childNode && childNode.parent !== this) {
					$.error(
						"childNode " + childNode + " is not a child of " + this
					);
				}
				data = {
					node: this,
					tree: this.tree,
					operation: operation,
					childNode: childNode || null,
				};
				if (extra) {
					$.extend(data, extra);
				}
				modifyChild({ type: "modifyChild" }, data);
			}
		}
766099
static function link_objects($obj1, $obj2, $params = array())
	{
		if(!$obj1 || !$obj2)
			return false;

		// Don't use expression. I's lazy and not works for thow argument if first true.
		$up1 = self::link_object_to($obj1, $obj2, $params);
		$up2 = self::link_object_to($obj2, $obj1, $params);
		return $up1 || $up2;
	}
537769
function addChildAt(child, index) {
         if (index >= 0 && index < this.children.length) {
           if (child.ancestor instanceof me.Container) {
             child.ancestor.removeChildNow(child);
           } else {
             // only allocate a GUID if the object has no previous ancestor
             // (e.g. move one child from one container to another)
             if (child.isRenderable) {
               // allocated a GUID value
               child.GUID = me.utils.createGUID();
             }
           }

           child.ancestor = this;
           this.children.splice(index, 0, child);

           if (typeof child.onActivateEvent === "function" && this.isAttachedToRoot()) {
             child.onActivateEvent();
           }

           this.onChildChange.call(this, index);
           return child;
         } else {
           throw new Error("Index (" + index + ") Out Of Bounds for addChildAt()");
         }
       }
1019447
def child_added(self, child):
        
        super(AbstractItemView, self).child_added(child)
        self.get_member('_items').reset(self)
1250024
def add_child_to_self( self, tree ):
        '''  '''
        assert isinstance(tree, Tree), \
               '(!) Unexpected type of argument for '+argName+'! Should be Tree.'
        if (not self.children):
            self.children = []
        tree.parent = self
        self.children.append(tree)
1124677
def append(self, child):
        
        if self._can_add_child(child):
            if self.element == child.parent:
                self._remove_from_traversal_index(child)
                self.list.append(child)
                try:
                    self.indexes[child.name].append(child)
                except KeyError:
                    self.indexes[child.name] = [child]
            elif self.element == child.traversal_parent:
                try:
                    self.traversal_indexes[child.name].append(child)
                except KeyError:
                    self.traversal_indexes[child.name] = [child]
727241
private Node<K, V> link(Node<K, V> y, Node<K, V> x) {
        y.parent = x;
        Node<K, V> child = x.child;
        if (child == null) {
            x.child = y;
            y.next = y;
            y.prev = y;
        } else {
            y.prev = child;
            y.next = child.next;
            child.next = y;
            y.next.prev = y;
        }
        return x;
    }
52774
def add(self, child):
        

        if isinstance(child, Action):
            self.add_action(child)
        else:
            raise ModelError('Unsupported child element')
909824
def add_parent(self, parent):
        
        parent.add_child(self)
        self.parent = parent
        return parent
434007
protected void relink(OutputElementBase parent)
    {
        mNsMapping = parent.mNsMapping;
        mNsMapShared = (mNsMapping != null);
        mDefaultNsURI = parent.mDefaultNsURI;
        mRootNsContext = parent.mRootNsContext;
    }
1313089
def link_add(self, rel, href, **atts):
        
        self.link_set(rel, href, allow_duplicates=True, **atts)
1257437
def insert_tree(self, items, node, headers):
        
        first = items[0]
        child = node.get_child(first)
        if child is not None:
            child.count += 1
        else:
            # Add new child.
            child = node.add_child(first)

            # Link it to header structure.
            if headers[first] is None:
                headers[first] = child
            else:
                current = headers[first]
                while current.link is not None:
                    current = current.link
                current.link = child

        # Call function recursively.
        remaining_items = items[1:]
        if len(remaining_items) > 0:
            self.insert_tree(remaining_items, child, headers)