Remove skillRelatedByParentId of this object
through the kk_trixionary_skill_dependency cross reference table.

@param ChildSkill $skillRelatedByParentId
@return ChildSkill The current object (for fluent API support)
557759
public function removeSkillRelatedByParentId(ChildSkill $skillRelatedByParentId)
    {
        if ($this->getSkillsRelatedByParentId()->contains($skillRelatedByParentId)) { $skillDependency = new ChildSkillDependency();

            $skillDependency->setSkillRelatedByParentId($skillRelatedByParentId);
            if ($skillRelatedByParentId->isSkillRelatedByDependencyIdsLoaded()) {
                //remove the back reference if available
                $skillRelatedByParentId->getSkillRelatedByDependencyIds()->removeObject($this);
            }

            $skillDependency->setSkillRelatedByDependencyId($this);
            $this->removeChild(clone $skillDependency);
            $skillDependency->clear();

            $this->collSkillsRelatedByParentId->remove($this->collSkillsRelatedByParentId->search($skillRelatedByParentId));

            if (null === $this->skillsRelatedByParentIdScheduledForDeletion) {
                $this->skillsRelatedByParentIdScheduledForDeletion = clone $this->collSkillsRelatedByParentId;
                $this->skillsRelatedByParentIdScheduledForDeletion->clear();
            }

            $this->skillsRelatedByParentIdScheduledForDeletion->push($skillRelatedByParentId);
        }


        return $this;
    }
456085
public function getSkillRelatedByPartId(ConnectionInterface $con = null)
    {
        if ($this->aSkillRelatedByPartId === null && ($this->part_id !== null)) {
            $this->aSkillRelatedByPartId = ChildSkillQuery::create()->findPk($this->part_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aSkillRelatedByPartId->addParts($this);
             */
        }

        return $this->aSkillRelatedByPartId;
    }
41526
protected function doRemoveFunctionPhases(Skill $model, $data) {
		$errors = [];
		foreach ($data as $entry) {
			if (!isset($entry['id'])) {
				$errors[] = 'Missing id for FunctionPhase';
			} else {
				$related = FunctionPhaseQuery::create()->findOneById($entry['id']);
				$model->removeFunctionPhase($related);
			}
		}

		if (count($errors) > 0) {
			return new ErrorsException($errors);
		}
	}
740169
public static function remove_competency_from_course($courseid, $competencyid) {
        $params = self::validate_parameters(self::remove_competency_from_course_parameters(), array(
            'courseid' => $courseid,
            'competencyid' => $competencyid,
        ));
        self::validate_context(context_course::instance($params['courseid']));
        return api::remove_competency_from_course($params['courseid'], $params['competencyid']);
    }
399840
public function removeRole(ChildRole $role)
    {
        if ($this->getRoles()->contains($role)) { $userRole = new ChildUserRole();

            $userRole->setRole($role);
            if ($role->isUsersLoaded()) {
                //remove the back reference if available
                $role->getUsers()->removeObject($this);
            }

            $userRole->setUser($this);
            $this->removeUserRole(clone $userRole);
            $userRole->clear();

            $this->collRoles->remove($this->collRoles->search($role));

            if (null === $this->rolesScheduledForDeletion) {
                $this->rolesScheduledForDeletion = clone $this->collRoles;
                $this->rolesScheduledForDeletion->clear();
            }

            $this->rolesScheduledForDeletion->push($role);
        }


        return $this;
    }
1289417
public function setSkill(ChildSkill $v = null)
    {
        if ($v === null) {
            $this->setSkillId(NULL);
        } else {
            $this->setSkillId($v->getId());
        }

        $this->aSkill = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildSkill object, it will not be re-added.
        if ($v !== null) {
            $v->addSkillReference($this);
        }


        return $this;
    }
789189
public function remove() {
		$p = $this->getParent();
		if (null == $p) {
			throw new LogicException();
		}
		$p->removeChildAt( $this->getChildIndex() );
		return $this;
	}
560591
public function removeReference(ChildReference $reference)
    {
        if ($this->getReferences()->contains($reference)) { $skillReference = new ChildSkillReference();

            $skillReference->setReference($reference);
            if ($reference->isSkillsLoaded()) {
                //remove the back reference if available
                $reference->getSkills()->removeObject($this);
            }

            $skillReference->setSkill($this);
            $this->removeSkillReference(clone $skillReference);
            $skillReference->clear();

            $this->collReferences->remove($this->collReferences->search($reference));

            if (null === $this->referencesScheduledForDeletion) {
                $this->referencesScheduledForDeletion = clone $this->collReferences;
                $this->referencesScheduledForDeletion->clear();
            }

            $this->referencesScheduledForDeletion->push($reference);
        }


        return $this;
    }
669228
public function getSkillRelatedByDependencyId(ConnectionInterface $con = null)
    {
        if ($this->aSkillRelatedByDependencyId === null && ($this->dependency_id !== null)) {
            $this->aSkillRelatedByDependencyId = ChildSkillQuery::create()->findPk($this->dependency_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aSkillRelatedByDependencyId->addChildren($this);
             */
        }

        return $this->aSkillRelatedByDependencyId;
    }
1074160
public function removeRightRelation(\TechPromux\DynamicQueryBundle\Entity\MetadataRelation $rightRelation)
    {
        $this->rightRelations->removeElement($rightRelation);
    }
600298
public function setDependencyId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->dependency_id !== $v) {
            $this->dependency_id = $v;
            $this->modifiedColumns[SkillDependencyTableMap::COL_DEPENDENCY_ID] = true;
        }

        if ($this->aSkillRelatedByDependencyId !== null && $this->aSkillRelatedByDependencyId->getId() !== $v) {
            $this->aSkillRelatedByDependencyId = null;
        }

        return $this;
    }
1239072
public static function add_related_competency($competencyid, $relatedcompetencyid) {
        static::require_enabled();
        $competency1 = new competency($competencyid);
        $competency2 = new competency($relatedcompetencyid);

        require_capability('moodle/competency:competencymanage', $competency1->get_context());

        $relatedcompetency = related_competency::get_relation($competency1->get('id'), $competency2->get('id'));
        if (!$relatedcompetency->get('id')) {
            $relatedcompetency->create();
            return true;
        }

        return true;
    }
479489
public function addFeaturedSkill(ChildSkill $l)
    {
        if ($this->collFeaturedSkills === null) {
            $this->initFeaturedSkills();
            $this->collFeaturedSkillsPartial = true;
        }

        if (!$this->collFeaturedSkills->contains($l)) {
            $this->doAddFeaturedSkill($l);
        }

        return $this;
    }
261476
protected function doRemoveParts(Skill $model, $data) {
		$errors = [];
		foreach ($data as $entry) {
			if (!isset($entry['id'])) {
				$errors[] = 'Missing id for Skill';
			} else {
				$related = SkillQuery::create()->findOneById($entry['id']);
				$model->removeSkillRelatedByPartId($related);
			}
		}

		if (count($errors) > 0) {
			return new ErrorsException($errors);
		}
	}
1207857
static function removeRelationObject( $contentObjectAttribute, $deletionItem )
    {
        if ( self::isItemPublished( $deletionItem ) )
        {
            return;
        }

        $hostObject = $contentObjectAttribute->attribute( 'object' );
        $hostObjectID = $hostObject->attribute( 'id' );

        // Do not try removing the object if present in trash
        // Only objects being really orphaned (not even being in trash) should be removed by this method.
        // See issue #019457
        if (
            (int)eZPersistentObject::count(
                eZContentObjectTrashNode::definition(),
                array( "contentobject_id" => $hostObjectID )
            ) > 0
        )
        {
            return;
        }

        $hostObjectVersions = $hostObject->versions();
        $isDeletionAllowed = true;

        // check if the relation item to be deleted is unique in the domain of all host-object versions
        foreach ( $hostObjectVersions as $version )
        {
            if ( $isDeletionAllowed and
                 $version->attribute( 'version' ) != $contentObjectAttribute->attribute( 'version' ) )
            {
                $relationAttribute = eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                                                           null,
                                                                           array( 'version' => $version->attribute( 'version' ),
                                                                                  'contentobject_id' => $hostObjectID,
                                                                                  'contentclassattribute_id' => $contentObjectAttribute->attribute( 'contentclassattribute_id' ) ) );

                if ( count( $relationAttribute ) > 0 )
                {
                    $relationContent = $relationAttribute[0]->content();
                    if ( is_array( $relationContent ) and
                         is_array( $relationContent['relation_list'] ) )
                    {
                        foreach( $relationContent['relation_list'] as $relationItem )
                        {
                            if ( $deletionItem['contentobject_id'] == $relationItem['contentobject_id'] &&
                                 $deletionItem['contentobject_version'] == $relationItem['contentobject_version'] )
                            {
                                $isDeletionAllowed = false;
                                break 2;
                            }
                        }
                    }
                }
            }
        }

        if ( $isDeletionAllowed )
        {
            $subObjectVersion = eZContentObjectVersion::fetchVersion( $deletionItem['contentobject_version'],
                                                                      $deletionItem['contentobject_id'] );
            if ( $subObjectVersion instanceof eZContentObjectVersion )
            {
                $subObjectVersion->removeThis();
            }
            else
            {
                eZDebug::writeError( 'Cleanup of subobject-version failed. Could not fetch object from relation list.\n' .
                                     'Requested subobject id: ' . $deletionItem['contentobject_id'] . '\n' .
                                     'Requested Subobject version: ' . $deletionItem['contentobject_version'],
                                     __METHOD__ );
            }
        }
    }
1355117
public function setSkill(ChildSkill $v = null)
    {
        if ($v === null) {
            $this->setId(NULL);
        } else {
            $this->setId($v->getId());
        }

        $this->aSkill = $v;

        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the ChildSkill object, it will not be re-added.
        if ($v !== null) {
            $v->addSkillVersion($this);
        }


        return $this;
    }
722084
private static void uninstallSkillsFinalStage(Iterable<? extends Skill> skills) {
		try {
			// Use reflection to ignore the "private/protected" access right.
			for (final Skill s : skills) {
				SREutils.doSkillUninstallation(s, UninstallationStage.POST_DESTROY_EVENT);
			}
		} catch (RuntimeException e) {
			throw e;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}