Deletes a link between an objective and a competency.

@param ObjectiveCompetency $link
493387
public function deleteCompetencyLink(ObjectiveCompetency $link)
    {
        $this->om->remove($link);
        $this->om->flush();
        $this->progressManager->recomputeObjectiveProgress($link->getObjective());
    }
960251
private void deleteLinkValue(String targetObjID) {
        int targetShardNo = getTargetObjectShardNumber(targetObjID);
        if (targetShardNo > 0 && m_linkDef.isSharded()) {
            m_dbTran.deleteShardedLinkValue(targetObjID, m_linkDef, m_dbObj.getObjectID(), targetShardNo);
        } else {
            m_dbTran.deleteLinkValue(m_dbObj.getObjectID(), m_linkDef, targetObjID);
        }
        deleteLinkInverseValue(targetObjID);
    }
807642
public static function delete_competency($id) {
        global $DB;
        static::require_enabled();
        $competency = new competency($id);

        // First we do a permissions check.
        require_capability('moodle/competency:competencymanage', $competency->get_context());

        $events = array();
        $competencyids = array(intval($competency->get('id')));
        $contextid = $competency->get_context()->id;
        $competencyids = array_merge(competency::get_descendants_ids($competency), $competencyids);
        if (!competency::can_all_be_deleted($competencyids)) {
            return false;
        }
        $transaction = $DB->start_delegated_transaction();

        try {

            // Reset the rule of the parent.
            $parent = $competency->get_parent();
            if ($parent) {
                $parent->reset_rule();
                $parent->update();
            }

            // Delete the competency separately so the after_delete event can be triggered.
            $competency->delete();

            // Delete the competencies.
            competency::delete_multiple($competencyids);

            // Delete the competencies relation.
            related_competency::delete_multiple_relations($competencyids);

            // Delete competency evidences.
            user_evidence_competency::delete_by_competencyids($competencyids);

            // Register the competencies deleted events.
            $events = \core\event\competency_deleted::create_multiple_from_competencyids($competencyids, $contextid);

        } catch (\Exception $e) {
            $transaction->rollback($e);
        }

        $transaction->allow_commit();
        // Trigger events.
        foreach ($events as $event) {
            $event->trigger();
        }

        return true;
    }
401903
public function prune($personFunctionLink = null)
    {
        if ($personFunctionLink) {
            $this->addUsingAlias(PersonFunctionLinkTableMap::ID, $personFunctionLink->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
967340
protected function deleteEntityLink($id)
    {
        $post = $this->repository->find($id);

        $this->manager->remove($post);
        $this->manager->flush();
    }
664978
public function destroyManialinkActions(ManialinkInterface $manialink)
    {
        if (isset($this->actionsByManialink[$manialink->getId()])) {
            foreach ($this->actionsByManialink[$manialink->getId()] as $actionId => $action) {
                unset($this->actions[$actionId]);
                unset($this->manialinkByAction[$actionId]);
            }

            unset($this->actionsByManialink[$manialink->getId()]);
        }
    }
1049109
protected void removeExecutionLink(TimerJobEntity jobEntity) {
        if (jobEntity.getExecutionId() != null) {
            ExecutionEntity execution = getExecutionEntityManager().findById(jobEntity.getExecutionId());
            if (execution != null) {
                execution.getTimerJobs().remove(jobEntity);
            }
        }
    }
255224
public function setLink($link)
    {
        if (strlen($link) == 0) {
            throw new \InvalidArgumentException(sprintf('Image link should not be empty'));
        }

        $this->link = $link;

        return $this;
    }
1220022
public static function remove(string $link = ''): bool
    {
        $link = static::normalizePath($link);
        if (static::exists($link)) {
            return @\unlink($link);
        }
        return false;
    }
954967
protected static function delete_user_competencies($userid) {
        global $DB;
        $usercontext = context_user::instance($userid);

        // Remove all the comments made on user competencies.
        \core_comment\privacy\provider::delete_comments_for_all_users($usercontext, 'competency', 'user_competency');

        // Find the user competency IDs.
        $ucids = $DB->get_fieldset_select(user_competency::TABLE, 'id', 'userid = :userid', ['userid' => $userid]);
        if (empty($ucids)) {
            return;
        }
        list($insql, $inparams) = $DB->get_in_or_equal($ucids, SQL_PARAMS_NAMED);

        // Delete all the evidence associated with competencies.
        $DB->delete_records_select(evidence::TABLE, "usercompetencyid $insql", $inparams);

        // Delete all the record of competency.
        $DB->delete_records_select(user_competency::TABLE, "id $insql", $inparams);
    }
708056
function symlink($target, $link)
    {
        if ($this->exists($link)) {
            $this->unlink($link);
        }

        symlink($target, $link);
    }
354936
public function addLink(Link $link)
    {
        $name = $link->getName();

        if (isset($this->links[$name])) {
            throw new \LogicException(sprintf('A link name by "%s" is already exists.', $name));
        }

        $this->links[$name] = $link;
    }
1052014
public function executePendingLinkage()
    {
        foreach ($this->pendingLinks as $item) {
            /** @var ShareOneOrMany $rel */
            $rel = $item['relation'];
            if ($item['link']) {
                $rel->link($this, $item['entity']);
            } else {
                $rel->unlink($this, $item['entity']);
            }
        }

        $this->pendingLinks = [];
    }
700413
protected function prepareLink(string &$link = null): void
	{
		if ($link !== null) {
			if (Strings::endsWith($link, ':default')) {
				$link = substr($link, 0, -7);
			}
			$pos = strrpos($link, ':');
			if ($pos !== strlen($link)) {
				$link = substr($link, 0, $pos + 1);
			}
		}
	}
1213039
public function setLink($link)
    {
        $relation = new RelationLink();
        $relation
            ->setRelationType('alternate')
            ->setUrl($link);
        return $this->setRelation($relation);
    }
661719
public function clickLink($link) {
		$link = $this->fixStepArgument($link);
		$links = $this->getSession()->getPage()->findAll('named', array(
			'link', $this->getSession()->getSelectorsHandler()->xpathLiteral($link)
		));
		if($links) foreach($links as $l) {
			if($l->isVisible()) {
				$l->click();
				return;
			}
		}
		throw new ElementNotFoundException(
			$this->getSession(), 'link', 'id|name|label|value', $link
		);
	}
758088
public void deregisterLink()
  { 
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deregisterLink");
    //Deregister the link with TRM
    deregisterDestination();    
    // Tell TRM that the link should be undefined 
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      SibTr.debug(tc, "Deregister MQLink: " + getUuid() + ", with mqLinkManager");       
    _mqLinkManager.undefine(getUuid());

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deregisterLink");
  }