Sets the Skill id

@param mixed $id
@param mixed $relatedId
@return PayloadInterface
166972
public function setSkillId($id, $relatedId) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Position not found.']);
		}

		// update
		if ($this->doSetSkillId($model, $relatedId)) {
			$this->dispatch(PositionEvent::PRE_SKILL_UPDATE, $model);
			$this->dispatch(PositionEvent::PRE_SAVE, $model);
			$model->save();
			$this->dispatch(PositionEvent::POST_SKILL_UPDATE, $model);
			$this->dispatch(PositionEvent::POST_SAVE, $model);

			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
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;
    }
634737
public function assignChild ($relationIdentifier, $id, $childId)
		{
			$relation = $this->getRelation($relationIdentifier);

			if (!$relation) {
				throw new RelationException('Invalid relation `' . $relationIdentifier);
			}

			if ($relation instanceof OneToMany) {
				$this->database->createQuery()
					->update()
					->table($relation->getRelatedTable())
					->set(
						array(
							$relation->getRelatedKey() => $id,
						)
					)
					->whereEqual($relation->getKey(), $childId)
					->execute();
			} else if ($relation instanceof ManyToMany) {
				if (! $this->getChild($relationIdentifier, $id, $childId)) {
					$this->database->createQuery()
						->insert()
						->into($relation->getRelationalTable())
						->set(
							array(
								$relation->getKey()         => $id,
								$relation->getRelatedKey()  => $childId,
							)
						)
						->execute();
				}
			} else {
				throw new RelationException('Invalid relation type `' . gettype($relation) . '`');
			}
		}
499190
public function updateParents($id, $data) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// pass update to internal logic
		try {
			$this->doUpdateParent($model, $data);
		} catch (ErrorsException $e) {
			return new NotValid(['errors' => $e->getErrors()]);
		}

		// save and dispatch events
		$this->dispatch(SkillEvent::PRE_CHILDREN_UPDATE, $model, $data);
		$this->dispatch(SkillEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SkillEvent::POST_CHILDREN_UPDATE, $model, $data);
		$this->dispatch(SkillEvent::POST_SAVE, $model, $data);

		if ($rows > 0) {
			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
1319740
protected function setFieldValue($id)
    {
        $relations = $this->getRelations();

        $this->model = $this->model->with($relations)->findOrFail($id);

//        static::doNotSnakeAttributes($this->model);

        $data = $this->model->toArray();

        $this->builder->fields()->each(function (Field $field) use ($data) {
            $field->fill($data);
        });
    }
983463
public function setId($id)
    {
        if ($this->hasData(self::P_ID)) {
            throw new JobException('Cant set id cause it is already sets!');
        }

        return $this->setData(self::P_ID, $id);
    }
888586
public static function delete_competency($id) {
        $params = self::validate_parameters(self::delete_competency_parameters(), array(
            'id' => $id,
        ));

        $competency = api::read_competency($params['id']);
        $context = $competency->get_context();
        self::validate_context($context);

        return api::delete_competency($params['id']);
    }
4468
public function setContentId( $id )
    {
        $this->contentId    = empty( $id ) ? null : (int) $id;
        $this->_uriCache    = null;
        $this->_visible     = null;
        return $this;
    }
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}
25265
protected function setError($id)
    {
        $queueEvent = new QueueSetErrorEvent();
        $queueEvent->setId($id);
        $this->dispatcher->dispatch($queueEvent::NAME, $queueEvent);
    }
1103140
public function addKstrukturs($id, $data) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// pass add to internal logic
		try {
			$this->doAddKstrukturs($model, $data);
		} catch (ErrorsException $e) {
			return new NotValid(['errors' => $e->getErrors()]);
		}

		// save and dispatch events
		$this->dispatch(SkillEvent::PRE_KSTRUKTURS_ADD, $model, $data);
		$this->dispatch(SkillEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SkillEvent::POST_KSTRUKTURS_ADD, $model, $data);
		$this->dispatch(SkillEvent::POST_SAVE, $model, $data);

		if ($rows > 0) {
			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
307098
public function setAncestorId($id, $relatedId) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Lineage not found.']);
		}

		// update
		if ($this->doSetAncestorId($model, $relatedId)) {
			$this->dispatch(LineageEvent::PRE_ANCESTOR_UPDATE, $model);
			$this->dispatch(LineageEvent::PRE_SAVE, $model);
			$model->save();
			$this->dispatch(LineageEvent::POST_ANCESTOR_UPDATE, $model);
			$this->dispatch(LineageEvent::POST_SAVE, $model);

			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
895459
public function setId($Id) 
    {
        if (!$this->_isNumericArray($Id)) {
            $Id =  array ($Id);    
        }
        $this->fields['Id']['FieldValue'] = $Id;
        return $this;
    }
354610
public function setFeaturedSkillId($id, $relatedId) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Picture not found.']);
		}

		// update
		if ($this->doSetFeaturedSkillId($model, $relatedId)) {
			$this->dispatch(PictureEvent::PRE_FEATURED_SKILL_UPDATE, $model);
			$this->dispatch(PictureEvent::PRE_SAVE, $model);
			$model->save();
			$this->dispatch(PictureEvent::POST_FEATURED_SKILL_UPDATE, $model);
			$this->dispatch(PictureEvent::POST_SAVE, $model);

			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
1305294
public function setStartPositionId($id, $relatedId) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Skill not found.']);
		}

		// update
		if ($this->doSetStartPositionId($model, $relatedId)) {
			$this->dispatch(SkillEvent::PRE_START_POSITION_UPDATE, $model);
			$this->dispatch(SkillEvent::PRE_SAVE, $model);
			$model->save();
			$this->dispatch(SkillEvent::POST_START_POSITION_UPDATE, $model);
			$this->dispatch(SkillEvent::POST_SAVE, $model);

			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}
1224328
protected function doSetSkillId(Kstruktur $model, $relatedId) {
		if ($model->getSkillId() !== $relatedId) {
			$model->setSkillId($relatedId);

			return true;
		}

		return false;
	}
556842
public function setReferenceId($id, $relatedId) {
		// find
		$model = $this->get($id);

		if ($model === null) {
			return new NotFound(['message' => 'Video not found.']);
		}

		// update
		if ($this->doSetReferenceId($model, $relatedId)) {
			$this->dispatch(VideoEvent::PRE_REFERENCE_UPDATE, $model);
			$this->dispatch(VideoEvent::PRE_SAVE, $model);
			$model->save();
			$this->dispatch(VideoEvent::POST_REFERENCE_UPDATE, $model);
			$this->dispatch(VideoEvent::POST_SAVE, $model);

			return Updated(['model' => $model]);
		}

		return NotUpdated(['model' => $model]);
	}