1 <?php
2 /* --------------------------------------------------------------
3 UserConfigurationWriter.inc.php 2015-10-05 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Class UserConfigurationWriter
14 *
15 * @category System
16 * @package UserConfiguration
17 * @subpackage Repository
18 */
19 class UserConfigurationWriter implements UserConfigurationWriterInterface
20 {
21 /**
22 * @var CI_DB_query_builder
23 */
24 protected $db;
25
26
27 public function __construct(CI_DB_query_builder $db)
28 {
29 $this->db = $db;
30 }
31
32
33 /**
34 * @override
35 */
36 public function setUserConfiguration(IdType $userId, $configurationKey, $configurationValue)
37 {
38 $this->db->replace('user_configuration', array(
39 'customer_id' => (string)$userId,
40 'configuration_key' => $configurationKey,
41 'configuration_value' => $configurationValue
42 ));
43 }
44 }