Adds Parts to Skill

@param mixed $id
@param mixed $data
@return PayloadInterface
181465
public function addParts($id, $data) {
		// find
		$model = $this->get($id);

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

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

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

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

		return NotUpdated(['model' => $model]);
	}
87929
public function addVariations($id, $data) {
		// find
		$model = $this->get($id);

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

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

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

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

		return NotUpdated(['model' => $model]);
	}
102745
protected function insertById($id, $data)
    {
        $fieldList = array_keys($data);
        $SQL = array(
            'INSERT INTO ' . $this->table,
            '(`' . implode('`, `', $fieldList) . '`) VALUES',
            '(:' . implode(', :', $fieldList) . ');'
        );
        $this->execute($SQL, $this->getBindParams($id, $data));
        return $SQL->getLastInsertId();
    }
116566
protected function doAddComposites(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->addSkillRelatedByCompositeId($related);
			}
		}

		if (count($errors) > 0) {
			return new ErrorsException($errors);
		}
	}
984404
public function add($id, $data = 1)
    {
        try {
            return $this->resource->hSet(static::CACHE_KEY, $id, $data);
        } catch (ConnectionException $e) {
            return false;
        }
    }
522022
public function update($id, $data)
    {
        $message = $this->client->put(
            sprintf('buckets/%d/messages/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Message($this->response($message));
    }
555385
public function update($id, array $data)
    {
        $todo = $this->client->put(
            sprintf('buckets/%d/todos/%d.json', $this->bucket, $id),
            [
                'json' => $data,
            ]
        );

        return new Todo($this->response($todo));
    }
573386
public function store($id, $data = array())
    {
        $data = array_merge(
            [self::DIAGNOSTIC_ID => $id],
            $data
        );

        $data = $this->cleanInputData($data);

        $this->openFile();
        $this->update($id, $data);

        return $this;
    }
1047263
protected function doUpdateParts(Skill $model, $data) {
		// remove all relationships before
		SkillPartQuery::create()->filterBySkillRelatedByCompositeId($model)->delete();

		// add them
		$errors = [];
		foreach ($data as $entry) {
			if (!isset($entry['id'])) {
				$errors[] = 'Missing id for Skill';
			} else {
				$related = SkillQuery::create()->findOneById($entry['id']);
				$model->addSkillRelatedByPartId($related);
			}
		}

		if (count($errors) > 0) {
			throw new ErrorsException($errors);
		}
	}
836725
public function updateSkills($id, $data) {
		// find
		$model = $this->get($id);

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

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

		// save and dispatch events
		$this->dispatch(ReferenceEvent::PRE_SKILLS_UPDATE, $model, $data);
		$this->dispatch(ReferenceEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(ReferenceEvent::POST_SKILLS_UPDATE, $model, $data);
		$this->dispatch(ReferenceEvent::POST_SAVE, $model, $data);

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

		return NotUpdated(['model' => $model]);
	}
31944
public function update($id, array $data)
    {
        $data = $this->resolverFactory->createExistingDeviceResolver()->resolve($data);

        return $this->api->request('PUT', '/players/'.$id, [], json_encode($data));
    }
143714
public function saveById($id, $data)
    {
        $this->getRequest()->putContents($this->getKey(), $id, $data);
        return $id;
    }
803933
public function updateFunctionPhases($id, $data) {
		// find
		$model = $this->get($id);

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

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

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

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

		return NotUpdated(['model' => $model]);
	}
843623
public function updateObjects($id, $data) {
		// find
		$model = $this->get($id);

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

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

		// save and dispatch events
		$this->dispatch(SportEvent::PRE_OBJECTS_UPDATE, $model, $data);
		$this->dispatch(SportEvent::PRE_SAVE, $model, $data);
		$rows = $model->save();
		$this->dispatch(SportEvent::POST_OBJECTS_UPDATE, $model, $data);
		$this->dispatch(SportEvent::POST_SAVE, $model, $data);

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

		return NotUpdated(['model' => $model]);
	}
146838
public function update($data, $id) {

		$bean = \R::findOne( $this->type, ' id = :id ', [ ':id' => $id ] );
		if ( !$bean ) {
			throw new \Exception('This '.$this->type.' does not exist.');
		}
		return $this->set($data, $bean);

	}
363086
public function write($id, $data)
    {
        return parent::write($id, $this->encrypt($data, $this->key));
    }
185785
public function requestToInterface($id, $data)
    {
        $pharmacyInterface = $this->repository->update($id, $data);
        return $pharmacyInterface;
    }