Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
orzuionut committed Jun 15, 2021
1 parent 4863196 commit 9cbdf2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions w2g2/lib/Db/ConfigMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ protected function get($configKey)
return $row ? $row['configvalue'] : '';
}

public function store($type, $value)
public function storeConfig($type, $value)
{
$query = "INSERT INTO *PREFIX*appconfig(appid,configkey,configvalue) VALUES('w2g2',?,?)";

$this->db->executeQuery($query, [$type, $value]);
}

public function update($type, $value)
public function updateConfig($type, $value)
{
$query = "UPDATE *PREFIX*appconfig set configvalue=? WHERE appid='w2g2' and configkey=?";

Expand Down
4 changes: 2 additions & 2 deletions w2g2/lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public function getLockingByNameRule()

public function store($type, $value)
{
$this->configMapper->store($type, $value);
$this->configMapper->storeConfig($type, $value);
}

public function update($type, $value)
{
$this->configMapper->update($type, $value);
$this->configMapper->updateConfig($type, $value);
}

private function handleException($e)
Expand Down
4 changes: 2 additions & 2 deletions w2g2/lib/UIMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class UIMessage
protected $userNameRule;
protected $l;

public function __construct()
public function __construct(ConfigMapper $configMapper)
{
$this->userNameRule = ConfigMapper::getLockingByNameRule();
$this->userNameRule = $configMapper->getLockingByNameRule();

$this->l = \OCP\Util::getL10N('w2g2');
}
Expand Down

0 comments on commit 9cbdf2d

Please sign in to comment.