Updates setting in database

@param string $category Category name
@param string $key Setting key
@param string $value Setting value
@throws \yii\db\Exception
486380
protected function dbUpdate($category, $key, $value)
    {
        $updated_by = \Yii::$app->user->getId();
        $this->getDb()->createCommand('
            UPDATE
                {{setting}}
            SET
                `value` = :value,
                `updated_at` = NOW(),
                `updated_by` = :updated_by
            WHERE
                category = :category
                AND `key` = :key
        ', compact('category', 'key', 'value', 'updated_by'))->execute();
    }
794586
protected function updateCategory()
    {
        $this->controlAccess('category_edit');

        if ($this->category->update($this->data_category['category_id'], $this->getSubmitted())) {
            $url = "admin/content/category/{$this->data_category_group['category_group_id']}";
            $this->redirect($url, $this->text('Category has been updated'), 'success');
        }

        $this->redirect('', $this->text('Category has not been updated'), 'warning');
    }
350785
public function remove($category, $key = null)
    {
        if ($key === null) {
            $this->dbDelete($category);

            if (isset($this->items[$category])) {
                unset($this->items[$category]);
            }
        }

        if (is_string($key)) {
            $this->dbDelete($category, $key);

            if (isset($this->items[$category][$key])) {
                unset($this->items[$category][$key]);
            }
        }

        if (is_array($key)) {
            foreach ($key as $idx => $val) {
                $this->remove($category, $key);
            }
        }

    }
632350
public function set($key, $value, $type=null) {
		if($type === null)
			$res = serialize($value);
		else {
			$res = serialize(array(
				'_dataType' => $type,
				'input' => $this->types[$type][0]($value)
			));
		}
		$dal = $this->db->dal();
		if(!$dal->from($this->getTable())->where('key', $key)->update(array('value'=>$res)))
			$dal->into($this->getTable())->insert(array('key'=>$key, 'value'=>$res));
	}
1219152
protected function dbDelete($category, $key = null)
    {
        if ($key === null) {
            $this->getDb()->createCommand('
                DELETE FROM
                    {{setting}}
                WHERE
                    `category` = :category
            ', compact('category'))->execute();
        }

        if (is_string($key)) {
            $this->getDb()->createCommand('
                    DELETE FROM
                        {{setting}}
                    WHERE
                        `category` = :category
                        AND `key` = :key
                ', compact('category', 'key'))->execute();
        }

        if (is_array($key)) {
            foreach ($key as $val) {
                $this->dbDelete($category, $val);
            }
        }
    }
990983
public function category(Category $category)
    {
        $this->category = $category;

        $this->category->categorise($this);
    }
751396
protected function updatePrimaryKeys(array $category)
    {
        $this->setLastEntityId($category[MemberNames::ENTITY_ID]);
        $this->setLastRowId($category[$this->getPkMemberName()]);
    }
247922
public function setCategory(\Mvc\BlogBundle\Entity\Category $category)
    {
        $this->category = $category;

        return $this;
    }
903594
public function setCategory(array $category)
    {
        $categoryClassInstance = new Category();
        foreach ($category as $categoryInstance) {
            Validate::isInstanceOf(
                $categoryInstance,
                $categoryClassInstance,
                'category'
            );
        }
        $this->category = $category;
    }
199791
public function setCategory($category)
    {
        self::writeFullTag(
            $category,
            'category',
            true,
            'video:category',
            $this->validator,
            'validateCategory',
            $this->exception,
            'Provided category value is not a valid.'
        );

        return $this;
    }
453473
protected function set_categories() {
		$categories = get_the_category( get_the_ID() );
		if ( $categories ) {
			$category = array_shift( $categories );
			$this->set_ancestors( $category->term_id, 'category' );
			$this->set( $category->name, get_term_link( $category ) );
		}
	}
918027
protected function setKey($key, $value)
    {
        if ($key == $this->_keyName) {
            $this->_keyValue = $value;
            $this->_key['value'] = $value;
        }
    }
105035
public function update(User $user, $option, $categoryKey)
    {
        if (!empty($option)) {
            return $user->hasPermission('options-update-' . $categoryKey);
        }
        return false;
    }
994662
public function setCategories($categories)
    {
        foreach ($categories as $key => $name) {
            $this->_categories[$key] = $name;
        }
    }
1152124
def set_category(self, category):
        
        pcategory = self.find("general/category")
        pcategory.clear()
        name = ElementTree.SubElement(pcategory, "name")
        if isinstance(category, Category):
            id_ = ElementTree.SubElement(pcategory, "id")
            id_.text = category.id
            name.text = category.name
        elif isinstance(category, basestring):
            name.text = category
96874
public function update(CategoryRequest $request, Category $category)
    {
        $this->repository->update($category, $request->all());
        
        return redirect()->route('admin.category.index');
    }
1224469
public function set($key, $value, $section = null, $type = null)
    {
        if (is_null($section)) {
            $pieces = explode('.', $key);
            $section = $pieces[0];
            $key = $pieces[1];
        }

        if ($this->model->setSetting($section, $key, $value, $type)) {
            return true;
        }
        return false;
    }