This method just attaches the {@link LinkModel} to the {@link OrganizationModel}. It will only do so if this link is not already
present.
546114
public OrganizationModel attachLink(OrganizationModel organizationModel, LinkModel linkModel)
    {
        // check for duplicates
        for (LinkModel existing : organizationModel.getLinks())
        {
            if (existing.equals(linkModel))
            {
                return organizationModel;
            }
        }
        organizationModel.addLink(linkModel);
        return organizationModel;
    }
123156
protected void ensureLinkingOperation() {
		if (!this.hasLinkingOperation) {
			this.hasLinkingOperation = true;
			final XExpression target = getExpression().getTarget();
			if (!hasReceiver()) {
				// Static call
				this.receiver = null;
				this.argument = target;
			} else if (getOperation().getParameters().isEmpty()) {
				// Call on the receiver instance
				this.receiver = target;
				this.argument = null;
			} else {
				// Call to an object that is not the target, with the target as arugment
				this.argument = target;

				final XExpression obj1 = this.description.getSyntacticReceiver();
				final XExpression obj2 = this.description.getImplicitFirstArgument();
				final XExpression obj3 = this.description.getImplicitReceiver();

				if (obj1 != null && obj1 != target) {
					this.receiver = obj1;
				} else if (obj2 != null && obj2 != target) {
					this.receiver = obj2;
				} else if (obj3 != target) {
					this.receiver = obj3;
				} else {
					this.receiver = null;
				}
			}
		}
	}
410513
def _attach_to_model(self, model):
        
        super(RelatedFieldMixin, self)._attach_to_model(model)

        if model.abstract:
            # do not manage the relation if it's an abstract model
            return

        # now, check related_name and save the relation in the database

        # get related parameters to identify the relation
        self.related_name = self._get_related_name()
        self.related_to = self._get_related_model_name()

        # create entry for the model in the _relations list of the database
        if not hasattr(self.database, '_relations'):
            self.database._relations = {}
        self.database._relations.setdefault(self.related_to, [])

        # check unicity of related name for related model
        self._assert_relation_does_not_exists()

        # the relation didn't exists, we can save it
        relation = (self._model._name, self.name, self.related_name)
        self.database._relations[self.related_to].append(relation)
178218
private void addLinkedResource(FilePathMapping linkedResource) {
		linkedResources.add(linkedResource);
		if (parent != null) {
			parent.addLinkedResource(linkedResource);
		}
	}
692386
def attach(*layouts, **kwargs):
    

    def _model_admin_wrapper(layout_class):
        register(layout_class, layouts[0])
        return layout_class
    return _model_admin_wrapper
508740
public synchronized void replaceModel (MaxentModel model) {
	replacementThread = Thread.currentThread();
	while (!replacementCanProceed) Thread.yield();
	setter.setModel(model);
	replacementThread = null;
    }
1219892
def addModel(self, moduleName, modelName, model):
        
        modelIdentifier = "{}.{}".format(moduleName, modelName)
        if modelIdentifier not in self._models:
            self._models[modelIdentifier] = model
        else:
            message = "Application - addModel() - " \
                      "A model with the identifier {} already exists." \
                      .format(modelIdentifier)
            raise Exception(message)
1011929
@SuppressWarnings("unchecked")
	public T add(Link link) {

		Assert.notNull(link, "Link must not be null!");

		this.links.add(link);

		return (T) this;
	}
374264
void attach() {
    editors.addAll(editorSource.create(workingCopy.size(), 0));
    final int size = workingCopy.size();
    for (int i = 0; i < size; i++) {
      chain.attach(workingCopy.get(i), editors.get(i));
    }
  }
1132923
public synchronized final void append(Link link)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "append");

        Link prev = _dummyTail._getPreviousLink();
        link._link(prev, _dummyTail, _nextPositionToIssue++, this);
        prev._setNextLink(link);
        _dummyTail._setPreviousLink(link);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "append", _debugString());
    }
1353971
public void addFilterModel(final FilterModel model) {
		if (model.getUrlPatterns() != null) {
			try {
				filterLock.writeLock().lock();
				associateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle());
				for (String virtualHost : resolveVirtualHosts(model)) {
					for (String urlPattern : model.getUrlPatterns()) {
							final UrlPattern newUrlPattern = new UrlPattern(getFullPath(model.getContextModel(), urlPattern),
											model);
							String fullPath = getFullPath(model.getContextModel(), urlPattern);
							if (filterUrlPatterns.get(virtualHost) == null) {
								filterUrlPatterns.put(virtualHost, new ConcurrentHashMap<>());
							}
							Set<UrlPattern> urlSet = filterUrlPatterns.get(virtualHost).get(fullPath);
							if (urlSet == null) {
									//initialize first
									urlSet = new HashSet<>();
							}
							urlSet.add(newUrlPattern);
							filterUrlPatterns.get(virtualHost).put(fullPath, urlSet);
    //					final UrlPattern existingPattern = filterUrlPatterns.putIfAbsent(
    //							getFullPath(model.getContextModel(), urlPattern), newUrlPattern);
    //					if (existingPattern != null) {
    //						// this should never happen but is a good assertion
    //						LOG.error("Internal error (please report): Cannot associate url mapping "
    //								+ getFullPath(model.getContextModel(), urlPattern) + " to " + newUrlPattern
    //								+ " because is already associated to " + existingPattern);
    //					}
                                    }
                                }
			} finally {
				filterLock.writeLock().unlock();
			}
		}
	}
358735
protected HalRepresentation add(final Links links) {
        this.links = this.links != null
                ? copyOf(this.links).with(links).build()
                : links.using(this.curies);
        if (embedded != null) {
            embedded = embedded.using(this.curies);
        }
        return this;
    }
1243678
def attached_to_model(self):
        """"""
        try:
            if not bool(self._model):
                return False
        except AttributeError:
            return False
        else:
            try:
                return not bool(self._instance)
            except AttributeError:
                return True
1271738
private void linkMembersToShapes(IntermediateModel model) {
        for (Map.Entry<String, ShapeModel> entry : model.getShapes().entrySet()) {
            if (entry.getValue().getMembers() != null) {
                for (MemberModel member : entry.getValue().getMembers()) {
                    member.setShape(
                            Utils.findShapeModelByC2jNameIfExists(model, member.getC2jShape()));
                }
            }
        }
    }
1062988
public function attach($model, string $relation, Model $value)
    {
        if (! $model instanceof Model) {
            $model = $this->find($model);
        }

        $model->$relation()->attach($value);
    }
259088
public void setLinkManager(LinkManager linkManager)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "setLinkManager", linkManager);
    
    _localisationManager.getTRMFacade().setLinkManager(linkManager);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
       SibTr.exit(tc, "setLinkManager");
  }
1282476
public function link(Model $model) {
        $this->getLinked()->flush()->append($model);

        $this->getPrimaryModel()->set($this->getPrimaryForeignKey(), $model->id());

        return $this;
    }