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);
            }
        }
    }
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);
            }
        }
    }
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 ) ; } } }
Deletes setting from database

@param string|array $category Category name(s)
@param string|array|null $key Setting key(s) or null to delete all values from category
@throws \yii\db\Exception
Deletes setting from database